问题描述
- 用JNative方法调用dll
-
运行环境是JDK1.4
报异常信息:An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x4769AA6
Function=[Unknown.]
Library=C:WindowsSystem32BoostYccb.dllNOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.Current Java thread:
at org.xvolks.jnative.JNative.nInvoke(Native Method)
at org.xvolks.jnative.JNative.invoke(JNative.java:807)
at onlyfun.dllcall.UserCall.main(UserCall.java:101)Dynamic libraries:
0x00400000 - 0x00407000 D:JDK1.4binjavaw.exe
0x77A50000 - 0x77BD0000 C:WindowsSysWOW64ntdll.dll
0x75700000 - 0x75810000 C:Windowssyswow64kernel32.dll
0x76E40000 - 0x76E87000 C:Windowssyswow64KERNELBASE.dll
0x75220000 - 0x752C0000 C:Windowssyswow64ADVAPI32.dll
0x752C0000 - 0x7536C000 C:Windowssyswow64msvcrt.dll
0x770B0000 - 0x770C9000 C:WindowsSysWOW64sechost.dll
0x76CB0000 - 0x76DA0000 C:Windowssyswow64RPCRT4.dll
0x75110000 - 0x75170000 C:Windowssyswow64SspiCli.dll
0x75100000 - 0x7510C000 C:Windowssyswow64CRYPTBASE.dll
0x76E90000 - 0x76F90000 C:Windowssyswow64USER32.dll
0x76C10000 - 0x76CA0000 C:Windowssyswow64GDI32.dll
0x75EC0000 - 0x75ECA000 C:Windowssyswow64LPK.dll
0x770D0000 - 0x7716D000 C:Windowssyswow64USP10.dll
0x76DA0000 - 0x76E00000 C:Windowssystem32IMM32.DLL
0x75CF0000 - 0x75DBC000 C:Windowssyswow64MSCTF.dll
0x08000000 - 0x08136000 D:JDK1.4jrebinclientjvm.dll
0x74E00000 - 0x74E32000 C:Windowssystem32WINMM.dll
0x724F0000 - 0x7253C000 C:Windowssystem32apphelp.dll
0x10000000 - 0x10007000 D:JDK1.4jrebinhpi.dll
0x00340000 - 0x0034E000 D:JDK1.4jrebinverify.dll
0x00350000 - 0x00368000 D:JDK1.4jrebinjava.dll
0x00370000 - 0x0037D000 D:JDK1.4jrebinzip.dll
0x04730000 - 0x047D3000 C:WindowsSystem32BoostYccb.dll
0x75370000 - 0x753FF000 C:Windowssyswow64oleaut32.dll
0x75400000 - 0x7555C000 C:Windowssyswow64ole32.dll
0x047E0000 - 0x047EB000 C:Windowssystem32borlndmm.dll
0x75000000 - 0x75007000 C:Windowssystem32wsock32.dll
0x76E00000 - 0x76E35000 C:Windowssyswow64WS2_32.dll
0x77A20000 - 0x77A26000 C:Windowssyswow64NSI.dll
0x74F20000 - 0x74FA4000 C:WindowsWinSxSx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5comctl32.dll
0x04BB0000 - 0x04C7D000 C:WindowsSystem32JNativeCpp.dll
0x6E700000 - 0x6E780000 C:Windowssystem32uxtheme.dll
0x75AA0000 - 0x75ACB000 C:Windowssyswow64imagehlp.dll
0x743E0000 - 0x744CB000 C:Windowssyswow64dbghelp.dll
0x76CA0000 - 0x76CA5000 C:Windowssyswow64PSAPI.DLLHeap at VM Abort:
Heap
def new generation total 576K, used 183K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 23% used [0x10010000, 0x1002dc60, 0x10090000)
from space 64K, 99% used [0x100a0000, 0x100afff8, 0x100b0000)
to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
tenured generation total 1408K, used 45K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 3% used [0x104f0000, 0x104fb518, 0x104fb600, 0x10650000)
compacting perm gen total 4096K, used 1532K [0x14010000, 0x14410000, 0x18010000)
the space 4096K, 37% used [0x14010000, 0x1418f150, 0x1418f200, 0x14410000)Local Time = Fri Nov 14 16:11:22 2014
Elapsed Time = 0
#The exception above was detected in native code outside the VM
#
Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
#
An error report file has been saved as hs_err_pid13592.log.
Please refer to the file for further information.
#
求大师指导。
解决方案
这里的错误在你的dll里,返回的非法内存访问,可能性很多,比如访问了未初始化的变量,越界访问。最好贴上你的native code来看看