JDK-8259641 : C2: assert(early->dominates(LCA)) failed: early is high enough
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-01-12
  • Updated: 2021-01-28
  • Resolved: 2021-01-18
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 16 JDK 17
16 b33Fixed 17Fixed
Related Reports
Relates :  
Description
The attached fuzzer test fails with the following assertion after JDK-8258393:

To reproduce:
# Original fuzzer test (see hs_err_pid17768.log)
java -Xcomp -XX:CompileOnly=Test Test.java
# Reduced fuzzer test with creduce
java -Xcomp -XX:CompileOnly=Reduced Reduced.java

A similar related assertion can be triggered with different arguments (see hs_err_pid17793.log).

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/983c483a-6907-44e0-ad29-98c7183575e2-S77107/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d0fa3a1e-22e6-4f7b-a7af-ce8e76864598/runs/55975061-d779-455a-b505-c235c4463732/workspace/open/src/hotspot/share/opto/gcm.cpp:473), pid=17768, tid=17781
#  assert(early->dominates(LCA)) failed: early is high enough
#
# JRE version: Java(TM) SE Runtime Environment (16.0+31) (fastdebug build 16-ea+31-2150)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+31-2150, compiled mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xd139a9]  PhaseCFG::insert_anti_dependences(Block*, Node*, bool)+0x1cb9
..........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
..........
Current CompileTask:
C2:   1064   14    b  4       Test::mainTest (624 bytes)

Stack: [0x00007f40f60f8000,0x00007f40f61f9000],  sp=0x00007f40f61f3b30,  free space=1006k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xd139a9]  PhaseCFG::insert_anti_dependences(Block*, Node*, bool)+0x1cb9
V  [libjvm.so+0xd19f90]  PhaseCFG::schedule_late(VectorSet&, Node_Stack&)+0xc00
V  [libjvm.so+0xd1a6e9]  PhaseCFG::global_code_motion()+0x339
V  [libjvm.so+0xd1e6c1]  PhaseCFG::do_global_code_motion()+0x51
V  [libjvm.so+0xa0ea10]  Compile::Code_Gen()+0x290
V  [libjvm.so+0xa19ad7]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1917
V  [libjvm.so+0x849d8c]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1dc
V  [libjvm.so+0xa29808]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xe88
V  [libjvm.so+0xa2a458]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18bb4f6]  JavaThread::thread_main_inner()+0x256
V  [libjvm.so+0x18c1e70]  Thread::call_run()+0x100
V  [libjvm.so+0x15a3f66]  thread_native_entry(Thread*)+0x116
Comments
verified w/ hotspot/jtreg/compiler/loopopts/TestBrokenAntiDependenceWithPhi.java
28-01-2021

Changeset: d5ca3b3f Author: Roland Westrelin <roland@openjdk.org> Date: 2021-01-18 07:54:48 +0000 URL: https://git.openjdk.java.net/jdk16/commit/d5ca3b3f
18-01-2021

Fix request approved.
16-01-2021

Fix Request: This bug causes a crash in c2 and is a regression that was introduced since jdk 15. Risk of the fix is low: makes the code more conservative. Tested with the test case that was attached to the bug, jtreg hotspot tests, some CTW testing. Reviewed by Christian and Tobias.
15-01-2021

ILW = Assert during C2 compilation (regression in JDK 16), reproducible with JavaFuzzer generated test, no workaround but disable C2 compilation = HMM = P2
12-01-2021