ReleaseManager.finalize() crashes Tomcat

  • I'm using JCom from a Java application to access a COM API for MassTransit (a file transfer application). On occasion when the ReleaseManager is garbage collected by the JVM the execution of finalize method on the Release manager will cause the Tomcat service to crash. In the Java program code the ReleaseManager is created and discarded many times, but errs only very rarely. If anyone has an insight as to why this might be happening it would be appreciated. Thanks.

    The error log generated by Tomcat contains the following:

    # An unexpected error has been detected by HotSpot Virtual Machine:
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7769a67f, pid=2556, tid=988
    # Java VM: Java HotSpot(TM) Server VM (1.5.0_11-b03 mixed mode)
    # Problematic frame:
    # C  [ole32.dll+0x2a67f]

    ---------------  T H R E A D  ---------------

    Current thread (0x37bf89e0):  JavaThread "Finalizer" daemon [_thread_in_native, id=988]

    siginfo: ExceptionCode=0xc0000005, reading address 0xc68fb78d

    EAX=0xc68fb78d, EBX=0x000a8c80, ECX=0x000b0124, EDX=0x77791f58
    ESP=0x37e9f7d8, EBP=0x37e9f7f0, ESI=0x000a8b90, EDI=0x000b0124
    EIP=0x7769a67f, EFLAGS=0x00010286

    Top of Stack: (sp=0x37e9f7d8)
    0x37e9f7d8:   000b0124 000b0124 00000000 776b2f20
    0x37e9f7e8:   000b0120 000b0124 37e9f808 776b2f02
    0x37e9f7f8:   000b01c8 000b0120 04ffe7b0 000b2920
    0x37e9f808:   37e9f814 776b2e4e 000b0120 37e9f828
    0x37e9f818:   776b2fd3 00000001 37bf89e0 04ffe7b0
    0x37e9f828:   37e9f834 77ce143e 80000000 37e9f84c
    0x37e9f838:   39e51127 000b025c 000b025c 38a8cb48
    0x37e9f848:   00000032 37e9f878 008186cc 37bf8aa0

    Instructions: (pc=0x7769a67f)
    0x7769a66f:   02 00 8b 45 fc 8b 08 50 ff 51 08 e9 ab 88 01 00
    0x7769a67f:   8b 08 50 ff 51 08 83 66 18 00 e9 de 88 01 00 33

    Stack: [0x37e60000,0x37ea0000),  sp=0x37e9f7d8,  free space=253k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [ole32.dll+0x2a67f]
    C  [ole32.dll+0x42f02]
    C  [ole32.dll+0x42e4e]
    C  [ole32.dll+0x42fd3]
    C  [RPCRT4.dll+0x9143e]
    C  [jcom.dll+0x1127]
    v  ~StubRoutines::call_stub
    V  [jvm.dll+0xf98c0]

    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    v  ~StubRoutines::call_stub
    j  java.lang.ref.Finalizer.invokeFinalizeMethod(Ljava/lang/Object;)V+0
    j  java.lang.ref.Finalizer.runFinalizer()V+45
    v  ~C2IAdapter
    J  java.lang.ref.Finalizer$
    v  ~OSRAdapter
    v  ~StubRoutines::call_stub

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

    Java Threads: ( => current thread )
      0x391b5e70 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" daemon [_thread_blocked, id=784]
      0x38e5b618 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" daemon [_thread_blocked, id=1320]
      0x395a68a0 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" daemon [_thread_blocked, id=1856]
      0x38845310 JavaThread "ReceiptService" [_thread_blocked, id=3260]
      0x37db5250 JavaThread "ShadowService" [_thread_in_native, id=3860]
      0x007cbc38 JavaThread "TransferService" [_thread_in_native, id=3872]
      0x39486008 JavaThread "TP-Monitor" daemon [_thread_blocked, id=2628]
      0x37dc2e40 JavaThread "TP-Processor4" daemon [_thread_in_native, id=3548]
      0x3939a458 JavaThread "TP-Processor3" daemon [_thread_blocked, id=1436]
      0x39699da8 JavaThread "TP-Processor2" daemon [_thread_blocked, id=2032]
      0x39032dc8 JavaThread "TP-Processor1" daemon [_thread_blocked, id=3904]
      0x384095e0 JavaThread "http-80-Monitor" [_thread_blocked, id=3440]
      0x3893ce00 JavaThread "http-80-Processor25" daemon [_thread_in_native, id=2108]
      0x3893cc78 JavaThread "http-80-Processor24" daemon [_thread_blocked, id=596]
      0x397bcdb8 JavaThread "http-80-Processor23" daemon [_thread_blocked, id=3836]
      0x3a4c8190 JavaThread "http-80-Processor22" daemon [_thread_in_native, id=3532]
      0x3a4c8008 JavaThread "http-80-Processor21" daemon [_thread_blocked, id=3288]
      0x3a796cc8 JavaThread "http-80-Processor20" daemon [_thread_blocked, id=1840]
      0x39836a90 JavaThread "http-80-Processor19" daemon [_thread_blocked, id=3608]
      0x394f8408 JavaThread "http-80-Processor18" daemon [_thread_blocked, id=680]
      0x392f5d30 JavaThread "http-80-Processor17" daemon [_thread_blocked, id=2748]
      0x396ead30 JavaThread "http-80-Processor16" daemon [_thread_blocked, id=2620]
      0x3a6e5d38 JavaThread "http-80-Processor15" daemon [_thread_blocked, id=2716]
      0x37d81008 JavaThread "http-80-Processor14" daemon [_thread_blocked, id=1332]
      0x397bd408 JavaThread "http-80-Processor13" daemon [_thread_blocked, id=2644]
      0x3878ed78 JavaThread "http-80-Processor12" daemon [_thread_blocked, id=328]
      0x38ddd3c0 JavaThread "http-80-Processor11" daemon [_thread_blocked, id=3336]
      0x383db628 JavaThread "http-80-Processor10" daemon [_thread_blocked, id=1560]
      0x3ac140a0 JavaThread "http-80-Processor9" daemon [_thread_blocked, id=2208]
      0x39efada8 JavaThread "http-80-Processor8" daemon [_thread_blocked, id=2412]
      0x381a6db0 JavaThread "http-80-Processor7" daemon [_thread_blocked, id=724]
      0x37da5310 JavaThread "http-80-Processor6" daemon [_thread_blocked, id=2504]
      0x3a5ad008 JavaThread "http-80-Processor5" daemon [_thread_blocked, id=3344]
      0x3977ed30 JavaThread "http-80-Processor4" daemon [_thread_blocked, id=4084]
      0x385f3008 JavaThread "http-80-Processor3" daemon [_thread_blocked, id=2464]
      0x387dedd8 JavaThread "http-80-Processor2" daemon [_thread_blocked, id=2116]
      0x39aa2d98 JavaThread "http-80-Processor1" daemon [_thread_blocked, id=3032]
      0x399d9360 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=1880]
      0x399a9310 JavaThread "Store org.hibernate.cache.StandardQueryCache Expiry Thread" daemon [_thread_blocked, id=1060]
      0x390d5fa0 JavaThread "Store org.hibernate.cache.StandardQueryCache Spool Thread" daemon [_thread_blocked, id=3948]
      0x3982d548 JavaThread "Store org.hibernate.cache.UpdateTimestampsCache Expiry Thread" daemon [_thread_blocked, id=912]
      0x38346e70 JavaThread "Store org.hibernate.cache.UpdateTimestampsCache Spool Thread" daemon [_thread_blocked, id=3460]
      0x37dd0e18 JavaThread "Timer-0" daemon [_thread_blocked, id=1148]
      0x37c73140 JavaThread "Thread-1" [_thread_in_native, id=3968]
      0x37bfe258 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2864]
      0x37bfcea8 JavaThread "CompilerThread1" daemon [_thread_blocked, id=3936]
      0x37bfc0a0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=756]
      0x0080f278 JavaThread "AdapterThread" daemon [_thread_blocked, id=3056]
      0x37bfb728 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2688]
    =>0x37bf89e0 JavaThread "Finalizer" daemon [_thread_in_native, id=988]
      0x00808b30 JavaThread "Reference Handler" daemon [_thread_blocked, id=1696]
      0x003c4a58 JavaThread "main" [_thread_in_native, id=2728]

    Other Threads:
      0x008068f0 VMThread [id=3008]
      0x37bfb680 WatcherThread [id=2780]

    VM state:not at safepoint (normal execution)

    VM Mutex/Monitor currently owned by a thread: None

    PSYoungGen      total 6720K, used 1123K [0x322c0000, 0x32a70000, 0x37810000)
      eden space 5568K, 17% used [0x322c0000,0x323b3d80,0x32830000)
      from space 1152K, 12% used [0x32950000,0x32975220,0x32a70000)
      to   space 1152K, 0% used [0x32830000,0x32830000,0x32950000)
    PSOldGen        total 452032K, used 70114K [0x07810000, 0x23180000, 0x322c0000)
      object space 452032K, 15% used [0x07810000,0x0bc88a80,0x23180000)
    PSPermGen       total 48640K, used 26195K [0x03810000, 0x06790000, 0x07810000)
      object space 48640K, 53% used [0x03810000,0x051a4e10,0x06790000)

    Dynamic libraries:
    0x00400000 - 0x0040e000     C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000     C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000     C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77412000     C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000     C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77fec000     C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000     C:\WINDOWS\system32\RPCRT4.dll
    0x77ba0000 - 0x77bfa000     C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0d3000     C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000     C:\WINDOWS\system32\SHLWAPI.dll
    0x77420000 - 0x77523000     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.1830_x-ww_7AE38CCF\comctl32.dll
    0x6d8e0000 - 0x6dc85000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\server\jvm.dll
    0x76aa0000 - 0x76acd000     C:\WINDOWS\system32\WINMM.dll
    0x6d300000 - 0x6d308000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\hpi.dll
    0x76b70000 - 0x76b7b000     C:\WINDOWS\system32\PSAPI.DLL
    0x76f50000 - 0x76f63000     C:\WINDOWS\system32\Secur32.dll
    0x6d710000 - 0x6d71c000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\verify.dll
    0x6d380000 - 0x6d39d000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\java.dll
    0x6d730000 - 0x6d73f000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\zip.dll
    0x6d540000 - 0x6d553000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\net.dll
    0x71c00000 - 0x71c17000     C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000     C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000     C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2c9000     C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000     C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76ef9000     C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000     C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000     C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000     C:\WINDOWS\system32\rasadhlp.dll
    0x39e50000 - 0x39e65000     C:\Program Files\Java\jdk1.5.0_11\jre\bin\jcom.dll
    0x77670000 - 0x777a4000     C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8c000     C:\WINDOWS\system32\OLEAUT32.dll
    0x777b0000 - 0x77833000     C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000     C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000     C:\WINDOWS\system32\VERSION.dll
    0x3cae0000 - 0x3cda5000     C:\WINDOWS\system32\xpsp2res.dll
    0x745e0000 - 0x748a6000     C:\WINDOWS\system32\msi.dll

    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\ -Duser.timezone=US/Eastern vfprintf -Xms512m -Xmx768m
    java_command: <unknown>
    Launcher Type: generic

    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jre1.5.0_07
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel

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

    OS: Windows Server 2003 family Build 3790 Service Pack 1

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

    Memory: 4k page, physical 2096400k(1139908k free), swap 4039920k(3240368k free)

    vm_info: Java HotSpot(TM) Server VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 00:54:53 by "java_re" with MS VC++ 6.0