RFA: 8168996: C2 crash at postaloc.cpp:140 : assert(false) failed: unexpected yanked node

Yangfei (Felix) felix.yang at huawei.com
Fri Jan 8 06:17:15 UTC 2021


Hi,

  I am witnessing a known issue [1] when running jcstress test with 8u aarch64 fastdebug build.
  This issue can be easily reproduced during a jcstress run on my aarch64 linux server.
  Crash log looks like:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/yangfei/openjdk8u-dev/hotspot/src/share/vm/opto/postaloc.cpp:139), pid=42814, tid=0x0000ffff72e381f0
#  assert(false) failed: unexpected yanked node
#
# JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-fastdebug-yangfei_2020_12_31_10_36-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b00-fastdebug mixed mode linux-aarch64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

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

Current thread (0x0000ffff8c1c8800):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=44138, stack(0x0000ffff72c39000,0x0000ffff72e3
9000)]

Stack: [0x0000ffff72c39000,0x0000ffff72e39000],  sp=0x0000ffff72e337f0,  free space=2025k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1084458]  VMError::report_and_die()+0x328
V  [libjvm.so+0x6b91cc]  report_vm_error(char const*, int, char const*, char const*)+0x6c
V  [libjvm.so+0xe454b8]  PhaseChaitin::yank_if_dead_recurse(Node*, Node*, Block*, Node_List*, Node_List*) [clone .part.51]+0x120
V  [libjvm.so+0xe4ab7c]  PhaseChaitin::post_allocate_copy_removal()+0xcdc
V  [libjvm.so+0x503ea0]  PhaseChaitin::Register_Allocate()+0x7a0
V  [libjvm.so+0x620af8]  Compile::Code_Gen()+0x288
V  [libjvm.so+0x623968]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool)+0xd30
V  [libjvm.so+0x4c79a0]  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0xd8
V  [libjvm.so+0x630034]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x814
V  [libjvm.so+0x6313a4]  CompileBroker::compiler_thread_loop()+0x7d4
V  [libjvm.so+0xff6250]  JavaThread::thread_main_inner()+0x1f8
V  [libjvm.so+0xff6504]  JavaThread::run()+0x274
V  [libjvm.so+0xdb77a4]  java_start(Thread*)+0x104
C  [libpthread.so.0+0x7088]  start_thread+0xb0
C  [libc.so.6+0xd04ec]

  I find that JDK-8168996 is made inaccessible for the public.  So I cannot follow the normal 8u backport procedure at [2].
  Original RFR thread: https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-November/024987.html 
  Here is the original patch for JDK-8168996: 

# HG changeset patch
# User thartmann
# Date 1480403775 -3600
#      Tue Nov 29 08:16:15 2016 +0100
# Node ID 771199a0134932b6ca0d7408115abc32125998e1
# Parent  14af457890427b326d4eaee62581fd5c80559d4a
8168996: C2 crash at postaloc.cpp:140 : assert(false) failed: unexpected yanked node
Summary: Prevent MemBarAcquire from keeping a LoadNNode alive by adding it to the worklist if it is the only user of a DecodeNNode.
Reviewed-by: kvn

diff -r 14af45789042 -r 771199a01349 hotspot/src/share/vm/opto/node.cpp
--- a/hotspot/src/share/vm/opto/node.cpp        Sun Nov 27 19:58:30 2016 -0800
+++ b/hotspot/src/share/vm/opto/node.cpp        Tue Nov 29 08:16:15 2016 +0100
@@ -1117,8 +1117,8 @@
   if (this->is_Store()) {
     // Condition for back-to-back stores folding.
     return n->Opcode() == op && n->in(MemNode::Memory) == this;
-  } else if (this->is_Load()) {
-    // Condition for removing an unused LoadNode from the MemBarAcquire precedence input
+  } else if (this->is_Load() || this->is_DecodeN()) {
+    // Condition for removing an unused LoadNode or DecodeNNode from the MemBarAcquire precedence input
     return n->Opcode() == Op_MemBarAcquire;
   } else if (op == Op_AddL) {
     // Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y))

  Original patch applies cleanly to jdk8u-dev.
  Performed full jtreg test on aarch64 linux server.  Also passed jcstress test on the same platform.
  OK to backport?

[1] https://bugs.openjdk.java.net/browse/JDK-8168996  
[2] https://wiki.openjdk.java.net/display/jdk8u/Main 

Thanks,
Felix


More information about the jdk8u-dev mailing list