We are currently developing an application on a Sun Ultra 5 server, Solaris 8 operating system, JDK1.4.2_04-b05 and Perl version 5.8.4.
The application uses JPL to allow Java to execute some functions within a perl API and return the results. After a fixed number of calls between Java and Perl the following error occurs and the application core dumps. Any help with this matter would be greatly appreciated.
Unexpected Signal : 11 occurred at PC=0xFE0EE000 Function=[Unknown. Nearest: JVM_IsSupportedJNIVersion+0x984] Library=/usr/j2se/jre/lib/sparc/client/libjvm.so
Current Java thread: at JPLINManagerDebug.retreiveRecords(Native Method) at CTPMultipleTest.main(CTPMultipleTest.java:85)
Heap at VM Abort: Heap def new generation total 2112K, used 130K [0xf1400000, 0xf1620000, 0xf1b10000) eden space 2048K, 6% used [0xf1400000, 0xf1420b88, 0xf1600000) from space 64K, 0% used [0xf1600000, 0xf1600000, 0xf1610000) to space 64K, 0% used [0xf1610000, 0xf1610000, 0xf1620000) tenured generation total 1408K, used 0K [0xf1b10000, 0xf1c70000, 0xf5400000) the space 1408K, 0% used [0xf1b10000, 0xf1b10000, 0xf1b10200, 0xf1c70000) compacting perm gen total 4096K, used 964K [0xf5400000, 0xf5800000, 0xf9400000) the space 4096K, 23% used [0xf5400000, 0xf54f13f0, 0xf54f1400, 0xf5800000)
Local Time = Thu Aug 12 14:20:34 2004 Elapsed Time = 2 # # HotSpot Virtual Machine Error : 11 # Error ID : 4F530E43505002EF 01 # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # An error report file has been saved as hs_err_pid3319.log. # Please refer to the file for further information. # Abort(coredump)
Well, it's either a bug in the implementation of the native method JPLINManagerDebug.retreiveRecords, or it's a bug in some other native method, or it's a JVM bug. I'd investigate these three in that order.
Make sure the native code checks for errors and/or exceptions after every JNI call; if you continue after getting such an error, the behavior can be undefined. Remember, this is C, so dereferencing a null pointer can get you a Sig11, rather than the nice neat NullPointerException you'll get in Java.
Managed to isolate the problem and it only seems to occur when passing an array of Objects back from the Native code. Have managed a work-around by passing delimited strings instead. Would still be interested in knowing the cause of the problem, if anyone has any suggestions.