LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2006, 06:23 PM   #1
jugabaga
LQ Newbie
 
Registered: Apr 2006
Posts: 15

Rep: Reputation: 0
compiling netsnmpj, libnetsnmpj.so crash JVM


hi!
I'm trying to build my own libnetsnmpj.so lib, working with makefiles I get a libnetsnmpj.so file, but when I try to run the examples from java, the JVM crashes, which make me think that maybe I'm compliling in a bad way....
I got some other libnetsnmpj.so files and they throws warnings, my file crashes!!!

here is the stact trace:

Stack: [0xbfa3b000,0xbfc3b000), sp=0xbfc34f14, free space=2023k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libc.so.6+0x69e53] index+0x63
C [libnetsnmp.so.5+0x5a5bc] init_snmp_enum+0x7c
C [libnetsnmp.so.5+0x2d2fb] init_snmp+0x31e
C [libnetsnmpj.so+0xb2a5] JNI_OnLoad+0xfd
C [libjava.so+0xa79d] Java_java_lang_ClassLoader_00024NativeLibrary_load+0x1fd
j java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/StringV+0
j java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/FileZ+300
j java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+268
j java.lang.Runtime.loadLibrary0(Ljava/lang/Class;Ljava/lang/StringV+54
j java.lang.System.loadLibrary(Ljava/lang/StringV+7
j org.netsnmp.Warnings.loadNativeLibraryOrProvideWarning(Ljava/lang/StringV+1
j org.netsnmp.NetSNMPSession.<clinit>()V+44
v ~StubRoutines::call_stub
V [libjvm.so+0x174fec]
V [libjvm.so+0x2821f8]
V [libjvm.so+0x174e1f]
V [libjvm.so+0x1532b1]
V [libjvm.so+0x151dbf]
V [libjvm.so+0x150e67]
V [libjvm.so+0x166b16]
j org.netsnmp.examples.GetSysDescr.main([Ljava/lang/StringV+30
v ~StubRoutines::call_stub
V [libjvm.so+0x174fec]
V [libjvm.so+0x2821f8]
V [libjvm.so+0x174e1f]
V [libjvm.so+0x19f5c2]
V [libjvm.so+0x1907d2]
C [java+0x1803]
C [libc.so.6+0x14de6] __libc_start_main+0xc6

here is the compiling command:

g++ -g -shared -o linux-i386-dbg/libnetsnmpj.so -Xlinker -O -Xlinker 1 --startgroup linux-i386-dbg/NetSNMP.o linux-i386-dbg/nativeThread.o linux-i386-dbg/exception.o linux-i386-dbg/lock.o linux-i386-dbg/NetSNMPjClasses.o linux-i386-dbg/NetSNMPjSession_read.o linux-i386-dbg/NetSNMPjSession_send.o linux-i386-dbg/NetSNMPPDU.o linux-i386-dbg/NetSNMPjSession.o linux-i386-dbg/session_to_jobject.o linux-i386-dbg/agentX.o linux-i386-dbg/NetSNMPOID.o linux-i386-dbg/NetSNMPMIB.o \
-L/usr/lib -lnetsnmp -lcrypto -lrpm -lrpmio -lpopt -lz -lm -L/usr/lib/lib -lwrap -L/usr/lib -lnetsnmpagent -lnetsnmpmibs -lnetsnmphelpers -lnetsnmp -ldl -lcrypto -lrpm -lrpmio -lpopt -lz -lm -lsensors -L/usr/lib/lib -lwrap -lwrap -L/root/proyJava/JNISupport/linux-i386-dbg -ljnisupport -lpthread --endgroup

this did not show any errors, what could be wrong???

thanks.
 
Old 04-12-2006, 06:33 PM   #2
jugabaga
LQ Newbie
 
Registered: Apr 2006
Posts: 15

Original Poster
Rep: Reputation: 0
another problem with compliled libs

while using the compiled libs that come with the binary distribution, all the app load libnetsnmpj.so or netsnampj.

this lib calls to libnetsnmpmibs.so.5, and says that there are 2 functions without a definition:

rpmdbClose and sensors_get_label

I have read the lib with KHexEdit and I found that a reference exists.

Q:Why does this errors keep comming if the reference exists??

this is the error msg.

java.lang.UnsatisfiedLinkError: /root/netsnmpj-0.2.1/linux-i386/libnetsnmpj.so: /usr/lib/libnetsnmpmibs.so.5: undefined symbol: sensors_get_label
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to build netsnmpj minil Linux - Software 1 04-10-2006 12:35 PM
give a NEWB a crash course in Compiling APPS rpmheadache Linux - Software 3 02-22-2005 10:58 AM
Ms Jvm kpharda Linux - Software 2 03-18-2004 04:29 PM
xmms crash xine crash mplayer crash paledread Linux - Software 9 03-09-2004 07:09 AM
jvm zaman Linux - Software 1 07-07-2003 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration