Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6900784

Invoking JNI_AttachCurrentThread() from inside shutdown hook crashes JVM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 6u16
    • hotspot
    • x86
    • windows_xp

      Please find the attached crash log. It seems that invoking JNI_ AttachCurrentThread() from within a shutdown hook -- Runtime.getRuntime().addShutdownHook() -- causes the JVM to crash.

      Expecting JNI_AttachCurrentThread() to return a negative value (to indicate that the operation is illegal) and for this limitation to be documented explicitly. Alternatively, JNI_AttachCurrentThread() should work from within shutdown hooks.


      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (0xe06d7363), pid=3172, tid=3036
      #
      # JRE version: 6.0_18-b03
      # Java VM: Java HotSpot(TM) Client VM (16.0-b10 mixed mode, sharing windows-x86 )
      # Problematic frame:
      # C [KERNELBASE.dll+0xb727]
      #
      # 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 (0x05602800): JavaThread "Thread-1" [_thread_in_native, id=3036, stack(0x06950000,0x06a50000)]

      siginfo: ExceptionCode=0xe06d7363, ExceptionInformation=0x19930520 0x06a4e900 0x10043f48

      Registers:
      EAX=0x06a4e7d8, EBX=0x00000000, ECX=0x00000003, EDX=0x00000000
      ESP=0x06a4e7d8, EBP=0x06a4e828, ESI=0x62dd057c, EDI=0x06a4e868
      EIP=0x7742b727, EFLAGS=0x00000216

      Top of Stack: (sp=0x06a4e7d8)
      0x06a4e7d8: e06d7363 00000001 00000000 7742b727
      0x06a4e7e8: 00000003 19930520 06a4e900 10043f48
      0x06a4e7f8: 62efbafd 004d6389 06a4e80b 06a4e90c
      0x06a4e808: 004d6368 06a4e820 62ef8c9f 00000021
      0x06a4e818: 06a4e90c 00000021 06a4e848 62ef854c
      0x06a4e828: 06a4e868 62e6fee2 e06d7363 00000001
      0x06a4e838: 00000003 06a4e85c 06a4e98c 06a4e878
      0x06a4e848: e06d7363 00000001 00000000 00000000

      Instructions: (pc=0x7742b727)
      0x7742b717: 0c eb 03 89 45 c0 8d 45 b0 50 ff 15 6c 11 42 77
      0x7742b727: c9 c2 10 00 cc cc cc cc cc 8b ff 55 8b ec 56 8b


      Stack: [0x06950000,0x06a50000], sp=0x06a4e7d8, free space=3f906a4e2fck
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [KERNELBASE.dll+0xb727]
      C [MSVCR90D.dll+0xafee2]
      C [jace.dll+0x14960]
      C [jace.dll+0x148ae]
      C [JPeripheral.dll+0x17042a]
      C [JPeripheral.dll+0x16f09c]
      C [JPeripheral.dll+0xec7c2]
      j jperipheral.WindowsOS.nativeDispose()V+0
      j jperipheral.WindowsOS.access$000(Ljperipheral/WindowsOS;)V+1
      j jperipheral.WindowsOS$1.run()V+12
      v ~StubRoutines::call_stub
      V [jvm.dll+0xf0afc]
      V [jvm.dll+0x180661]
      V [jvm.dll+0xf0cc7]
      V [jvm.dll+0xf0d3d]
      V [jvm.dll+0x11a960]
      V [jvm.dll+0x1de374]
      V [jvm.dll+0x1802dc]
      C [MSVCR71.dll+0x9565]
      C [kernel32.dll+0x13677]
      C [ntdll.dll+0x39d72]
      C [ntdll.dll+0x39d45]

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j jperipheral.WindowsOS.nativeDispose()V+0
      j jperipheral.WindowsOS.access$000(Ljperipheral/WindowsOS;)V+1
      j jperipheral.WindowsOS$1.run()V+12
      v ~StubRoutines::call_stub

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

      Java Threads: ( => current thread )
        0x05603400 JavaThread "Thread-13" [_thread_in_native, id=3216, stack(0x06d70000,0x06e70000)]
        0x05602c00 JavaThread "Thread-17" [_thread_in_native, id=3348, stack(0x06bf0000,0x06cf0000)]
      =>0x05602800 JavaThread "Thread-1" [_thread_in_native, id=3036, stack(0x06950000,0x06a50000)]
        0x05602000 JavaThread "Thread-9" [_thread_in_native, id=3844, stack(0x065e0000,0x066e0000)]
        0x05601800 JavaThread "Thread-21" [_thread_in_native, id=408, stack(0x06700000,0x06800000)]
        0x055f9000 JavaThread "Thread-5" [_thread_in_native, id=4128, stack(0x062d0000,0x063d0000)]
        0x0559fc00 JavaThread "SIGINT handler" daemon [_thread_blocked, id=376, stack(0x06400000,0x06500000)]
        0x055b2c00 JavaThread "Thread-23" [_thread_in_native, id=3132, stack(0x061b0000,0x062b0000)]
        0x055f1400 JavaThread "Thread-19" [_thread_in_native, id=4304, stack(0x05ee0000,0x05fe0000)]
        0x055b4400 JavaThread "Thread-15" [_thread_in_native, id=4452, stack(0x05d10000,0x05e10000)]
        0x055b3c00 JavaThread "Thread-11" [_thread_in_native, id=4348, stack(0x05720000,0x05820000)]
        0x055a0000 JavaThread "Thread-7" [_thread_in_native, id=2272, stack(0x05a00000,0x05b00000)]
        0x0559f400 JavaThread "Thread-4" [_thread_in_native, id=3116, stack(0x05830000,0x05930000)]
        0x0555b800 JavaThread "com.google.common.base.internal.Finalizer" daemon [_thread_blocked, id=1828, stack(0x05b80000,0x05c80000)]
        0x00743400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3656, stack(0x05300000,0x05400000)]
        0x0073d000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4812, stack(0x050e0000,0x051e0000)]
        0x0073c800 JavaThread "Attach Listener" daemon [_thread_blocked, id=4224, stack(0x04f40000,0x05040000)]
        0x00732000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3608, stack(0x04cd0000,0x04dd0000)]
        0x006ef800 JavaThread "Finalizer" daemon [_thread_blocked, id=5016, stack(0x04ae0000,0x04be0000)]
        0x006edc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=4004, stack(0x04920000,0x04a20000)]
        0x00139c00 JavaThread "main" [_thread_blocked, id=4068, stack(0x00230000,0x00330000)]

      Other Threads:
        0x006ec400 VMThread [stack: 0x047f0000,0x048f0000] [id=5028]
        0x00744c00 WatcherThread [stack: 0x05410000,0x05510000] [id=3888]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       def new generation total 960K, used 241K [0x185c0000, 0x186c0000, 0x19970000)
        eden space 896K, 19% used [0x185c0000, 0x185ec530, 0x186a0000)
        from space 64K, 100% used [0x186b0000, 0x186c0000, 0x186c0000)
        to space 64K, 0% used [0x186a0000, 0x186a0000, 0x186b0000)
       tenured generation total 4096K, used 241K [0x19970000, 0x19d70000, 0x285c0000)
         the space 4096K, 5% used [0x19970000, 0x199ac6d0, 0x199ac800, 0x19d70000)
       compacting perm gen total 12288K, used 1251K [0x285c0000, 0x291c0000, 0x2c5c0000)
         the space 12288K, 10% used [0x285c0000, 0x286f8c68, 0x286f8e00, 0x291c0000)
          ro space 10240K, 51% used [0x2c5c0000, 0x2cadae58, 0x2cadb000, 0x2cfc0000)
          rw space 12288K, 54% used [0x2cfc0000, 0x2d63d928, 0x2d63da00, 0x2dbc0000)

      Dynamic libraries:
      0x012c0000 - 0x012e7000 c:\Users\Gili\Documents\jperipheral\trunk\cpp\build\i386\release\msvc\i386\Debug\Main.exe
      0x77ce0000 - 0x77e60000 C:\Windows\SysWOW64\ntdll.dll
      0x771f0000 - 0x772f0000 C:\Windows\syswow64\kernel32.dll
      0x77420000 - 0x77466000 C:\Windows\syswow64\KERNELBASE.dll
      0x10000000 - 0x10059000 c:\Users\Gili\Documents\jperipheral\trunk\cpp\build\i386\release\msvc\i386\Debug\jace.dll
      0x76c10000 - 0x76cb0000 C:\Windows\syswow64\ADVAPI32.dll
      0x77310000 - 0x773bc000 C:\Windows\syswow64\msvcrt.dll
      0x765d0000 - 0x765e9000 C:\Windows\SysWOW64\sechost.dll
      0x76cc0000 - 0x76db0000 C:\Windows\syswow64\RPCRT4.dll
      0x75850000 - 0x758b0000 C:\Windows\syswow64\SspiCli.dll
      0x75840000 - 0x7584c000 C:\Windows\syswow64\CRYPTBASE.dll
      0x62ef0000 - 0x62fc7000 C:\Windows\WinSxS\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_2a4cbfc25558bcd3\MSVCP90D.dll
      0x62dc0000 - 0x62ee4000 C:\Windows\WinSxS\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_2a4cbfc25558bcd3\MSVCR90D.dll
      0x62b60000 - 0x62db8000 c:\Users\Gili\Documents\jperipheral\trunk\cpp\build\i386\release\msvc\i386\Debug\JPeripheral.dll
      0x6d800000 - 0x6da98000 C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
      0x768d0000 - 0x769d0000 C:\Windows\syswow64\USER32.dll
      0x77630000 - 0x776c0000 C:\Windows\syswow64\GDI32.dll
      0x76cb0000 - 0x76cba000 C:\Windows\syswow64\LPK.dll
      0x76830000 - 0x768cd000 C:\Windows\syswow64\USP10.dll
      0x73de0000 - 0x73e12000 C:\Windows\system32\WINMM.dll
      0x7c340000 - 0x7c396000 c:\Users\Gili\Documents\jperipheral\trunk\cpp\build\i386\release\msvc\i386\Debug\MSVCR71.dll
      0x769d0000 - 0x76a30000 C:\Windows\system32\IMM32.DLL
      0x76500000 - 0x765cc000 C:\Windows\syswow64\MSCTF.dll
      0x6d7b0000 - 0x6d7bc000 C:\Program Files (x86)\Java\jre6\bin\verify.dll
      0x6d330000 - 0x6d34f000 C:\Program Files (x86)\Java\jre6\bin\java.dll
      0x6d290000 - 0x6d298000 C:\Program Files (x86)\Java\jre6\bin\hpi.dll
      0x77300000 - 0x77305000 C:\Windows\syswow64\PSAPI.DLL
      0x6d7f0000 - 0x6d7ff000 C:\Program Files (x86)\Java\jre6\bin\zip.dll

      VM Arguments:
      jvm_args: -Djava.library.path=C:/Users/Gili/Documents/jperipheral/trunk/cpp/build/i386/release/msvc/i386/debug -Xmx256M
      java_command: <unknown>
      Launcher Type: generic

      Environment Variables:
      JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
      PATH=C:\Program Files (x86)\Subversion;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;c:\util;c:\batch;C:\Program Files\apache-ant-1.7.1\bin;C:\Program Files (x86)\TextPad 5;C:\Program Files (x86)\Microsoft Visual Studio 9.0\;c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
      USERNAME=Gili
      OS=Windows_NT
      PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 15 Stepping 11, GenuineIntel



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

      OS: Windows NT 6.1 Build 7600

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

      Memory: 4k page, physical 4193464k(977912k free), swap 8385032k(4557320k free)

      vm_info: Java HotSpot(TM) Client VM (16.0-b10) for windows-x86 JRE (1.6.0_18-ea-b03), built on Oct 7 2009 10:10:54 by "java_re" with MS VC++ 7.1 (VS2003)

      time: Sun Oct 25 20:05:01 2009
      elapsed time: 2 seconds


      hs_err_pid3172.log

      Content-Type:
      text/plain
      Content-Encoding:
      7BIT

            zgu Zhengyu Gu
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: