JDK-8271056 : C2: "assert(no_dead_loop) failed: dead loop detected" due to cmoving identity
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-07-21
  • Updated: 2022-02-03
  • Resolved: 2021-11-08
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 JDK 18
17.0.3-oracleFixed 18 b30Fixed
Related Reports
Relates :  
Description
The attached Java Fuzzer test crashes with the following assertion which seems to be unrelated to JDK-8268019:

To reproduce:
$ java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test Test.java
$ java-Xcomp -XX:-TieredCompilation -XX:CompileOnly=Reduced Reduced.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S124123/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/57294efe-464f-4c0a-b55a-fd67bfa32e7b/runs/71c23d41-87fd-4de4-92b5-4ba130c3e1dd/workspace/open/src/hotspot/share/opto/phaseX.cpp:945), pid=295183, tid=295196
#  assert(no_dead_loop) failed: dead loop detected
#
# JRE version: Java(TM) SE Runtime Environment (18.0+7) (fastdebug build 18-ea+7-268)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+7-268, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x15c93f6]  PhaseGVN::dead_loop_check(Node*) [clone .part.0]+0x156
............
Command Line: -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
............
Current thread (0x00007ffa981da920):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=295196, stack(0x00007ffa74a64000,0x00007ffa74b65000)]


Current CompileTask:
C2:   3295   88    b        Test::lMeth (390 bytes)

Stack: [0x00007ffa74a64000,0x00007ffa74b65000],  sp=0x00007ffa74b603e0,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x15c93f6]  PhaseGVN::dead_loop_check(Node*) [clone .part.0]+0x156
V  [libjvm.so+0x15d67f9]  PhaseIterGVN::transform_old(Node*)+0x4f9
V  [libjvm.so+0x15cfcbe]  PhaseIterGVN::optimize()+0x7e
V  [libjvm.so+0x9f7269]  Compile::Optimize()+0x1b9
V  [libjvm.so+0x9f9ff4]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1564
V  [libjvm.so+0x81a076]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x646
V  [libjvm.so+0xa0aab9]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xef9
V  [libjvm.so+0xa0b7e8]  CompileBroker::compiler_thread_loop()+0x598
V  [libjvm.so+0x186829c]  JavaThread::thread_main_inner()+0x27c
V  [libjvm.so+0x186eb90]  Thread::call_run()+0x100
V  [libjvm.so+0x1551464]  thread_native_entry(Thread*)+0x104
Comments
Fix request [17u] I backport this for parity with 17.0.3-oracle. Small risk, simple change. Clean backport. Test passes. SAP nightly testing passed.
01-02-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/136 Date: 2022-01-31 13:09:45 +0000
31-01-2022

Changeset: 54481394 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-11-08 12:47:58 +0000 URL: https://git.openjdk.java.net/jdk/commit/54481394a3b7d36b2326e22e4aa910a3e8041b5c
08-11-2021

Test2.java seems to be the same root cause while JDK-8275326 seems to be unrelated.
29-10-2021

Another failure was found with JDK-8275326. That test should also be verified before integration.
15-10-2021

Attached another test (Test2.java) found by fuzzing which might be the same issue. If not, a separate bug should be filed. To reproduce: $ java -XX:-TieredCompilation -Xcomp -XX:CompileOnly=Test2 Test2.java
23-07-2021

ILW = C2 assertion during IGVN, only fails intermittently with single Java Fuzzer test, disable compilation of affected method = HLM = P3
21-07-2021