求助,JNI调用出错问题~~~~~~~~~~~~~~~~~~~~~~~~~~!

yuffonconnie 2012-12-16 04:50:55
我在windows 7 64位上需要用java调用一个实现好的dll库,所以先写好native方法,然后用vs2008写了个JNI的调用接口的dll,用这个dll去调用别人的库dll。一切运行良好。
可是我把这一套东西放在IBM x3650 M3 Xeon服务器windows server 2008 R2 上后就出错了。
我在服务器上用C++调用库dll也能调用。但是用java就不行。
我在服务器上用VS2008重新生成那个JNI接口的dll,还是报告下边的错误,哪位有过经验?
报告的错误如下:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (os_windows_x86.cpp:149), pid=4384, tid=2460
# guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result from topLevelExceptionFilter
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode windows-amd64 compressed oops)
# 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 (0x00000000004ed800): JavaThread "main" [_thread_in_native, id=2460, stack(0x0000000002200000,0x0000000002300000)]

Stack: [0x0000000002200000,0x0000000002300000]
[error occurred during error reporting (printing stack bounds), id 0xe0000000]


[error occurred during error reporting (printing native stack), id 0xe0000000]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j yices.YicesLite.yicesl_set_output_file(Ljava/lang/String;)V+0
j yices.YuffonTestYices.method3()V+63
j yices.YuffonTestYices.main([Ljava/lang/String;)V+0
v ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
0x000000000ce7d000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3856, stack(0x000000000d420000,0x000000000d520000)]
0x000000000ce7a000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=2100, stack(0x000000000d320000,0x000000000d420000)]
0x000000000ce2c000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=4900, stack(0x000000000d220000,0x000000000d320000)]
0x000000000ce2b000 JavaThread "Attach Listener" daemon [_thread_blocked, id=2900, stack(0x000000000d120000,0x000000000d220000)]
0x000000000ce2a800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3644, stack(0x000000000d020000,0x000000000d120000)]
0x00000000023f6800 JavaThread "Finalizer" daemon [_thread_blocked, id=3724, stack(0x000000000cd20000,0x000000000ce20000)]
0x00000000023f0800 JavaThread "Reference Handler" daemon [_thread_blocked, id=3012, stack(0x000000000cc20000,0x000000000cd20000)]
=>0x00000000004ed800 JavaThread "main" [_thread_in_native, id=2460, stack(0x0000000002200000,0x0000000002300000)]

Other Threads:
0x00000000023e7000 VMThread [stack: 0x000000000cb20000,0x000000000cc20000] [id=3176]
0x000000000ce8f000 WatcherThread [stack: 0x000000000d520000,0x000000000d620000] [id=2828]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
PSYoungGen total 458752K, used 7865K [0x00000006000b0000, 0x00000006200a0000, 0x0000000800000000)
eden space 393280K, 2% used [0x00000006000b0000,0x000000060085e670,0x00000006180c0000)
from space 65472K, 0% used [0x000000061c0b0000,0x000000061c0b0000,0x00000006200a0000)
to space 65472K, 0% used [0x00000006180c0000,0x00000006180c0000,0x000000061c0b0000)
PSOldGen total 1048512K, used 0K [0x0000000200200000, 0x00000002401f0000, 0x00000006000b0000)
object space 1048512K, 0% used [0x0000000200200000,0x0000000200200000,0x00000002401f0000)
PSPermGen total 21248K, used 3069K [0x00000001fb000000, 0x00000001fc4c0000, 0x0000000200200000)
object space 21248K, 14% used [0x00000001fb000000,0x00000001fb2ff4a8,0x00000001fc4c0000)

Code Cache [0x0000000002400000, 0x0000000002670000, 0x0000000005400000)
total_blobs=175 nmethods=1 adapters=128 free_code_cache=49943744 largest_free_block=6080

Dynamic libraries:
0x0000000000400000 - 0x000000000042e000 D:\Java\jre6\bin\javaw.exe
0x0000000077a90000 - 0x0000000077c39000 C:\Windows\SYSTEM32\ntdll.dll
0x0000000077970000 - 0x0000000077a8f000 C:\Windows\system32\kernel32.dll
0x000007fefda90000 - 0x000007fefdafb000 C:\Windows\system32\KERNELBASE.dll
0x000007fefddc0000 - 0x000007fefde9b000 C:\Windows\system32\ADVAPI32.dll
0x000007feff8f0000 - 0x000007feff98f000 C:\Windows\system32\msvcrt.dll
0x000007fefe3f0000 - 0x000007fefe40f000 C:\Windows\SYSTEM32\sechost.dll
0x000007feffae0000 - 0x000007feffc0d000 C:\Windows\system32\RPCRT4.dll
0x0000000077870000 - 0x000000007796a000 C:\Windows\system32\USER32.dll
0x000007feffd30000 - 0x000007feffd97000 C:\Windows\system32\GDI32.dll
0x000007feffd20000 - 0x000007feffd2e000 C:\Windows\system32\LPK.dll
0x000007feff990000 - 0x000007feffa59000 C:\Windows\system32\USP10.dll
0x000007feffa60000 - 0x000007feffa8e000 C:\Windows\system32\IMM32.DLL
0x000007feffc10000 - 0x000007feffd19000 C:\Windows\system32\MSCTF.dll
0x000000006d7f0000 - 0x000000006dfa8000 D:\Java\jre6\bin\server\jvm.dll
0x000007fef8e20000 - 0x000007fef8e5b000 C:\Windows\system32\WINMM.dll
0x000000006d760000 - 0x000000006d76e000 D:\Java\jre6\bin\verify.dll
0x000000006d3b0000 - 0x000000006d3d7000 D:\Java\jre6\bin\java.dll
0x0000000077c60000 - 0x0000000077c67000 C:\Windows\system32\PSAPI.DLL
0x000000006d7b0000 - 0x000000006d7c2000 D:\Java\jre6\bin\zip.dll
0x000007fefb250000 - 0x000007fefb257000 D:\eclipseworkspace7\jpf-symbc\lib\YicessDLL.dll
0x0000000066e40000 - 0x0000000067247000 D:\eclipseworkspace7\jpf-symbc\lib\libyices.dll
0x000000006c0f0000 - 0x000000006c18d000 C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c\MSVCR90.dll

VM Arguments:
jvm_args: -Dfile.encoding=GBK
java_command: yices.YuffonTestYices
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=D:\Java\jdk1.6.0_25
CLASSPATH=.;D:\Java\jdk1.6.0_25\lib\dt.jar;D:\Java\jdk1.6.0_25\lib\tools.jar
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\ant1.7\bin;D:\Java\jdk1.6.0_25\bin;D:\eclipseworkspace7\jpf-symbc\lib;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\
USERNAME=Administrator
LD_LIBRARY_PATH=D:\eclipseworkspace7\jpf-symbc\lib
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel



--------------- S Y S T E M ---------------

OS: Windows NT 6.1 Build 7601 Service Pack 1

CPU:total 24 (6 cores per cpu, 2 threads per core) family 6 model 44 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht

Memory: 4k page, physical 100651552k(94753372k free), swap 110889708k(103315732k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.0-b11) for windows-amd64 JRE (1.6.0_25-b06), built on Apr 14 2011 00:44:38 by "java_re" with MS VC++ 8.0 (VS2005)

time: Sun Dec 16 15:38:48 2012
elapsed time: 0 seconds
...全文
306 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuffonconnie 2012-12-17
  • 打赏
  • 举报
回复
哪位大神知道怎么回事啊
为啥呢 2012-12-17
  • 打赏
  • 举报
回复
内存读写错误吧,记得我以前用Jna调用C的dll时传入的地址引用类型搞错了出过这个问题,建议用jna,jna封装的jni比较好用,用jna的ByReference的子类型对应C的地址引用类型就没问题了,这样jvm的那个变量的内存地址就会被锁定,C才可以获取,否则就会出错。

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧