JDK-8269746 : C2: assert(!in->is_CFG()) failed: CFG Node with no controlling input?
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-07-01
  • Updated: 2021-08-10
  • Resolved: 2021-07-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 b31Fixed 18Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The attached Java Fuzzer test starts to fail after JDK-8264649 (but seems to just reveal an existing issue) with the following assertion failure:

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/35546316-ed70-4084-8244-d672e7734fd1-S57035/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/41fc080c-d2db-43a6-87b0-daa1149175bc/runs/ea6bcc43-d159-4998-ab37-df1970ab9b47/workspace/open/src/hotspot/share/opto/loopnode.cpp:4763), pid=18026, tid=18040
#  assert(!in->is_CFG()) failed: CFG Node with no controlling input?
#
# JRE version: Java(TM) SE Runtime Environment (17.0+28) (fastdebug build 17-ea+28-LTS-2534)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+28-LTS-2534, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x12fef24]  PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x6d4
............
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
............
Current thread (0x00007fd65047fc40):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=18040, stack(0x00007fd6443cb000,0x00007fd6444cc000)]


Current CompileTask:
C2:    309    8 %  b        Test::mainTest @ 229 (669 bytes)

Stack: [0x00007fd6443cb000,0x00007fd6444cc000],  sp=0x00007fd6444c6320,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x12fef24]  PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x6d4
V  [libjvm.so+0x130841a]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x49a
V  [libjvm.so+0xa2b300]  PhaseIdealLoop::verify(PhaseIterGVN&)+0x2f0
V  [libjvm.so+0xa261a8]  Compile::Optimize()+0x6d8
V  [libjvm.so+0xa28b48]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1618
V  [libjvm.so+0x849aa6]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x646
V  [libjvm.so+0xa397a9]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xfb9
V  [libjvm.so+0xa3a518]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18b8251]  JavaThread::thread_main_inner()+0x271
V  [libjvm.so+0x18bff70]  Thread::call_run()+0x100
V  [libjvm.so+0x158c7c4]  thread_native_entry(Thread*)+0x104


Comments
Changeset: 8f798b82 Author: Roland Westrelin <roland@openjdk.org> Date: 2021-07-08 07:25:21 +0000 URL: https://git.openjdk.java.net/jdk17/commit/8f798b822235e3bdbaf7a94caaae400de3753a25
08-07-2021

Re-assigning to me to help Roland. The test attached to this bug do not reproduce the failure anymore after JDK-8262017 but the test provided by [~shade] with JDK-8269797 still does.
05-07-2021

I am seeing a similar assert failure in a fuzzer test, this time in normal, non-OSR compilation, and bisection points to another changeset: JDK-8269797. They still might be related. Linking up.
02-07-2021

ILW = C2 assertion failure, only fails with single Java Fuzzer test, disable compilation of affected method = HLM = P3
01-07-2021