This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
I have a Java application that calls APIs in a 3rd party DLL(I don't have access to its source code or logs) through my VC++ DLL(Win32) that acts as the wrapper DLL.
The Application has many functionalities and is based on multithreading (both on Java layer as well as C++ layer). Most of the functionalities are working , but when I try to close the application, it crashes.
Moreover the crashing occurs inconstently, sometimes it does not crash. Instead of showing any debug information , it simply creates a error file with disassembly code that I am not able to understand.
Though the error seems like an java error, but actually it seems to be due to native code. I have try catch blocks in my code and also implemented _set_translator functionality to get hold of structured/C exceptions. But still I am not able to catch any exceptions.
I am pasting the the contents of the file here:
# # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9111de, pid=488, tid=1848 # # Java VM: Java HotSpot(TM) Client VM (1.4.2_14-b05 mixed mode) # Problematic frame: # C [ntdll.dll+0x111de] #
--------------- T H R E A D ---------------
Current thread (0x009d1790): JavaThread "CompilerThread0" daemon [_thread_in_native, id=1848]
Stack: [0x02bf0000,0x02c30000), sp=0x02c2f8e8, free space=254k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x111de] C [MSVCRT.dll+0x1c3c9] C [MSVCRT.dll+0x1c3e7] C [MSVCRT.dll+0x1c42e] V [jvm.dll+0xacda9] V [jvm.dll+0x17102] V [jvm.dll+0x16c8d] V [jvm.dll+0x16dca] V [jvm.dll+0x170a7] V [jvm.dll+0x172e8] V [jvm.dll+0x4dc65] V [jvm.dll+0x4d894] V [jvm.dll+0xd3a36] V [jvm.dll+0xd3a04] C [MSVCRT.dll+0x2a3b0] C [kernel32.dll+0xb683]
Current CompileTask: HotSpot Client Compiler:423 b sun.awt.AWTAutoShutdown.isReadyToShutdown()Z (33 bytes)
Other Threads: 0x00a0b6e8 VMThread [id=608] 0x00a0d620 WatcherThread [id=3012]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap def new generation total 640K, used 583K [0x10010000, 0x100c0000, 0x104f0000) eden space 576K, 90% used [0x10010000, 0x10091e40, 0x100a0000) from space 64K, 99% used [0x100b0000, 0x100bfff8, 0x100c0000) to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000) tenured generation total 7772K, used 5451K [0x104f0000, 0x10c87000, 0x14010000) the space 7772K, 70% used [0x104f0000, 0x10a42d80, 0x10a42e00, 0x10c87000) compacting perm gen total 8192K, used 8137K [0x14010000, 0x14810000, 0x18010000) the space 8192K, 99% used [0x14010000, 0x148024e8, 0x14802600, 0x14810000)
vm_info: Java HotSpot(TM) Client VM (1.4.2_14-b05) for windows-x86, built on Mar 14 2007 16:46:11 by "java_re" with MS VC++ 6.0
The JAVA Application during initialisation establishes a connection with the host server for various devices. For each of the device it establishes a separate connection and keeps listening on these connections using multithreading.
During App close, we need to close each of these connections one by one for each device.
The opening /closing of connection is done by 3rd party DLL and call to there APIs is done through a C++ Wrapper DLL that I have built between the Java layer and their DLL.
When we close the Application, I am always able to close the connections on the first 2 devices. Then all of a sudden it crashes either for the 3rd device conn. close or for the 4th one. The code is the same for all the devices . That too sometimes it just goes fine without crashing. If its a null pointer exception, why is it that it crashes on some occassions and not in other times. More importantly, why is it that it does not fail for the first 2 devices , but fails for the 3rd or 4th device connection close?
Can please anyone help me. Please suggest me as to how I can determine the cause of the error. Thanks in advance.