JDK-8262017 : C2: assert(n != __null) failed: Bad immediate dominator info.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-19
  • Updated: 2022-04-29
  • Resolved: 2021-07-02
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 11 JDK 17 JDK 18
11.0.13-oracleFixed 17 b30Fixed 18Fixed
Related Reports
Relates :  
Relates :  
Description
The attached fuzzer test fails with the following assertion:

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

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/0f76e7b4-d512-4e9f-a839-a1d961774dea-S25478/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/60e94edb-f7fc-4e5a-a4e6-8c5edee7d585/runs/23c637d1-6b4a-4721-8ba9-95c2854c397f/workspace/open/src/hotspot/share/opto/loopnode.hpp:1091), pid=18562, tid=18576
#  assert(n != __null) failed: Bad immediate dominator info.
#
# JRE version: Java(TM) SE Runtime Environment (17.0+10) (fastdebug build 17-ea+10-LTS-723)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+10-LTS-723, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x12d0d8b]  PhaseIdealLoop::idom_no_update(unsigned int) const+0x16b
...........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
...........
Current CompileTask:
C2:    313   10 % !b        Test::mainTest @ 119 (698 bytes)

Stack: [0x00007f22f64f8000,0x00007f22f65f9000],  sp=0x00007f22f65f2da0,  free space=1003k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x12d0d8b]  PhaseIdealLoop::idom_no_update(unsigned int) const+0x16b
V  [libjvm.so+0x12dd201]  PhaseIdealLoop::clone_loop_handle_data_uses(Node*, Node_List&, IdealLoopTree*, IdealLoopTree*, Node_List*&, Node_List*&, Node_List*&, Node_List&, unsigned int, PhaseIdealLoop::CloneLoopMode)+0x581
V  [libjvm.so+0x12debbf]  PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, PhaseIdealLoop::CloneLoopMode, Node*)+0x124f
V  [libjvm.so+0x12a6ddf]  PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&, int, PhaseIdealLoop::CloneLoopMode)+0xc3f
V  [libjvm.so+0x12a8df2]  PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&)+0x172
V  [libjvm.so+0x12a162e]  IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&) [clone .part.0]+0x4ce
V  [libjvm.so+0x12a1bbb]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x13b
V  [libjvm.so+0x12a1ab5]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x35
V  [libjvm.so+0x12cec78]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xca8
V  [libjvm.so+0xa0ee9b]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x32b
V  [libjvm.so+0xa0c003]  Compile::Optimize()+0x14c3
V  [libjvm.so+0xa0de45]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1905
V  [libjvm.so+0x83a02a]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
V  [libjvm.so+0xa1dd11]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xea1
V  [libjvm.so+0xa1e998]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x1840bf6]  JavaThread::thread_main_inner()+0x256
V  [libjvm.so+0x1847070]  Thread::call_run()+0x100
V  [libjvm.so+0x1533406]  thread_native_entry(Thread*)+0x116
Comments
Fix Request (11u): Should get backported for parity with 11.0.13-oracle. Doesn't apply cleanly. Review: https://github.com/openjdk/jdk11u-dev/pull/156
26-07-2021

Changeset: 2db9005c Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-07-02 07:43:57 +0000 URL: https://git.openjdk.java.net/jdk17/commit/2db9005c07585b580b3ec0889b8b5e3ed0d0ca6a
02-07-2021

Test2.java seems to be a different issue from Test.java even though it results in the same assertion failure. It also fails with JDK 14 which Test.java does not. Will open a new bug for it.
04-06-2021

I will asiign myself and start analyzing it.
26-02-2021

The crash has started with the fix of JDK-8250607 The fix itself looks right. From [~chagedorn] "We have more accurate type information available which probably allows some further optimization which trigger an existing bug I think the change in JDK-8250607 for itself is correct" I will analyze more...
23-02-2021

I've attached another test (Test2.java) that also triggers this.
22-02-2021