JDK-8280696 : C2 compilation hits assert(is_dominator(c, n_ctrl)) failed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18,19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-26
  • Updated: 2022-06-21
  • Resolved: 2022-05-19
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 19
17.0.5-oracleFixed 19 b24Fixed
Related Reports
Relates :  
Relates :  
Description
applications/ctw/jars/CtwOfLucene.java triggers the following assert:

#  Internal Error (/workspace/open/src/hotspot/share/opto/loopopts.cpp:1628), pid=66675, tid=23299
#  Error: assert(is_dominator(c, n_ctrl)) failed

Current CompileTask:
C2:   1705  542 % !b        java.io.BufferedReader::readLine @ 139 (327 bytes)

Stack: [0x000000016d53c000,0x000000016d73f000],  sp=0x000000016d739690,  free space=2037k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0xfb2340]  VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x5d8
V  [libjvm.dylib+0xfb2a08]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40
V  [libjvm.dylib+0x517994]  report_vm_error(char const*, int, char const*, char const*, ...)+0x80
V  [libjvm.dylib+0xb75cec]  PhaseIdealLoop::compute_early_ctrl(Node*, Node*)+0x1fc
V  [libjvm.dylib+0xb74b00]  PhaseIdealLoop::try_sink_out_of_loop(Node*)+0x41c
V  [libjvm.dylib+0xb73e78]  PhaseIdealLoop::split_if_with_blocks_post(Node*)+0x698
V  [libjvm.dylib+0xb76570]  PhaseIdealLoop::split_if_with_blocks(VectorSet&, Node_Stack&)+0x214
V  [libjvm.dylib+0xb61bd8]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x9a4
V  [libjvm.dylib+0x4d5a98]  PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, LoopOptsMode)+0xf0
V  [libjvm.dylib+0x4c9838]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x7c
V  [libjvm.dylib+0x4c9b8c]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xd0
V  [libjvm.dylib+0x4c4114]  Compile::Optimize()+0xfb4
V  [libjvm.dylib+0x4c2028]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x12f4
V  [libjvm.dylib+0x3cbe34]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x134
V  [libjvm.dylib+0x4dc960]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x604
V  [libjvm.dylib+0x4dc15c]  CompileBroker::compiler_thread_loop()+0x2c0
V  [libjvm.dylib+0xf164bc]  JavaThread::thread_main_inner()+0x284
V  [libjvm.dylib+0xf13894]  Thread::call_run()+0x21c
V  [libjvm.dylib+0xce8b04]  thread_native_entry(Thread*)+0x160
C  [libsystem_pthread.dylib+0x74ec]  _pthread_start+0x94
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk18u/pull/161 Date: 2022-06-21 07:40:42 +0000
21-06-2022

Fix Request (JDK 18u) Fixes an assert in C2. The fix is low risk and applies cleanly. Already tested and backported to Oracle JDK 17u.
21-06-2022

Changeset: fa1b56ed Author: Tobias Hartmann <thartmann@openjdk.org> Date: 2022-05-19 14:52:54 +0000 URL: https://git.openjdk.java.net/jdk/commit/fa1b56ede6eed653f70efbbfff3af5ee6b481ee4
19-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8770 Date: 2022-05-18 14:34:58 +0000
18-05-2022

Thanks [~epavlova], I can reproduce this with replay compilation (attached replay_pid30846.log) and latest JDK 19-ea+23-1651: java -XX:+ReplayIgnoreInitErrors -XX:+ReplayCompiles -XX:ReplayDataFile=replay_pid30846.log -XX:+UnlockExperimentalVMOptions -XX:+StressIGVN -XX:StressSeed=132118749
16-05-2022

Could be related to JDK-8286625 or JDK-8278420.
16-05-2022

Hi Tobias, I got the same crash while running microbenchmarks based tests using latest jdk19 bits: # Internal Error (/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14622/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/ executors/68f9fb7c-e585-49eb-b345-02046aded32a/runs/38cf37e0-603c-49fa-ae47-1be0e55e0ae6/workspace/open/src/hotspot/share/opto/loopopts.cpp:1728), pi d=30846, tid=30861 # Error: assert(is_dominator(c, n_ctrl)) failed # # JRE version: Java(TM) SE Runtime Environment (19.0) (fastdebug build 19-internal-2022-05-13-0428371.ekaterina.pavlova.jdk.jdk.master) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-internal-2022-05-13-0428371.ekaterina.pavlova.jdk.jdk.master, mixed mode, sharing, compres sed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1493264] PhaseIdealLoop::compute_early_ctrl(Node*, Node*)+0x264 # --------------- T H R E A D --------------- Current thread (0x00007fce30484f70): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=30861, stack(0x00007fce10e9c000,0x00007fce10f9d00 0)] Current CompileTask: C2: 1505 469 % java.io.BufferedReader::implReadLine @ 125 (302 bytes) Stack: [0x00007fce10e9c000,0x00007fce10f9d000], sp=0x00007fce10f96d10, free space=1003k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1493264] PhaseIdealLoop::compute_early_ctrl(Node*, Node*)+0x264 V [libjvm.so+0x1494041] PhaseIdealLoop::try_sink_out_of_loop(Node*)+0x171 V [libjvm.so+0x1494a78] PhaseIdealLoop::split_if_with_blocks_post(Node*)+0x58 V [libjvm.so+0x1495689] PhaseIdealLoop::split_if_with_blocks(VectorSet&, Node_Stack&)+0x209 V [libjvm.so+0x14874bd] PhaseIdealLoop::build_and_optimize()+0x132d V [libjvm.so+0xad4d1a] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x27a V [libjvm.so+0xad148e] Compile::Optimize()+0x103e V [libjvm.so+0xad36d0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1590 V [libjvm.so+0x8e83c3] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x683 V [libjvm.so+0xae2570] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xce0 V [libjvm.so+0xae3498] CompileBroker::compiler_thread_loop()+0x6c8 V [libjvm.so+0x1a5a0ca] JavaThread::thread_main_inner()+0x21a V [libjvm.so+0x1a67a10] Thread::call_run()+0x100 V [libjvm.so+0x17127e4] thread_native_entry(Thread*)+0x104 The test which crashed is org.openjdk.bench.java.util.stream.ops.value.AllMatch.par_chain123$, it was run as > jdk19/bin/java $JVM_FLAGS -cp build/linux-x64/images/test/micro/benchmarks.jar org.openjdk.jmh.Main -f 1 org.openjdk.bench.java.util.stream.ops.value.AllMatch.par_chain123$ The JVM_FLAGS flags the test was crashed were: 1) -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-UseCompressedOops -server -XX:-TieredCompilation -XX:+StressIGVN -XX:+StressGCM -XX:+StressLCM 2) -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:+VerifyOops -server -XX:-TieredCompilation -XX:+StressIGVN -XX:+StressGCM -XX:+StressLCM So far I was able to reproduce the crash by running the test 10,000 times and the crash happened only 2 times. Perhaps not all jvm flags are important. I can try to reproduce with reduced amount of flags.
13-05-2022

Not able to reproduce. Closing.
22-04-2022

Might have been fixed by JDK-8280600. Trying to reproduce.
21-04-2022

ILW = C2 assertion when sinking a node, rare, disable compilation of affected method = HLM = P3
26-01-2022