开发者

Does JNI differ in JRE 1.4 and JRE 1.6 ? Our lib now crashes

开发者 https://www.devze.com 2023-01-04 06:50 出处:网络
I\'m responsible for maintaining a java swing application. It used to run quite fine with java 1.4, but with the time we encountered more and more crashes of the JRE that made us upgrade to the JRE 1.

I'm responsible for maintaining a java swing application. It used to run quite fine with java 1.4, but with the time we encountered more and more crashes of the JRE that made us upgrade to the JRE 1.6, which at least is still maintained by Sun.

With the JRE 1.6 we now encounter a different kind of problem, in the part displaying ECW image files thanks to JNI and the native dlls NCSEcw.dll, NCSUtil.dll and NCScnet.dll (which are produced by ERDAS and can be found here : http://www.erdas.com/Products/ERDASDownloads/tabid/192/CurrentID/2560/Default.aspx ).

Most of the time the problem is a freeze (probably a deadlock) but one or two times we had real crashes of the JRE, with the hs_err_pid message I copied below. It does not appear on all machines, and is not systematic on the concerned machines (though very frequent). Most of the concerned machines seem to be running Windows 2000 SP4, but it appeared also on some XP machines and I can't find the criterion which differentiates them.

Is there a difference in the way JNI calls the library that make it work with 1.4 and not with 1.6 ? I'm a bit lost, thanks for any clue.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x5ffa1049, pid=2196, tid=2244
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )
# Problematic frame:
# C  [NCSEcw.dll+0x1049]
#
# 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 (0x33893800):  JavaThread "Pool-1" [_thread_in_native, id=2244, stack(0x36580000,0x36680000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x00000000, EBX=0x38e681d0, ECX=0x3460ff88, EDX=0x0000019c
ESP=0x3667f6e0, EBP=0x00000000, ESI=0x00000004, EDI=0x00000000
EIP=0x5ffa1049, EFLAGS=0x00010206

Top of Stack: (sp=0x3667f6e0)
0x3667f6e0:   00000010 3460ffa0 3895e5a8 38e68248
0x3667f6f0:   00000000 40000000 00000004 00000001
0x3667f700:   00000000 5ffa109f 3460fea8 34600005
0x3667f710:   000005ea 3460ffa0 00000010 38e68ec8
0x3667f720:   3865dd98 38e682c0 00000001 38e68338
0x3667f730:   00000007 3a416e6c 3895feac 5ffa109f
0x3667f740:   3460fea8 34600006 00000bb5 38e68ec8
0x3667f750:   00000010 3895ffd0 3a415568 38e68338 

Instructions: (pc=0x5ffa1049)
0x5ffa1039:   ff 8b c7 be 04 00 00 00 8b 4b 04 8b 6b 08 03 c8
0x5ffa1049:   8b 2c 28 83 c0 04 8b 11 89 29 8b 4b 08 4e 89 54 


Stack: [0x36580000,0x36680000],  sp=0x3667f6e0,  free space=3fd3667f23ck
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [NCSEcw.dll+0x1049]

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

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.ermapper.ecw.JNCSFile.ECWReadImageRGBA([III)I+0
j  com.ermapper.ecw.JNCSFile.readImageRGBA([III)I+4
j  com.ermapper.ecw.JNCSRenderer.ecwReadImage(IIDDDD)Z+98
j  com.ermapper.ecw.JNCSRenderer.drawImage(Ljava/awt/Graphics;IIIIDDDDLjava/awt/image/ImageObserver;)V+39
j  com.esrifrance.moje.ecw.ECWLayer.drawAvecRenderer(Lcom/esri/mo2/map/dpy/DisplayArea;)V+286
j  com.esrifrance.moje.ecw.ECWLayer.drawWithinScale(Lcom/esri/mo2/map/dpy/DisplayArea;I)V+63
j  com.esri.mo2.map.dpy.BaseLayer.draw(Lcom/esri/mo2/map/dpy/DisplayArea;I)V+16
j  com.esri.mo2.map.dpy.BaseDisplayManager$d_.a(Lcom/esri/mo2/map/dpy/Layer;)V+18
j  com.esri.mo2.map.dpy.BaseDisplayManager$d_$a_.visiting(Lcom/esri/mo2/map/dpy/Layer;)Z+5
J  com.esri.mo2.map.dpy.BaseGroupLayer.a(Lcom/esri/mo2/map/dpy/LayerVisitor;ZI)V
J  com.esri.mo2.map.dpy.BaseGroupLayer.a(Lcom/esri/mo2/map/dpy/LayerVisitor;)V
j  com.esri.mo2.map.dpy.BaseGroupLayer.traverse(Lcom/esri/mo2/map/dpy/LayerVisitor;Z)V+37
j  com.esri.mo2.map.dpy.BaseDisplayManager$d_.m()V+15
j  com.esri.mo2.map.dpy.BaseDisplayManager$d_.run()V+49
j  com.esri.mo2.sys.tp.ThreadPool$a_.run()V+39
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x33855c00 JavaThread "RetrieveThread-31" [_thread_in_native, id=2236, stack(0x3c880000,0x3c980000)]
  0x34788400 JavaThread "Thread-17" [_thread_in_native, id=2120, stack(0x3b2a0000,0x3b3a0000)]
  0x34723c00 JavaThread "Image Animator 0" daemon [_thread_blocked, id=960, stack(0x3b1a0000,0x3b2a0000)]
  0x33892400 JavaThread "Timer-0" [_thread_blocked, id=1664, stack(0x38660000,0x38760000)]
  0x34796400 JavaThread "Swing-Shell" daemon [_thread_blocked, id=2500, stack(0x36990000,0x36a90000)]
  0x33894800 JavaThread "Pool-2" [_thread_blocked, id=2440, stack(0x36680000,0x36780000)]
=>0x33893800 JavaThread "Pool-1" [_thread_in_native, id=2244, stack(0x36580000,0x36680000)]
  0x342b5400 JavaThread "Pool-0" [_thread_blocked, id=612, stack(0x36480000,0x36580000)]
  0x34859400 JavaThread "Thread-6" daemon [_thread_in_native, id=2044, stack(0x36380000,0x36480000)]
  0x342e9800 JavaThread "DispatcherThread-4" [_thread_blocked, id=2232, stack(0x35680000,0x35780000)]
  0x346e5c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2004, stack(0x34c50000,0x34d50000)]
  0x346c5800 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=792, stack(0x34b50000,0x34c50000)]
  0x34208000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2452, stack(0x344f0000,0x345f0000)]
  0x34230400 JavaThread "AWT-Shutdown" [_thread_blocked, id=744, stack(0x343f0000,0x344f0000)]
  0x34195800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2180, stack(0x342f0000,0x343f0000)]
  0x33881000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2420, stack(0x33ef0000,0x33ff0000)]
  0x3387b400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2292, stack(0x33df0000,0x33ef0000)]
  0x33879c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=2020, stack(0x33cf0000,0x33df0000)]
  0x33878400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1404, stack(0x33bf0000,0x33cf0000)]
  0x33868400 JavaThread "Finalizer" daemon [_thread_blocked, id=2436, stack(0x33af0000,0x33bf0000)]
  0x33863800 JavaThread "Reference Handler" daemon [_thread_blocked, id=2404, stack(0x339f0000,0x33af0000)]
  0x00877400 JavaThread "main" [_thread_blocked, id=2280, stack(0x00030000,0x00130000)]

Other Threads:
  0x33860c00 VMThread [stack: 0x338f0000,0x339f0000] [id=2364]
  0x3388c000 WatcherThread [stack: 0x33ff0000,0x340f0000] [id=2384]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 53248K, used 13986K [0x02940000, 0x06300000, 0x117e0000)
  eden space 47360K,  29% used [0x02940000, 0x036e8818, 0x05780000)
  from space 5888K,   0% used [0x05780000, 0x05780000, 0x05d40000)
  to   space 5888K,   0% used [0x05d40000, 0x05d40000, 0x06300000)
 tenured generation   total 118120K, used 70871K [0x117e0000, 0x18b3a000, 0x2f540000)
   the space 118120K,  59% used [0x117e0000, 0x15d15df0, 0x15d15e00, 0x18b3a000)
 compacting perm gen  total 29696K, used 29522K [0x2f540000, 0x31240000, 0x33540000)
   the space 29696K,  99% used [0x2f540000, 0x31214ac8, 0x31214c00, 0x31240000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x00455000  C:\Program Files\Sipa2010\Sipa.exe
0x78460000 - 0x784e1000  C:\WINNT\system32\ntdll.dll
0x78ed0000 - 0x78f32000  C:\WINNT\system32\ADVAPI32.dll
0x77e70000 - 0x77f34000  C:\WINNT\system32\KERNEL32.DLL
0x770c0000 - 0x77131000  C:\WINNT\system32\RPCRT4.DLL
0x77e00000 - 0x77e65000  C:\WINNT\system32\USER32.dll
0x77f40000 - 0x77f7c000  C:\WINNT\system32\GDI32.DLL
0x77810000 - 0x77817000  C:\WINNT\system32\VERSION.dll
0x75950000 - 0x75956000  C:\WINNT\system32\LZ32.DLL
0x6d8b0000 - 0x6db47000  c:\program files\sipa2010\jre\bin\client\jvm.dll
0x77540000 - 0x77571000  C:\WINNT\system32\WINMM.dll
0x7c340000 - 0x7c396000  C:\WINNT\system32\MSVCR71.dll
0x6d860000 - 0x6d86c000  c:\program files\sipa2010\jre\bin\verify.dll
0x6d3e0000 - 0x6d3ff000  c:\program files\sipa2010\jre\bin\java.dll
0x6d340000 - 0x6d348000  c:\program files\sipa2010\jre\bin\hpi.dll
0x68ea0000 - 0x68eab000  C:\WINNT\system32\PSAPI.DLL
0x6d8a0000 - 0x6d8af000  c:\program files\sipa2010\jre\bin\zip.dll
0x6d0b0000 - 0x6d1fa000  C:\Program Files\Sipa2010\jre\bin\awt.dll
0x777f0000 - 0x7780e000  C:\WINNT\system32\WINSPOOL.DRV
0x793c0000 - 0x793d1000  C:\WINNT\system32\MPR.DLL
0x75e00000 - 0x75e1a000  C:\WINNT\system32\IMM32.dll
0x77a40000 - 0x77b37000  C:\WINNT\system32\ole32.dll
0x71710000 - 0x71794000  C:\WINNT\system32\COMCTL32.dll
0x6e350000 - 0x6e356000  C:\WINNT\system32\INDICDLL.dll
0x77580000 - 0x777cf000  C:\WINNT\system32\shell32.dll
0x77290000 - 0x772f6000  C:\WINNT\system32\SHLWAPI.DLL
0x78000000 - 0x78045000  C:\WINNT\system32\msvcrt.dll
0x6d2e0000 - 0x6d334000  C:\Program Files\Sipa2010\jre\bin\fontmanager.dll
0x6d6c0000 - 0x6d6d3000  C:\Program Files\Sipa2010\jre\bin\net.dll
0x74fb0000 - 0x74fc4000  C:\WINNT\system32\WS2_32.dll
0x74fa0000 - 0x74fa8000  C:\WINNT\system32\WS2HELP.DLL
0x6d6e0000 - 0x6d6e9000  C:\Program Files\Sipa2010\jre\bin\nio.dll
0x77830000 - 0x7783c000  C:\WINNT\System32\rnr20.dll
0x77970000 - 0x77994000  C:\WINNT\system32\DNSAPI.DLL
0x74fd0000 - 0x74fd9000  C:\WINNT\system32\WSOCK32.DLL
0x77310000 - 0x77323000  C:\WINNT\system32\iphlpapi.dll
0x774f0000 - 0x774f5000  C:\WINNT\system32\ICMP.DLL
0x34da0000 - 0x34db7000  C:\WINNT\system32\MPRAPI.DLL
0x750d0000 - 0x750df000  C:\WINNT\system32\SAMLIB.DLL
0x7ccc0000 - 0x7cd10000  C:\WINNT\system32\NETAPI32.DLL
0x78fb0000 - 0x78fbf000  C:\WINNT\system32\Secur32.dll
0x77be0000 - 0x77bf1000  C:\WINNT\system32\NTDSAPI.dll
0x77940000 - 0x7796b000  C:\WINNT\system32\WLDAP32.DLL
0x75140000 - 0x75146000  C:\WINNT\system32\NETRAP.dll
0x779a0000 - 0x77a3b000  C:\WINNT\system32\OLEAUT32.DLL
0x77380000 - 0x773b0000  C:\WINNT\system32\ACTIVEDS.DLL
0x77350000 - 0x77373000  C:\WINNT\system32\ADSLDPC.DLL
0x77820000 - 0x7782e000  C:\WINNT\system32\RTUTILS.DLL
0x783c0000 - 0x78451000  C:\WINNT\system32\SETUPAPI.DLL
0x78d20000 - 0x78d83000  C:\WINNT\system32\USERENV.DLL
0x774b0000 - 0x774e3000  C:\WINNT\system32\RASAPI32.DLL
0x77490000 - 0x774a1000  C:\WINNT\system32\RASMAN.DLL
0x77500000 - 0x77522000  C:\WINNT\system32\TAPI32.DLL
0x77330000 - 0x77349000  C:\WINNT\system32\DHCPCSVC.DLL
0x777d0000 - 0x777d8000  C:\WINNT\System32\winrnr.dll
0x66210000 - 0x66219000  C:\WINNT\system32\netware\NWWS2NDS.DLL
0x50d50000 - 0x50d98000  C:\WINNT\system32\NETWIN32.DLL
0x50d00000 - 0x50d15000  C:\WINNT\system32\CLNWIN32.DLL
0x50df0000 - 0x50e10000  C:\WINNT\system32\LOCWIN32.DLL
0x50db0000 - 0x50ddc000  C:\WINNT\system32\NCPWIN32.dll
0x66220000 - 0x6622c000  C:\WINNT\system32\netware\NWWS2SLP.DLL
0x66250000 - 0x66257000  C:\WINNT\system32\NWSRVLOC.dll
0x74f50000 - 0x74f6e000  C:\WINNT\system32\msafd.dll
0x74f90000 - 0x74f97000  C:\WINNT\System32\wshtcpip.dll
0x777e0000 - 0x777e5000  C:\WINNT\system32\rasadhlp.dll
0x6d250000 - 0x6d273000  C:\Program Files\Sipa2010\jre\bin\dcpr.dll
0x7ca00000 - 0x7ca23000  C:\WINNT\system32\rsaenh.dll
0x77410000 - 0x77489000  C:\WINNT\system32\CRYPT32.dll
0x77400000 - 0x77410000  C:\WINNT\system32\MSASN1.DLL
0x72c60000 - 0x72ce6000  C:\WINNT\system32\CLBCATQ.DLL
0x77840000 - 0x77880000  C:\WINNT\system32\cscui.dll
0x77090000 - 0x770b3000  C:\WINNT\system32\CSCDLL.DLL
0x76dc0000 - 0x76dd2000  C:\WINNT\system32\mydocs.dll
0x36cf0000 - 0x36e3a000  C:\WINNT\system32\SHDOCVW.DLL
0x71e40000 - 0x71e8d000  C:\WINNT\system32\docprop2.dll
0x6a6f0000 - 0x6a710000  C:\WINNT\system32\MSVFW32.DLL
0x747f0000 - 0x74806000  C:\WINNT\system32\AVIFIL32.DLL
0x773e0000 - 0x773f3000  C:\WINNT\system32\MSACM32.dll
0x6ff60000 - 0x6ff65000  C:\WINNT\system32\faxshell.dll
0x37250000 - 0x372ab000  C:\Program Files\Fichiers communs\Adobe\Acrobat\ActiveX\PDFShell.dll
0x78130000 - 0x781cb000  C:\WINNT\system32\MSVCR80.dll
0x750e0000 - 0x750ec000  C:\WINNT\System32\ntlanman.dll
0x75190000 - 0x751a5000  C:\WINNT\System32\NETUI0.DLL
0x75150000 - 0x75188000  C:\WINNT\System32\NETUI1.DLL
0x58200000 - 0x582d1000  C:\WINNT\system32\NOVNPNT.DLL
0x50d20000 - 0x50d4d000  C:\WINNT\system32\CALWIN32.DLL
0x50da0000 - 0x50dab000  C:\WINNT\system32\CLXWIN32.DLL
0x58300000 - 0x5833b000  C:\WINNT\system32\MAPBASE.dll
0x58380000 - 0x583be000  C:\WINNT\system32\NWSHLXNT.dll
0x6a400000 - 0x6a41c000  C:\WINNT\system32\NLS\FRANCAIS\MAPBASER.DLL
0x37500000 - 0x3751d000  C:\WINNT\system32\NLS\FRANCAIS\NWSHLXNR.DLL
0x37520000 - 0x37596000  C:\WINNT\system32\NLS\FRANCAIS\NOVNPNTR.DLL
0x375a0000 - 0x376a2000  C:\Program Files\Sipa2010\jre\bin\esri_jni_mrsid.dll
0x377c0000 - 0x37ac1000  C:\Program Files\Sipa2010\jre\bin\mlib_jai.dll
0x5ff80000 - 0x5ff98000  C:\Program Files\Sipa2010\jre\bin\NCSUtil.dll
0x77910000 - 0x77933000  C:\WINNT\system32\IMAGEHLP.dll
0x5ffd0000 - 0x5ffe4000  C:\Program Files\Sipa2010\jre\bin\NCScnet.dll
0x5ffa0000 - 0x5ffcc000  C:\Program Files\Sipa2010\jre\bin\NCSEcw.dll
0x69a00000 - 0x69a1d000  C:\WINNT\system32\NTMARTA.DLL
0x6d500000 - 0x6d524000  C:\Program Files\Sipa2010\jre\bin\jpeg.dll

VM Arguments:
jvm_args: -Xms150000000 -Xmx750000000 
java_command: 
Launcher Type: generic

Environment Variables:
CLASSPATH=C:\Program Files\Sipa2010\impression.jar;C:\Program Files\Sipa2010\lib\moje21\jsde90_sdkres.jar;C:\Program Files\Sipa2010\lib\fop\xml-apis.jar;C:\Program Files\Sipa2010\SIPA.jar;C:\Program Files\Sipa2010\lib\fop\fop.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21img.jar;C:\Program Files\Sipa2010\li开发者_如何学编程b\log4j-1.2.7.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21rpf.jar;C:\Program Files\Sipa2010\lib\moje21\mlibwrapper_jai.jar;C:\Program Files\Sipa2010\lib\fop\xercesImpl-2.2.1.jar;C:\Program Files\Sipa2010\lib\MDateSelector.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21.jar;C:\Program Files\Sipa2010\lib\moje21\jsde90_sdk.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21res.jar;C:\Program Files\Sipa2010\lib\moje21\esri_xmlkit.jar;C:\Program Files\Sipa2010\lib\moje21\jai_codec.jar;C:\Program Files\Sipa2010\lib\moje21\jai_core.jar;C:\Program Files\Sipa2010\lib\moje21\jpe90_sdk.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21vpf.jar;C:\Program Files\Sipa2010\lib\fop\avalon-framework-cvs-20020806.jar;C:\Program Files\Sipa2010\lib\fop\batik.jar;C:\Program Files\Sipa2010\lib\classes12.jar;C:\Program Files\Sipa2010\lib\moje21\esri_mo21cad.jar;C:\Program Files\Sipa2010\lib\pdfbox-sword.jar;C:\Program Files\Sipa2010\lax.jar;C:\Program Files\Sipa2010\ecwermapperjni.jar;
PATH=C:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\FRANCAIS;C:\Program Files\Novell\ZENworks
USERNAME=David
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel



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

OS: Windows 2000 Build 2195 Service Pack 4

CPU:total 2 (1 cores per cpu, 2 threads per core) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht

Memory: 4k page, physical 1047020k(341768k free), swap 1719680k(1051752k 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: Fri Jun 18 10:33:04 2010
elapsed time: 59 seconds


Jon has a hint that could explain your JNI problems after changing the JRE. Recompilation of the native libraries would be a solution, according to his answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号