JNI - (NT) debugging across JNI from Java host process
843829Sep 20 2010 — edited Sep 21 2010Hi,
we have been using a C library from a Java host process through a JNI bridge for a while and this has worked like a charm so far. We are now changing the internal version of the C library and some of the unit (or integration) tests developed in Java to test this integration now fail with a JVM crash (a typical EXCEPTION_ACCESS_VIOLATION (0xc0000005)). No doubt the native code is at fault, and not the JNI bridge which is of limited complexity and has not changed while the underlying C library has changed.
We do know how to debug the native code (setting breakpoints, etc), unfortunately the problem occurs only after a rather long execution path where the same C code which now fails is called many times during the execution of the 'unit' tests. Writing the same unit tests directly in the C code will be quite expansive at this stage.
Question: is there is a way to make sure the 'native' debugger (VC++ in that instance) intercepts the native crash like any other application crashing under NT? The crash seems to be rather inappropriately handled by the JVM to produce hs_xxx.log followed by exit, thus preventing the debugger from being triggered on JVM crash: this behaviour is of little value in this particular case.
This is NT, sun JVM 1.6 (_06 in this particular case, not sure if this helps much).
Many thanks in advance for any useful hints,
Adrien