Java崩溃!使用jni和jpeg62.dll时的NTDLL.DLL

时间:2013-09-09 07:59:38

标签: java java-native-interface jvm-crash phash

尝试使用jni在java上运行pHash,我遇到了很多问题并解决了它们,现在我被困在这个地方。我修复了所有的dll和我的源代码,一切都很好但是当我尝试使用dll运行我的java代码时... JAVA崩溃时使用jpeg62.dll因为我试图使用DCT图像哈希来分析jpg图像.. < / p>

我需要知道ntdll.dll + 0x1b1fa有什么以及为什么会崩溃。从这份报告我不太了解因为我还是编程的初学者。如果有任何专家可以请我帮助或指导我,或者只是告诉我在哪里寻找非常感激的错误。

p.s:我使用jpeg62.dll,zlib.h,libpng.dll作为我的pHash.dll的依赖项,它们已经存在,所以我没有对它们做任何事情。


这是我的日志:

A fatal error has been detected by the Java Runtime Environment:

  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c92b1fa, pid=2764, tid=4492

 JRE version: 6.0_16-b01
 Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing windows-x86 )
 Problematic frame:
 C  [ntdll.dll+0x1b1fa]

 If you would like to submit a bug report, please visit:
   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 (0x003a6800):  JavaThread "main" [_thread_in_native, id=4492, stack(0x008c0000,0x00910000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x00000010

Registers:
EAX=0x00000000, EBX=0x00000000, ECX=0x00000e78, EDX=0x10311478
ESP=0x008eaf70, EBP=0x008eafe4, ESI=0x10311468, EDI=0x00000000
EIP=0x7c92b1fa, EFLAGS=0x00010246

Top of Stack: (sp=0x008eaf70)
0x008eaf70:   02dd40d8 008f744c 02dd40d8 008eb020
0x008eaf80:   77c04045 00000000 00000001 02dd0178
0x008eaf90:   00000007 0000031d 00000007 0050004a
0x008eafa0:   00470045 0045004d 77c0004d 00440050
0x008eafb0:   02dd0178 00450052 000000e0 00000007
0x008eafc0:   02dd2c2c 02dd3121 008eaf9c 00000007
0x008eafd0:   00000000 02dd4708 00000003 00000000
0x008eafe0:   00000e78 008eaff8 7c911046 00311468 

Instructions: (pc=0x7c92b1fa)
0x7c92b1ea:   8b 46 10 3b c3 89 45 fc 0f 84 9e 00 00 00 8b 06
0x7c92b1fa:   ff 40 10 8b 45 fc 83 e0 01 89 45 e8 8b 06 ff 40 


Stack: [0x008c0000,0x00910000],  sp=0x008eaf70,  free space=171k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x1b1fa]
C  [ntdll.dll+0x1046]
C  [msvcrt.dll+0x3120f]
C  [jpeg62.dll+0xcb94]
C  [PhashTest.dll+0x5be21]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.phash.pHash.dctImageHash(Ljava/lang/String;)Lorg/phash/DCTImageHash;+0
j  org.phash.pHash.main([Ljava/lang/String;)V+2
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x02aa5c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5332, stack(0x02d20000,0x02d70000)]
  0x02aa2c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2800, stack(0x02cd0000,0x02d20000)]
  0x02aa1400 JavaThread "Attach Listener" daemon [_thread_blocked, id=4328, stack(0x02c80000,0x02cd0000)]
  0x02aa0000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3988, stack(0x02c30000,0x02c80000)]
  0x02a61400 JavaThread "Finalizer" daemon [_thread_blocked, id=1016, stack(0x02be0000,0x02c30000)]
  0x02a5cc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=5088, stack(0x02b90000,0x02be0000)]
=>0x003a6800 JavaThread "main" [_thread_in_native, id=4492, stack(0x008c0000,0x00910000)]

Other Threads:
  0x02a5b000 VMThread [stack: 0x02b40000,0x02b90000] [id=3700]
  0x02aa7400 WatcherThread [stack: 0x02d70000,0x02dc0000] [id=4864]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 960K, used 219K [0x22990000, 0x22a90000, 0x22e70000)
  eden space 896K,  24% used [0x22990000, 0x229c6c50, 0x22a70000)
  from space 64K,   0% used [0x22a70000, 0x22a70000, 0x22a80000)
  to   space 64K,   0% used [0x22a80000, 0x22a80000, 0x22a90000)
 tenured generation   total 4096K, used 0K [0x22e70000, 0x23270000, 0x26990000)
   the space 4096K,   0% used [0x22e70000, 0x22e70000, 0x22e70200, 0x23270000)
 compacting perm gen  total 12288K, used 26K [0x26990000, 0x27590000, 0x2a990000)
   the space 12288K,   0% used [0x26990000, 0x26996830, 0x26996a00, 0x27590000)
    ro space 8192K,  67% used [0x2a990000, 0x2aef9040, 0x2aef9200, 0x2b190000)
    rw space 12288K,  54% used [0x2b190000, 0x2b80d348, 0x2b80d400, 0x2bd90000)

Dynamic libraries:
0x00400000 - 0x00424000     C:\Programme\Java\jdk1.6.0_16\bin\javaw.exe
0x7c910000 - 0x7c9c6000     C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c908000     C:\WINDOWS\system32\kernel32.dll
0x77da0000 - 0x77e4a000     C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000 - 0x77ee2000     C:\WINDOWS\system32\RPCRT4.dll
0x77fc0000 - 0x77fd1000     C:\WINDOWS\system32\Secur32.dll
0x7e360000 - 0x7e3f1000     C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f39000     C:\WINDOWS\system32\GDI32.dll
0x76330000 - 0x7634d000     C:\WINDOWS\system32\IMM32.DLL
0x7c340000 - 0x7c396000     C:\Programme\Java\jdk1.6.0_16\jre\bin\msvcr71.dll
0x6d8b0000 - 0x6db3b000     C:\Programme\Java\jdk1.6.0_16\jre\bin\client\jvm.dll
0x76af0000 - 0x76b1e000     C:\WINDOWS\system32\WINMM.dll
0x6d860000 - 0x6d86c000     C:\Programme\Java\jdk1.6.0_16\jre\bin\verify.dll
0x6d3e0000 - 0x6d3ff000     C:\Programme\Java\jdk1.6.0_16\jre\bin\java.dll
0x6d340000 - 0x6d348000     C:\Programme\Java\jdk1.6.0_16\jre\bin\hpi.dll
0x76bb0000 - 0x76bbb000     C:\WINDOWS\system32\PSAPI.DLL
0x6d8a0000 - 0x6d8af000     C:\Programme\Java\jdk1.6.0_16\jre\bin\zip.dll
0x10000000 - 0x100ca000     C:\MyProjects\Phash\PhashTest.dll
0x6cc40000 - 0x6cc84000     C:\MyProjects\Phash\libpng12.dll
0x62e80000 - 0x62e9f000     C:\MyProjects\Phash\zlib1.dll
0x77be0000 - 0x77c38000     C:\WINDOWS\system32\msvcrt.dll
0x686c0000 - 0x686e4000     C:\MyProjects\Phash\jpeg62.dll
0x7e670000 - 0x7ee91000     C:\WINDOWS\system32\SHELL32.dll
0x77f40000 - 0x77fb6000     C:\WINDOWS\system32\SHLWAPI.dll
0x10200000 - 0x10323000     C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\MSVCR90D.dll
0x773a0000 - 0x774a3000     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll

VM Arguments:
jvm_args: -Dfile.encoding=Cp1252 
java_command: org.phash.pHash
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:/Programme/Java/jdk1.6.0_16/bin/../jre/bin/client;C:/Programme/Java/jdk1.6.0_16/bin/../jre/bin;C:\oracle\product\10.1.0\Client_2\bin;C:\oracle\product\10.1.0\Client_2\jre\1.4.2\bin\client;C:\oracle\product\10.1.0\Client_2\jre\1.4.2\bin;C:\programme\oracle\product\10.1.0\Client_1\bin;C:\programme\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\programme\oracle\product\10.1.0\Client_1\jre\1.4.2\bin;c:\oracle\product\11.1.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\TortoiseSVN\bin;C:\Programme\V3PA3\v3iaxa1\bin\Jetform;C:\Programme\SER\OCRPDFTool
USERNAME=scan
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, 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 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3

Memory: 4k page, physical 2097151k(1422692k free), swap 4194303k(3192776k free)

vm_info: Java HotSpot(TM) Client VM (14.2-b01) for windows-x86 JRE (1.6.0_16-b01), built on Jul 31 2009 11:26:58 by "java_re" with MS VC++ 7.1

time: Mon Sep 09 09:46:53 2013
elapsed time: 0 seconds

1 个答案:

答案 0 :(得分:0)

(移动答案无可置疑)

所有DLLS都应该在java jni项目的目录中,以及从构建文件生成的.ilk .exp .pdb文件!它们非常重要..没有它们你支持你的主dll的依赖将不起作用!我真的希望这对使用jni的任何人都有帮助。另请注意:如果java与ntdll.dll崩溃,那么你会遗漏一些东西