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

AArch64: in one core system, fatal error: Illegal threadstate encountered

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b146
    • CPU:
      aarch64
    • OS:
      generic

      Description

      Running tomcat on single cpu machine, it crash in SafepointSynchronize::block because thread state is _thread_in_native, expected status is _thread_in_native_trans

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (safepoint.cpp:716), pid=4329, tid=0x0000ffff89204200
      # fatal error: Illegal threadstate encountered: 4
      #
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/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 (0x0000ffff684fe000): JavaThread "localhost-startStop-1" daemon [_thread_in_native, id=4341, stack(0x0000ffff89005000,0x0000ffff89205000)]

      Stack: [0x0000ffff89005000,0x0000ffff89205000], sp=0x0000ffff89201f60, free space=2035k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x95ed3c] VMError::report_and_die()+0x130
      V [libjvm.so+0x42c04c] report_fatal(char const*, int, char const*)+0x60
      V [libjvm.so+0x85bae4] SafepointSynchronize::block(JavaThread*) [clone .part.24]+0x50
      V [libjvm.so+0x90381c] JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread*)+0x1c8
      V [libjvm.so+0x903f58] JavaThread::check_special_condition_for_native_trans(JavaThread*)+0x14
      J 236 java.util.zip.ZipFile.getEntry(J[BZ)J (0 bytes) @ 0x0000ffff7c1e64f0 [0x0000ffff7c1e63c0+0x130]
      J 1167 C1 java.util.jar.JarFile$JarEntryIterator.hasMoreElements()Z (5 bytes) @ 0x0000ffff7c4f1320 [0x0000ffff7c4f1180+0x1a0]
      J 840 C1 java.util.jar.JarFile.getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream; (89 bytes) @ 0x0000ffff7c402b54 [0x0000ffff7c402180+0x9d4]
      J 1187 C1 org.apache.tomcat.util.scan.FileUrlJar.getEntryInputStream()Ljava/io/InputStream; (21 bytes) @ 0x0000ffff7c52a640 [0x0000ffff7c52a4c0+0x180]

      thread state is not correctly maintained when compile JNI wrapper

        __ mov(rscratch1, _thread_in_native_trans);

        if(os::is_MP()) {
          if (UseMembar) {
            __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));

            // Force this write out before the read below
            __ dmb(Assembler::SY);
          } else {
            __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
            __ stlrw(rscratch1, rscratch2);

            // Write serialization page so VM thread can do a pseudo remote membar.
            // We use the current thread pointer to calculate a thread specific
            // offset to write to within the page. This minimizes bus traffic
            // due to cache line collision.
            __ serialize_memory(rthread, r2);
          }
        }

        Activity

        Hide
        dholmes David Holmes added a comment -
        Error in ./cpu/aarch64/vm/sharedRuntime_aarch64.cpp. The store should be outside the "if is_MP()" check - as per ./cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
        Show
        dholmes David Holmes added a comment - Error in ./cpu/aarch64/vm/sharedRuntime_aarch64.cpp. The store should be outside the "if is_MP()" check - as per ./cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/f5c44b9b4ff9
        User: fyang
        Date: 2016-10-19 05:18:37 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/f5c44b9b4ff9 User: fyang Date: 2016-10-19 05:18:37 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f5c44b9b4ff9
        User: lana
        Date: 2016-11-22 22:03:30 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f5c44b9b4ff9 User: lana Date: 2016-11-22 22:03:30 +0000

          People

          • Assignee:
            hshi Hui Shi
            Reporter:
            hshi Hui Shi
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: