JDK-8227384 : C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-08
  • Updated: 2020-04-08
  • Resolved: 2019-09-27
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 14
14 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
    public static void test() throws Exception {
        Object obj = new Object();
        synchronized (obj) {
             throw new Exception();
        }
    }

#  Internal Error (/oracle/jdk_jdk/open/src/hotspot/share/opto/lcm.cpp:1160), pid=16290, tid=16301
#  assert(false) failed: graph should be schedulable

Current CompileTask:
C2:   1321  564   !b  4       Test2::test (25 bytes)

Stack: [0x00007f9f8342f000,0x00007f9f83530000],  sp=0x00007f9f8352acf0,  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+0x11732ce]  PhaseCFG::schedule_local(Block*, GrowableArray<int>&, VectorSet&, long*)+0xd3e
V  [libjvm.so+0xcfe118]  PhaseCFG::global_code_motion()+0xbf8
V  [libjvm.so+0xcfe821]  PhaseCFG::do_global_code_motion()+0x51
V  [libjvm.so+0x9c0e1e]  Compile::Code_Gen()+0x24e
V  [libjvm.so+0x9c50a4]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x1014
V  [libjvm.so+0x7feffd]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x10d
V  [libjvm.so+0x9d1790]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x310
V  [libjvm.so+0x9d27a8]  CompileBroker::compiler_thread_loop()+0x4f8
V  [libjvm.so+0x1823fd6]  JavaThread::thread_main_inner()+0x1b6
V  [libjvm.so+0x1829776]  Thread::call_run()+0xf6
V  [libjvm.so+0x142a9a6]  thread_native_entry(Thread*)+0x116

The problem was introduced in JDK 13 by the fix for JDK-8217990.
Comments
Regarding 11u: this is no longer reproducible with the fix for JDK-8228772 so backporting it doesn't seem to make much sense.
03-03-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/43c4fb8ba96b User: roland Date: 2019-09-27 11:07:15 +0000
27-09-2019

Roland, please have a look.
08-07-2019

ILW = Compilation fails due to unschedulable graph, easy to reproduce with -XX:-EliminateLocks, don't use -XX:-EliminateLocks or disable escape analysis = HLM = P3
08-07-2019