|
From: Richard Frith-M. <ri...@br...> - 2006-01-16 07:13:05
|
I have a large body of code making complex use of JNI called from servlets in tomcat. Because this uses a lot of JNI, and was developed on the Sun implementation of java, I have been unable to find another implementation which will run it ... SableVM and Kaffe lack a lot of the JNI functions required. I have infrequent crashes in Java which are almost certainly due to errors in the JNI code ... most likely C library code writing to memory it shouldn't, and corrupting the Java system ... so valgrind seems the only realistic hope to catch that kind of thing. Unfortunately, valgrind doesn't seem to work with Sun's Java implementation. After much searching the 'resolved' bug #69508 seems to describe what is happening ... the last two comments in the bug report talk about Java re-execing to put its own directory at the front of LD_LIBRARY_PATH and valgrind doing the same ... getting into an infinite loop. I guess the bug being marked as 'resolved' refers to the original problem (a 'stack size too small' report) ... but it doesn't actually explain how to get valgrind/java to work together. has this actually been done? Is there a known workaround? I guess it ought to be possible to get valgrind to intercept the system calls that java uses and fool it into thinking its directory is the first in LD_LIBRARY_PATH? Or perhaps do some clever mixing/matching of java and valgrind libraries putting them both in the same directory I don't know enough about dynamic library loading to know whether that's really possible? I'd really appreciate some help on this. |