|
From: Jason P. <jas...@gm...> - 2006-10-16 12:46:24
|
Hello all, I am using the wrapper to launch a java app which loads a native library of my own creation. When running outside the wrapper, my native code initialises and terminates successfully, and always has. When I run this same app within the wrapper, the JVM crashes when I am terminating my native resource. The native code I have is loading a COM DLL, and when my java app closes it releases an unloads the COM DLL. It is during this process that I get the JVM crash. Crash details are: jvm 1 | # jvm 1 | # An unexpected error has been detected by HotSpot Virtual Machine: jvm 1 | # jvm 1 | # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1900507f, pid=1168, tid=3016 jvm 1 | # jvm 1 | # Java VM: Java HotSpot(TM) Server VM (1.5.0_09-b01 mixed mode) jvm 1 | # Problematic frame: jvm 1 | # C jvm 1 | [JSAVI2.dll+0xb507f] jvm 1 | # jvm 1 | # An error report file with more information is saved as hs_err_pid1168.log jvm 1 | # jvm 1 | # If you would like to submit a bug report, please visit: jvm 1 | # http://java.sun.com/webapps/bugreport/crash.jsp jvm 1 | # wrapper | JVM exited unexpectedly while stopping the application. You will see that the "Problematic frame" is reported as JSAVI2.dll. This is my native DLL which loads/unloads the COM DLL. The call stack in the JVM error report looks like this: Stack: [0x19780000,0x197c0000), sp=0x197bee20, free space=251k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [JSAVI2.dll+0xb507f] C [JSAVI2.dll+0xb7259] j com.synetek.virus.scanner.JSavi.releaseSAVI (Lcom/synetek/virus/scanner/ScannerLog;)V+0 j com.synetek.virus.scanner.JSavi.destroy (Lcom/synetek/virus/scanner/ScannerLog;)V+9 j com.synetek.everymail.core.handler.PipelineHandler.destroy()V+27 j com.synetek.event.EventProcessor.destroy()V+43 j com.synetek.processor.MultiProcessor.destroy(J)V+41 j com.synetek.processor.ManagedMultiProcessor.stop(J)V+9 j com.synetek.everymail.core.pipeline.poll.PipelinePoller.destroy()V+12 j com.synetek.poller.AbstractPoller.stop(J)V+78 j com.synetek.poller.remote.RemoteController.stop(J)V+5 v ~StubRoutines::call_stub V [jvm.dll+0xf96e0] You can see that my call to "releaseSAVI" is where the crash occurs. Ordinarily I would assume that there is something wrong with my DLL, but it has been working correctly until now. I have checked and double-checked the implementation of this native method in the C++ code and I cannot see how or why I should be experiencing any problems (the native method is only 3 lines of code!). As stated, when I run my app in straight java land all is well. I have tried to debug my JNI DLL from Visual Studio, but the only way I know to do this is to "attach" to the java.exe process from within Visual Studio. Problem is that because java.exe crashes I don't get an opportunity to step through the execution of the native code. I'm a bit stuck here as there doesn't appear to be anything I can to short of not using the wrapper. This leaves me in the unenviable position of having to write my own (urgh). Have tried disabling HotSpot.. same problem. Anyone have any ideas? Thanks. |