java调用dll,tomcat运行一段时间后死掉,我快崩溃了,救我

Romanceling 发布于 2017/11/21 20:13
阅读 2K+
收藏 0

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x778629ac, pid=14968, tid=19548
#
# JRE version: 6.0_39-b04
# Java VM: Java HotSpot(TM) Client VM (20.14-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [ntdll.dll+0x529ac]
#
# 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 (0x044b8000):  JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_in_native, id=19548, stack(0x04980000,0x049d0000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x0173003a

Registers:
EAX=0x0173003a, EBX=0xfb230001, ECX=0x00000086, EDX=0x00000000
ESP=0x049cf62c, EBP=0x049cf660, ESI=0x04322472, EDI=0xfb230000
EIP=0x778629ac, EFLAGS=0x00010202

Top of Stack: (sp=0x049cf62c)
0x049cf62c:   00000000 00ed0000 043bd920 043ee9e0
0x049cf63c:   01010a88 003f0000 00000003 049cf6c4
0x049cf64c:   7782e195 02043bcb 00040000 00000001
0x049cf65c:   043bd918 049cf678 77862900 043bd920
0x049cf66c:   7c342151 00000008 043bd918 049cf68c
0x049cf67c:   779cc5f4 00ed0000 00000000 043bd920
0x049cf68c:   049cf6d4 7c34218a 00ed0000 00000000
0x049cf69c:   043bd920 7c342151 04521610 00000008 

Instructions: (pc=0x778629ac)
0x7786298c:   08 2b 7d f4 33 c0 c1 ef 03 0f a4 f8 10 c1 e7 10
0x7786299c:   c1 ea 10 0b df 0b c8 8b 06 c7 45 f8 01 00 00 00
0x778629ac:   89 30 8b 45 e0 8b 55 e4 8d 7e 08 f0 0f c7 0f 3b
0x778629bc:   45 e0 0f 85 7a 9e fc ff 3b 55 e4 0f 85 71 9e fc 


Register to memory mapping:

EAX=0x0173003a is an unknown value
EBX=0xfb230001 is an unknown value
ECX=0x00000086 is an unknown value
EDX=0x00000000 is an unknown value
ESP=0x049cf62c is pointing into the stack for thread: 0x044b8000
EBP=0x049cf660 is pointing into the stack for thread: 0x044b8000
ESI=0x04322472 is an unknown value
EDI=0xfb230000 is an unknown value


Stack: [0x04980000,0x049d0000],  sp=0x049cf62c,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x529ac]  RtlFreeHeap+0x12a
C  [ntdll.dll+0x52900]  RtlFreeHeap+0x7e
C  [kernel32.dll+0x4c5f4]  HeapFree+0x14
C  [msvcr71.dll+0x218a]  free+0x39

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.util.zip.ZipFile.close(J)V+0
J  java.util.zip.ZipFile.close()V
J  org.apache.catalina.loader.WebappClassLoaderBase.closeJARs(Z)V
J  org.apache.catalina.loader.WebappLoader.backgroundProcess()V
J  org.apache.catalina.core.ContainerBase.backgroundProcess()V
J  org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Lorg/apache/catalina/Container;Ljava/lang/ClassLoader;)V
J  org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Lorg/apache/catalina/Container;Ljava/lang/ClassLoader;)V
J  org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Lorg/apache/catalina/Container;Ljava/lang/ClassLoader;)V
j  org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run()V+108
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0410c400 JavaThread "http-bio-9088-exec-10" daemon [_thread_blocked, id=21164, stack(0x05eb0000,0x05f00000)]
  0x0410bc00 JavaThread "http-bio-9088-exec-9" daemon [_thread_blocked, id=21392, stack(0x05dc0000,0x05e10000)]
  0x0410b400 JavaThread "http-bio-9088-exec-8" daemon [_thread_blocked, id=20868, stack(0x05d70000,0x05dc0000)]
  0x0410b000 JavaThread "http-bio-9088-exec-7" daemon [_thread_blocked, id=21080, stack(0x05d20000,0x05d70000)]
  0x0410a800 JavaThread "http-bio-9088-exec-6" daemon [_thread_blocked, id=21220, stack(0x05cd0000,0x05d20000)]
  0x04586c00 JavaThread "http-bio-9088-exec-5" daemon [_thread_blocked, id=21796, stack(0x05c80000,0x05cd0000)]
  0x04586800 JavaThread "http-bio-9088-exec-4" daemon [_thread_blocked, id=21060, stack(0x05c30000,0x05c80000)]
  0x04586000 JavaThread "http-bio-9088-exec-3" daemon [_thread_in_native, id=21064, stack(0x05b00000,0x05b50000)]
  0x01b93400 JavaThread "http-bio-9088-exec-2" daemon [_thread_blocked, id=19300, stack(0x05790000,0x057e0000)]
  0x043bcc00 JavaThread "http-bio-9088-exec-1" daemon [_thread_blocked, id=15556, stack(0x04750000,0x047a0000)]
  0x044b9000 JavaThread "ajp-bio-8086-AsyncTimeout" daemon [_thread_blocked, id=18444, stack(0x04c00000,0x04c50000)]
  0x0451e000 JavaThread "ajp-bio-8086-Acceptor-0" daemon [_thread_in_native, id=19432, stack(0x04b70000,0x04bc0000)]
  0x043b1000 JavaThread "http-bio-9088-AsyncTimeout" daemon [_thread_blocked, id=20072, stack(0x04ab0000,0x04b00000)]
  0x044b8800 JavaThread "http-bio-9088-Acceptor-0" daemon [_thread_in_native, id=19580, stack(0x04a60000,0x04ab0000)]
=>0x044b8000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_in_native, id=19548, stack(0x04980000,0x049d0000)]
  0x04326800 JavaThread "GC Daemon" daemon [_thread_blocked, id=19960, stack(0x046b0000,0x04700000)]
  0x01b7b000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=19600, stack(0x04010000,0x04060000)]
  0x01b72800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=18876, stack(0x03fc0000,0x04010000)]
  0x01b71800 JavaThread "Attach Listener" daemon [_thread_blocked, id=19488, stack(0x03f70000,0x03fc0000)]
  0x01b6e800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20404, stack(0x03f20000,0x03f70000)]
  0x01b60000 JavaThread "Finalizer" daemon [_thread_blocked, id=19508, stack(0x03ed0000,0x03f20000)]
  0x01b5b400 JavaThread "Reference Handler" daemon [_thread_blocked, id=19544, stack(0x03e80000,0x03ed0000)]
  0x00ed9c00 JavaThread "main" [_thread_in_native, id=19092, stack(0x001c0000,0x00210000)]

Other Threads:
  0x01b1f000 VMThread [stack: 0x00e50000,0x00ea0000] [id=20388]
  0x01b95000 WatcherThread [stack: 0x04060000,0x040b0000] [id=19844]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 10240K, used 274K [0x084c0000, 0x08fd0000, 0x0da10000)
  eden space 9152K,   3% used [0x084c0000, 0x08504b88, 0x08db0000)
  from space 1088K,   0% used [0x08db0000, 0x08db0000, 0x08ec0000)
  to   space 1088K,   0% used [0x08ec0000, 0x08ec0000, 0x08fd0000)
 tenured generation   total 22584K, used 12833K [0x0da10000, 0x0f01e000, 0x184c0000)
   the space 22584K,  56% used [0x0da10000, 0x0e6985d8, 0x0e698600, 0x0f01e000)
 compacting perm gen  total 262144K, used 19006K [0x184c0000, 0x284c0000, 0x384c0000)
   the space 262144K,   7% used [0x184c0000, 0x1974faf0, 0x1974fc00, 0x284c0000)
    ro space 10240K,  55% used [0x384c0000, 0x38a43148, 0x38a43200, 0x38ec0000)
    rw space 12288K,  55% used [0x38ec0000, 0x39565f30, 0x39566000, 0x39ac0000)

Code Cache  [0x01be0000, 0x01ed0000, 0x03be0000)
 total_blobs=1325 nmethods=1152 adapters=108 free_code_cache=30554176 largest_free_block=54208

Dynamic libraries:
0x00400000 - 0x00425000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\java.exe
0x77810000 - 0x77952000     C:\Windows\SYSTEM32\ntdll.dll
0x77980000 - 0x77a55000     C:\Windows\system32\kernel32.dll
0x757d0000 - 0x7581b000     C:\Windows\system32\KERNELBASE.dll
0x77760000 - 0x77801000     C:\Windows\system32\ADVAPI32.dll
0x771b0000 - 0x7725c000     C:\Windows\system32\msvcrt.dll
0x75de0000 - 0x75df9000     C:\Windows\SYSTEM32\sechost.dll
0x76cc0000 - 0x76d62000     C:\Windows\system32\RPCRT4.dll
0x7c340000 - 0x7c396000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\msvcr71.dll
0x6d8c0000 - 0x6db70000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\client\jvm.dll
0x75d10000 - 0x75dd9000     C:\Windows\system32\USER32.dll
0x75e00000 - 0x75e4e000     C:\Windows\system32\GDI32.dll
0x76cb0000 - 0x76cba000     C:\Windows\system32\LPK.dll
0x76aa0000 - 0x76b3d000     C:\Windows\system32\USP10.dll
0x759a0000 - 0x759d2000     C:\Windows\system32\WINMM.dll
0x76d70000 - 0x76d8f000     C:\Windows\system32\IMM32.DLL
0x76f30000 - 0x76ffd000     C:\Windows\system32\MSCTF.dll
0x75530000 - 0x7557c000     C:\Windows\system32\apphelp.dll
0x6d870000 - 0x6d87c000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\verify.dll
0x6d3d0000 - 0x6d3ef000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\java.dll
0x6d8b0000 - 0x6d8bf000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\zip.dll
0x6d600000 - 0x6d609000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\management.dll
0x6d850000 - 0x6d858000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\sunmscapi.dll
0x75820000 - 0x75941000     C:\Windows\system32\CRYPT32.dll
0x756a0000 - 0x756ac000     C:\Windows\system32\MSASN1.dll
0x6d6b0000 - 0x6d6c3000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\net.dll
0x77000000 - 0x77035000     C:\Windows\system32\WS2_32.dll
0x77960000 - 0x77966000     C:\Windows\system32\NSI.dll
0x75060000 - 0x7509c000     C:\Windows\system32\mswsock.dll
0x75050000 - 0x75056000     C:\Windows\System32\wship6.dll
0x74ba0000 - 0x74ba5000     C:\Windows\System32\wshtcpip.dll
0x750a0000 - 0x750b6000     C:\Windows\system32\CRYPTSP.dll
0x74e30000 - 0x74e6b000     C:\Windows\system32\rsaenh.dll
0x74c70000 - 0x74c87000     C:\Windows\system32\USERENV.dll
0x75630000 - 0x7563b000     C:\Windows\system32\profapi.dll
0x75580000 - 0x7558c000     C:\Windows\system32\CRYPTBASE.dll
0x73fa0000 - 0x73fb0000     C:\Windows\system32\NLAapi.dll
0x6cad0000 - 0x6cae0000     C:\Windows\system32\napinsp.dll
0x6cab0000 - 0x6cac2000     C:\Windows\system32\pnrpnsp.dll
0x74f20000 - 0x74f64000     C:\Windows\system32\DNSAPI.dll
0x6caa0000 - 0x6caa8000     C:\Windows\System32\winrnr.dll
0x73c60000 - 0x73c7c000     C:\Windows\system32\IPHLPAPI.DLL
0x73c40000 - 0x73c47000     C:\Windows\system32\WINNSI.DLL
0x70b00000 - 0x70b06000     C:\Windows\system32\rasadhlp.dll
0x738c0000 - 0x738f8000     C:\Windows\System32\fwpuclnt.dll
0x6d0b0000 - 0x6d1fc000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre\bin\awt.dll
0x04c50000 - 0x04ca1000     C:\Windows\system32\WINSPOOL.DRV
0x77600000 - 0x7775d000     C:\Windows\system32\ole32.dll
0x743c0000 - 0x7455e000     C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\COMCTL32.dll
0x76c50000 - 0x76ca7000     C:\Windows\system32\SHLWAPI.dll
0x04cb0000 - 0x04d22000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\temp\jna\jna4926640103557642336.dll
0x759e0000 - 0x759e5000     C:\Windows\system32\PSAPI.DLL
0x047a0000 - 0x047e7000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\DCLib.dll
0x00ea0000 - 0x00ec5000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\DCIC32.dll
0x74670000 - 0x74679000     C:\Windows\system32\HID.DLL
0x75b70000 - 0x75d0d000     C:\Windows\system32\SETUPAPI.dll
0x756b0000 - 0x756d7000     C:\Windows\system32\CFGMGR32.dll
0x77260000 - 0x772f1000     C:\Windows\system32\OLEAUT32.dll
0x75780000 - 0x75792000     C:\Windows\system32\DEVOBJ.dll
0x74320000 - 0x74360000     C:\Windows\system32\uxtheme.dll
0x60850000 - 0x60891000     C:\Program Files\TeamViewer\tv_w32.dll
0x74b10000 - 0x74b19000     C:\Windows\system32\VERSION.dll
0x75e50000 - 0x76a9b000     C:\Windows\system32\SHELL32.dll
0x757a0000 - 0x757cf000     C:\Windows\system32\WINTRUST.dll
0x04d30000 - 0x04d73000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\ssse32.dll
0x003c0000 - 0x003cc000     C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\HDICCardCtrl.dll
0x50f50000 - 0x5106c000     C:\Windows\system32\MFC42.DLL
0x5cd40000 - 0x5cdcc000     C:\Windows\system32\ODBC32.dll
0x69f50000 - 0x69f88000     C:\Windows\system32\odbcint.dll

VM Arguments:
jvm_args: -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.endorsed.dirs=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\endorsed -Dcatalina.base=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67 -Dcatalina.home=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67 -Djava.io.tmpdir=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\temp 
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39
JRE_HOME=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\JDK\jdk1.6.0_39\jre
CLASSPATH=C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\bootstrap.jar;C:\Users\Administrator\Desktop\CHISCard\CHISCard\apache-tomcat-7.0.67\bin\tomcat-juli.jar
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
USERNAME=Administrator
LD_LIBRARY_PATH=\DLL
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 42 Stepping 7, GenuineIntel

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

OS: Windows 7 Build 7601 Service Pack 1

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

Memory: 4k page, physical 1976424k(529016k free), swap 3952848k(954584k free)

vm_info: Java HotSpot(TM) Client VM (20.14-b01) for windows-x86 JRE (1.6.0_39-b04), built on Jan 15 2013 14:00:47 by "java_re" with MS VC++ 7.1 (VS2003)

time: Tue Nov 21 20:11:02 2017
elapsed time: 4196 seconds

加载中
0
一只小桃子
一只小桃子

看不出来有什么明显的问题,建议你换个机器,换个tomcat,以及打包打好一点,再试试看是不是还是这毛病

不日小鸡
回复 @Romanceling : 我楼下的已经说了,dll的问题
Romanceling
Romanceling
回复 @不日小鸡 : 我在下面追加了问题描述,没事的时候帮忙瞅瞅
Romanceling
Romanceling
回复 @一只小桃子 : 我在下面追加了问题描述,没事的时候帮忙瞅瞅
不日小鸡
你这跟有问题重启window有什么区别
一只小桃子
一只小桃子
既没死锁又没内存问题,看起来是类加载器装载类,关闭资源的时候报的错?
0
南湖船老大
南湖船老大

嗯,可以肯定你的服务挂掉是因为调用了jna4926640103557642336.dll,引发的操作系统内核错误

Problematic frame:
# C  [ntdll.dll+0x529ac]

谁写的dll谁负责喽。猜测是野指针这类问题导致的
 

 

依然菜刀
依然菜刀
这个jna是比较标准的java调用dll的组件,不是他们自己写的
Romanceling
Romanceling
我在下面追加了问题描述,没事的时候帮忙瞅瞅
0
Romanceling
Romanceling

补充一下:

只用到一个dll中的一个方法,它的.h源码:long WINAPI GetCardInfoCS(short cport, short cseat, char *data) 

我调用的方式:

 

现在问题是:卡机方给了我一个exe程序,这个程序循环调用几百次都不会出问题,我用上面java的方法调用运气好的话可以一直用,但是大多都是调用几次之后服务就死掉了

0
依然菜刀
依然菜刀

jna调用确实不够问题,给几个建议吧:

1、让卡机方提供java调用的接口,而不是自己通过jna调用dll

2、不要用java直接调用dll,而是应该对exe程序进行一个包装,将接口包装成类似于http/socket的方式供java调用

Romanceling
Romanceling
时间紧任务重,有多种卡机,别的都是好好的,就某一个不行,不能乱改
0
浮生若梦E
浮生若梦E

你操作系统的 位数 和  tomcat 版本的位数一致吗

Romanceling
Romanceling
用的都是32位的,无论什么操作系统.用64位的话老是提示加载不到dll模块
javaining
javaining
jre
0
北极心
北极心

我也建议将调用调用dll做成个微服务,tomcat里面用http/socket通信去调用,设置超时等机制,就算dll那个微服务挂了,也不至于影响tomcat项目里面的其他功能正常访问,

Romanceling
Romanceling
我们这个服务就是单独用作读卡的
0
z
z13515

是不是运行阶段替换过啥jar包?

 

Romanceling
Romanceling
没有
0
Romanceling
Romanceling

目前问题解决了,在测试!谢谢各位大佬.

Romanceling
Romanceling
测试稳定了我回来整理一下发出来
z
z13515
是什么问题呢,怎么解决呢,分享学习下。
0
开源中国首席罗纳尔多
Romanceling
Romanceling
dll应该没问题,我只改了调用布分。
0
Romanceling
Romanceling

问题解决了,希望对遇到类似问题的人有点帮助https://my.oschina.net/langgege/blog/1577812

返回顶部
顶部