JDK-8264649 : runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-04-02
  • Updated: 2021-07-01
  • Resolved: 2021-04-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b18Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/data/shihui/codes/shihui_jdk_master/jdk/src/hotspot/share/opto/compile.cpp:2376), pid=5319, tid=5335
#  fatal error: no reachable node should have no use


Current CompileTask:
C2:   1108  587 %     4       ThreadCpuTimesDeadlock$1::run @ 0 (11 bytes)

Stack: [0x00002ab8df703000,0x00002ab8df804000],  sp=0x00002ab8df7ff2f0,  free space=1008k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x9383b0]  Compile::check_no_dead_use() const+0x370
V  [libjvm.so+0x947969]  Compile::Optimize()+0x11c9
V  [libjvm.so+0x948d40]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1320
V  [libjvm.so+0x7ac566]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x116
V  [libjvm.so+0x956fb6]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc56
V  [libjvm.so+0x957aa8]  CompileBroker::compiler_thread_loop()+0x438
V  [libjvm.so+0x17bd153]  JavaThread::thread_main_inner()+0x283
V  [libjvm.so+0x17bd4e1]  JavaThread::run()+0x2e1
V  [libjvm.so+0x17c2638]  Thread::call_run()+0xf8
V  [libjvm.so+0x13a5816]  thread_native_entry(Thread*)+0x116
Comments
Changeset: 42f4d706 Author: Hui Shi <hshi@openjdk.org> Committer: Jie Fu <jiefu@openjdk.org> Date: 2021-04-10 00:03:57 +0000 URL: https://git.openjdk.java.net/jdk/commit/42f4d706
10-04-2021

Assert was added by JDK-8263577. ILW = Assert during C2 compilation (harmless in product), reproducible with single test, no workaround = MMH = P3
07-04-2021

This is the last IGVN in optimization, Node6 has no chance to get removed later. Proposed fix is checking if object has no output after subsume_node. If no use for nn, add nn into worklist. diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 7a23f6c7b74..43321be69b6 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -1481,6 +1481,9 @@ void PhaseIterGVN::subsume_node( Node *old, Node *nn ) { temp->init_req(0,nn); // Add a use to nn to prevent him from dying remove_dead_node( old ); temp->del_req(0); // Yank bogus edge + if (nn->outcnt() == 0) { + _worklist.push(nn); + } #ifndef PRODUCT if( VerifyIterativeGVN ) { for ( int i = 0; i < _verify_window_size; i++ ) {
02-04-2021

Run with a simplified case IO parm has no use in ThreadCpuTimesDeadlock$1::run after optimization and trigger fatal 3 StartOSR === 3 0 [[ 3 5 6 7 8 9 10 ]] #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address, 5:rawptr:BotPTR} 6 Parm === 3 [[]] I_O !orig=[73] !jvms: ThreadCpuTimesDeadlock$1::run @ bci:0 (line 66) The Node 6's last output is removed in PhaseIterGVN::subsume_node, subsume old node 113 with node 6. 113 Phi === 323 6 113 [[ 113 ]] #abIO !jvms: Test$1::run @ bci:0 (line 7) // only has one use to self 6 Parm === 3 [[ 113 ]] I_O !orig=[73] !jvms: Test$1::run @ bci:0 (line 7) After subsume_node, Node 113 is dead, node 6 has no use but not get removed. #0 Node::del_out (this=0x7fffb8077298, n=0x7fffb8092760) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/node.hpp:495 #1 0x00007ffffd422ea8 in Node::del_req (this=0x7fffb8092760, idx=0) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/node.cpp:824 #2 0x00007ffffd4d2dc6 in PhaseIterGVN::subsume_node (this=0x7fffda65c600, old=0x7fffb807c808, nn=0x7fffb8077298) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/phaseX.cpp:1483 #3 0x00007ffffd4d21b1 in PhaseIterGVN::transform_old (this=0x7fffda65c600, n=0x7fffb807c808) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/phaseX.cpp:1322 #4 0x00007ffffd4d1b0f in PhaseIterGVN::optimize (this=0x7fffda65c600) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/phaseX.cpp:1199 #5 0x00007ffffd2f4b86 in PhaseMacroExpand::expand_macro_nodes (this=0x7fffda65c580) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/macro.cpp:2736 #6 0x00007ffffcc94661 in Compile::Optimize (this=0x7fffda65eb80) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/compile.cpp:2314 #7 0x00007ffffcc8d4da in Compile::Compile (this=0x7fffda65eb80, ci_env=0x7fffda65f870, target=0x7ffff84e0f80, osr_bci=0, subsume_loads=true, do_escape_analysis=true, eliminate_boxing=true, install_code=true, directive=0x7ffff8252090) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/compile.cpp:786 #8 0x00007ffffcb7c4f8 in C2Compiler::compile_method (this=0x7ffff82f77f0, env=0x7fffda65f870, target=0x7ffff84e0f80, entry_bci=0, install_code=true, directive=0x7ffff8252090) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/opto/c2compiler.cpp:103 #9 0x00007ffffccaa39b in CompileBroker::invoke_compiler_on_method (task=0x7fff9c000ec0) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/compiler/compileBroker.cpp:2310 #10 0x00007ffffcca8fbf in CompileBroker::compiler_thread_loop () at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/compiler/compileBroker.cpp:1983 #11 0x00007ffffcccbc4f in CompilerThread::thread_entry (thread=0x7ffff8376f10, __the_thread__=0x7ffff8376f10) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/compiler/compilerThread.cpp:59 #12 0x00007ffffd72aedb in JavaThread::thread_main_inner (this=0x7ffff8376f10) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/runtime/thread.cpp:1463 #13 0x00007ffffd72ad84 in JavaThread::run (this=0x7ffff8376f10) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/runtime/thread.cpp:1446 #14 0x00007ffffd728386 in Thread::call_run (this=0x7ffff8376f10) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/share/runtime/thread.cpp:408 #15 0x00007ffffd474834 in thread_native_entry (thread=0x7ffff8376f10) at /mnt/d/codes/jdks/shihui-jdk-master/src/hotspot/os/linux/os_linux.cpp:714 #16 0x00007ffffe7976db in start_thread (arg=0x7fffda660700) at pthread_create.c:463 #17 0x00007ffffef0188f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
02-04-2021