[aarch64-port-dev ] RFR(XS): 8167421: AArch64: in one core system, fatal error: Illegal threadstate encountered

David Holmes david.holmes at oracle.com
Sun Oct 16 20:50:12 UTC 2016


On 15/10/2016 8:34 PM, Hui Shi wrote:
> Hi all,
>
> Could someone help review this fix?
>
> JIRA: https://bugs.openjdk.java.net/browse/JDK-8167421
> webrev: http://cr.openjdk.java.net/~hshi/8167421/webrev/
>
> JVM crashes with illegal threadstate when running on single core machine
> (for example with single core VM running on aarch64 box).
> Current JNI wrapper generator missing store _thread_in_native_trans into
> thread state when machine has only one CPU core.

Fix seems okay - though I'm not expert on aarch64 assembler. But I have 
to wonder why this chunk of code is different to the functionally 
equivalent code in templateInterpreterGenerator_aarch64.cpp - including 
the difference between using DSB and DMB for the barrier?

  // change thread state
   __ mov(rscratch1, _thread_in_native_trans);
   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
   __ stlrw(rscratch1, rscratch2);

   if (os::is_MP()) {
     if (UseMembar) {
       // Force this write out before the read below
       __ dsb(Assembler::SY);
     } else {
       // 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, rscratch2);
     }
   }

David

> #
> # 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]
>
> Regards
> Hui
>


More information about the aarch64-port-dev mailing list