This discussion is archived
4 Replies Latest reply: May 27, 2011 12:24 PM by jschellSomeoneStoleMyAlias RSS

The crash happened outside the java virtual machine in native code

864225 Newbie
Currently Being Moderated
Hi,
I have a biometric device with which I am given some C++ dlls. I am trying to call methods inside these using java (jna). I am loading the dll "zkemsdk.dll+" as follows:

zkemkeeper INSTANCE1 = (zkemkeeper)Native.loadLibrary("zkemsdk", zkemkeeper.class);//zkemsdk is the dll, I am loading the dll here.

Then, I am calling the function:

zkemkeeper.INSTANCE1.Z_Connect_NETEX("ip address",4370);//Z_Connect_NETEX is a function inside zkemsdk.dll

This returns me true or false based on whether am connected to the biometric device or not.Thus I am able to invoke this method without issues. But for other methods inside the dll, run time exception is thrown in console:

Can someone help me resolve this issue. ??? Following is the content of the log file generated.

#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0351fe3b, pid=1664, tid=3832
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [zkemsdk.dll+0xfe3b]
#
# If you would like to submit a bug report, please visit:
# http://www.java.net/external?url=http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x003a9000): JavaThread "main" [_thread_in_native, id=3832, stack(0x008c0000,0x00910000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000106
Registers:
EAX=0x0090f7c4, EBX=0x00000001, ECX=0x00000000, EDX=0x00000001
ESP=0x0090f7b4, EBP=0x0090f848, ESI=0x00000096, EDI=0x003a9000
EIP=0x0351fe3b, EFLAGS=0x00010216
Top of Stack: (sp=0x0090f7b4)
0x0090f7b4: 00000000 0090f930 000003fc 00000103
0x0090f7c4: 0090f800 6d9532d0 373e92a0 00912ec5
0x0090f7d4: 00000401 0090f7d8 369860d1 0090f800
0x0090f7e4: 37390050 00000000 37390f90 00000000
0x0090f7f4: 0090f800 0090f930 003a9000 0090f830
0x0090f804: 10008fd8 0090f840 0090f930 00000008
0x0090f814: 0090f88c 0090fa28 0090f8f4 0090f848
0x0090f824: eb53f637 0351ffdc 00000096 00000003
Instructions: (pc=0x0351fe3b)
0x0351fe2b: 0f 53 50 8d 44 24 18 50 e8 58 7c 00 00 83 c4 0c
0x0351fe3b: 8b 4e 70 51 8b 0e 83 c3 04 53 6a 64 8d 54 24 18

Stack: [0x008c0000,0x00910000], sp=0x0090f7b4, free space=13d0090f2e8k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [zkemsdk.dll+0xfe3b]
C [jna5972695927945545932.tmp+0x9182]
C [jna5972695927945545932.tmp+0x2161]
C [jna5972695927945545932.tmp+0x2849]
j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+90
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j $Proxy0.Z_Beep(J)Z+19
j com.rfarrays.bhabs.fingerPrint.main([Ljava/lang/String;)V+84
v ~StubRoutines::call_stub
V [jvm.dll+0xf049c]
V [jvm.dll+0x17fcf1]
V [jvm.dll+0xf051d]
V [jvm.dll+0xf9bc5]
V [jvm.dll+0x10181d]
C [javaw.exe+0x2155]
C [javaw.exe+0x8614]
C [kernel32.dll+0xb729]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+90
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j $Proxy0.Z_Beep(J)Z+19
j com.rfarrays.bhabs.fingerPrint.main([Ljava/lang/String;)V+84
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x02b10c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1976, stack(0x02dc0000,0x02e10000)]
0x02b0a400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=1280, stack(0x02d70000,0x02dc0000)]
0x02b08c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=1984, stack(0x02d20000,0x02d70000)]
0x02b07800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2160, stack(0x02cd0000,0x02d20000)]
0x02b02400 JavaThread "Finalizer" daemon [_thread_blocked, id=2052, stack(0x02c80000,0x02cd0000)]
0x02afd800 JavaThread "Reference Handler" daemon [_thread_blocked, id=752, stack(0x02c30000,0x02c80000)]
=>0x003a9000 JavaThread "main" [_thread_in_native, id=3832, stack(0x008c0000,0x00910000)]
Other Threads:
0x02afc400 VMThread [stack: 0x02be0000,0x02c30000] [id=1504]
0x02b1b800 WatcherThread [stack: 0x02e10000,0x02e60000] [id=1980]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 4928K, used 2455K [0x22970000, 0x22ec0000, 0x27ec0000)
eden space 4416K, 55% used [0x22970000, 0x22bd5db0, 0x22dc0000)
from space 512K, 0% used [0x22dc0000, 0x22dc0000, 0x22e40000)
to space 512K, 0% used [0x22e40000, 0x22e40000, 0x22ec0000)
tenured generation total 10944K, used 0K [0x27ec0000, 0x28970000, 0x32970000)
the space 10944K, 0% used [0x27ec0000, 0x27ec0000, 0x27ec0200, 0x28970000)
compacting perm gen total 12288K, used 343K [0x32970000, 0x33570000, 0x36970000)
the space 12288K, 2% used [0x32970000, 0x329c5f20, 0x329c6000, 0x33570000)
ro space 10240K, 51% used [0x36970000, 0x36e9ae00, 0x36e9ae00, 0x37370000)
rw space 12288K, 54% used [0x37370000, 0x37a072d8, 0x37a07400, 0x37f70000)
Dynamic libraries:
0x00400000 - 0x00424000 C:\Program Files\Java\jre6\bin\javaw.exe
0x7c900000 - 0x7c9b2000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f03000 C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
0x7e410000 - 0x7e4a1000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000 C:\WINDOWS\system32\GDI32.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x7c340000 - 0x7c396000 C:\Program Files\Java\jre6\bin\msvcr71.dll
0x6d800000 - 0x6da97000 C:\Program Files\Java\jre6\bin\client\jvm.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x6d7b0000 - 0x6d7bc000 C:\Program Files\Java\jre6\bin\verify.dll
0x6d330000 - 0x6d34f000 C:\Program Files\Java\jre6\bin\java.dll
0x6d290000 - 0x6d298000 C:\Program Files\Java\jre6\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d7f0000 - 0x6d7ff000 C:\Program Files\Java\jre6\bin\zip.dll
0x68000000 - 0x68036000 C:\WINDOWS\system32\rsaenh.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll
0x769c0000 - 0x76a74000 C:\WINDOWS\system32\USERENV.dll
0x5b860000 - 0x5b8b5000 C:\WINDOWS\system32\netapi32.dll
0x6d610000 - 0x6d623000 C:\Program Files\Java\jre6\bin\net.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\System32\mswsock.dll
0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
0x76d60000 - 0x76d79000 C:\WINDOWS\system32\iphlpapi.dll
0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll
0x10000000 - 0x10052000 C:\Documents and Settings\bkonwar\Local Settings\Temp\jna5972695927945545932.tmp
0x03510000 - 0x03546000 C:\WINDOWS\system32\zkemsdk.dll
0x03560000 - 0x03574000 C:\WINDOWS\system32\commpro.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
VM Arguments:
jvm_args: -Dfile.encoding=Cp1252
java_command: com.xyz.bhabs.fingerPrint
Launcher Type: SUN_STANDARD
Environment Variables:
PATH=C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;;C:\Program Files\Java\jre1.6.0_07\bin;C:\Program Files\Android\android-sdk-windows\tools;C:\Program Files\TortoiseSVN\bin
USERNAME=BKonwar
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel

--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 3
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
Memory: 4k page, physical 2085780k(1286036k free), swap 4024188k(3249652k free)
vm_info: Java HotSpot(TM) Client VM (16.3-b01) for windows-x86 JRE (1.6.0_20-b02), built on Apr 12 2010 13:52:23 by "java_re" with MS VC++ 7.1 (VS2003)
time: Wed May 25 10:02:24 2011
elapsed time: 21 seconds

Regards,
Bhabs

Edited by: 861222 on May 25, 2011 12:19 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points