We have recently ported our C++ application from Solaris Sparc to Linux. The application uses JNI to use a third party java-based tool. The application runs fine on Solaris bu on Linux we get a SIGSEGV. The interesting part is that when we run a large volume of requests through and keep the process busy it works fine. As soon as we give it a little "break" and then submit another requests it crashes in libjvm with the call stack as below. Would it have something to do with garbage collection? Our application is 64 bit ans uses 64 bit JNI libraries. We are using Java 1.6 U23.
#0 0x00002aaaab2668f1 in resource_allocate_bytes(unsigned long) () from /....../libjvm.so
#1 0x00002aaaab33011b in UNICODE::as_utf8(unsigned short*, int) () from /.../libjvm.so
#2 0x00002aaaaafe7f3c in java_lang_String::as_utf8_string(oopDesc*, int, int) () from /..../libjvm.so
#3 0x00002aaaab01dc90 in jni_GetStringUTFRegion () from /..../libjvm.so
#4 0x00002aaaaaabe26c in Java_java_lang_Class_forName0 () from /..../libjava.so
#5 0x00002aaac77e873c in ?? ()
#6 0x00000006253a5908 in ?? ()
#7 0x0000000000000000 in ?? ()
Would it have something to do with garbage collection?
Probably it would have something to do with pointer bugs in your JNI code or even in the library you use.
A SIGSEGV occurs when the OS sees that the application is doing something it shouldn't. The fact that it runs on a different OS without problem would be irrelevant in the case of a pointer bug, because the execution path is different - thus the impact of the bug would be different.
That said because you are running 64 bits there is a remote chance the cause could be due to a bug in the VM. There is a thread in the JNI forum that refers to a specific option which helps with some cases. Whether it applies with you would require that you track down the message.