JDK-8228772 : C2 compilation fails due to unschedulable graph if DominatorSearchLimit is reached
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: openjdk8u392,9,10,11,12,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-30
  • Updated: 2023-09-26
  • Resolved: 2019-08-13
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 13 JDK 14
11.0.6-oracleFixed 13.0.4Fixed 14 b10Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Description
#  Internal Error (/oracle/valhalla1/open/src/hotspot/share/opto/lcm.cpp:1161), pid=8321, tid=8328
#  assert(false) failed: graph should be schedulable

Current CompileTask:
C2:    691   29             Test::test2 (39 bytes)

Stack: [0x00007f48350db000,0x00007f48351dc000],  sp=0x00007f48351d6d00,  free space=1007k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x11c937e]  PhaseCFG::schedule_local(Block*, GrowableArray<int>&, VectorSet&, long*)+0xdbe
V  [libjvm.so+0xd448e8]  PhaseCFG::global_code_motion()+0xbf8
V  [libjvm.so+0xd44ff1]  PhaseCFG::do_global_code_motion()+0x51
V  [libjvm.so+0x9f8ddc]  Compile::Code_Gen()+0x24c
V  [libjvm.so+0x9fd158]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x1228
V  [libjvm.so+0x8200dd]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x10d
V  [libjvm.so+0xa096a4]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x334
V  [libjvm.so+0xa0a6f8]  CompileBroker::compiler_thread_loop()+0x4f8
V  [libjvm.so+0x18be626]  JavaThread::thread_main_inner()+0x1b6
V  [libjvm.so+0x18c3ce6]  Thread::call_run()+0xf6
V  [libjvm.so+0x149467e]  thread_native_entry(Thread*)+0x10e
Comments
Fix request (13u): The original patch applies cleanly, tested with the supplied regression test, and tier1.
26-05-2020

Fix Request (11u) This fixes up broken C2 compilation and keeps codebases in sync (I see 11.0.6-oracle). Patch applies cleanly to 11u, passes tier1, tier2. New test fails without the patch, passes with it.
03-09-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/4fbcbd248c52 User: thartmann Date: 2019-08-13 07:54:59 +0000
13-08-2019

The problem is that without LoadNode::split_through_phi, a LoadNode (5198) that is control dependent on a membar (34) is not split through it's memory phi (5194) and therefore ends up being anti-dependent because both the membar and the load use the same memory (through a MergeMem): https://bugs.openjdk.java.net/secure/attachment/83831/8228772_graph.png If PhaseCFG::insert_anti_dependences then adds a precedence edge between the membar and the load, the graph becomes unschedulable (I strengthened the asserts to detect this already during GCM). We should ignore the membar if the load is already control dependent on it: http://cr.openjdk.java.net/~thartmann/8228772/webrev.00/
31-07-2019

ILW = C2 compilation fails due to unschedulable graph (bails out in product), easy to reproduce with targeted test, disable EscapeAnalysis = MHM = P3
30-07-2019

I can reproduce this issue back until JDK 9 b156. Before that, the problem is hidden due to JDK-8172145 but it should be possible to modify the test to trigger the issue with even earlier versions.
30-07-2019