JDK-8271272 : C2: assert(!had_error) failed: bad dominance
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-07-26
  • Updated: 2022-01-11
  • Resolved: 2021-07-30
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 b34Fixed 18Fixed
Related Reports
Relates :  
Relates :  
Description
The attached Java Fuzzer test starts to fail after JDK-8269746 with the following assertion:

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-S79182/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/61fcc7a7-729c-4122-bd17-8b2b15316607/runs/5aa598ae-f0b4-46a1-a038-f527f0e2d1f0/workspace/open/src/hotspot/share/opto/loopnode.cpp:4910), pid=4924, tid=4938
#  assert(!had_error) failed: bad dominance
#
# JRE version: Java(TM) SE Runtime Environment (17.0+32) (fastdebug build 17-ea+32-LTS-2679)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+32-LTS-2679, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1320e82]  PhaseIdealLoop::compute_lca_of_uses(Node*, Node*, bool)+0x6e2
#
............
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
............
Current thread (0x00007f19484810d0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=4938, stack(0x00007f19380fe000,0x00007f19381ff000)]


Current CompileTask:
C2:    274    4    b        Test::vMeth (185 bytes)

Stack: [0x00007f19380fe000,0x00007f19381ff000],  sp=0x00007f19381f9180,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1320e82]  PhaseIdealLoop::compute_lca_of_uses(Node*, Node*, bool)+0x6e2
V  [libjvm.so+0x1321230]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x1d0
V  [libjvm.so+0x132180a]  PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0xba
V  [libjvm.so+0x1322177]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x507
V  [libjvm.so+0xa37c70]  PhaseIdealLoop::verify(PhaseIterGVN&)+0x2f0
V  [libjvm.so+0xa27fff]  Compile::process_for_post_loop_opts_igvn(PhaseIterGVN&)+0x1f
V  [libjvm.so+0xa33a7e]  Compile::Optimize()+0x163e
V  [libjvm.so+0xa354b8]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1618
V  [libjvm.so+0x84aca6]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x646
V  [libjvm.so+0xa45541]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb71
V  [libjvm.so+0xa461e8]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18da771]  JavaThread::thread_main_inner()+0x271
V  [libjvm.so+0x18e1ce0]  Thread::call_run()+0x100
V  [libjvm.so+0x15a8054]  thread_native_entry(Thread*)+0x104
Comments
Changeset: e351de3b Author: Roland Westrelin <roland@openjdk.org> Date: 2021-07-30 07:28:04 +0000 URL: https://git.openjdk.java.net/jdk17/commit/e351de3bd67773109607db7f4648c173140cb024
30-07-2021

Fix request for JDK 17 is approved.
29-07-2021

Fix request: the fix for this addresses a c2 crash due to code that was new in jdk 17 so is important to get fixed. The fix is an improvement of a previous fix JDK-8269752 so that it applies to loop strip mining. The change is minimal so I think the risk is fairly low. I ran my own testing and Tobias ran testing as well. Fix was reviewed by Vladimir K, Tobias and Christian.
29-07-2021

[~roland] can you have a look at it?
26-07-2021

ILW = C2 assertion failure (recent regression in JDK 17 b31), only with single Java Fuzzer test, disable compilation of affected method = HMM = P2
26-07-2021