JDK-8207355 : C1 compilation hangs in ComputeLinearScanOrder::compute_dominator
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10,11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-07-16
  • Updated: 2019-09-13
  • Resolved: 2018-08-06
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 12
11 b26Fixed 12Fixed
Related Reports
Relates :  
Relates :  
Description
The following JCK tests fail with -Xcomp due to hangs in C1:

lang/STMT/stmt330/stmt33001mi01/stmt33001mi01_rt.html
lang/STMT/stmt330/stmt33001mi0111/stmt33001mi0111_rt.html
lang/STMT/stmt330/stmt33001mi012/stmt33001mi012_rt.html
lang/STMT/stmt330/stmt33002m0/stmt33002m0_rt.html
lang/STMT/stmt330/stmt33002m011/stmt33002m011_rt.html
lang/STMT/stmt330/stmt33002m02/stmt33002m02_rt.html
lang/STMT/stmt330/stmt33002m1/stmt33002m1_rt.html
lang/STMT/stmt330/stmt33002m111/stmt33002m111_rt.html
lang/STMT/stmt330/stmt33002m12/stmt33002m12_rt.html
lang/STMT/stmt330/stmt33002m2/stmt33002m2_rt.html
lang/STMT/stmt330/stmt33002m211/stmt33002m211_rt.html
lang/STMT/stmt330/stmt33002m22/stmt33002m22_rt.html
lang/STMT/stmt330/stmt33002m3/stmt33002m3_rt.html
lang/STMT/stmt330/stmt33002m311/stmt33002m311_rt.html
lang/STMT/stmt330/stmt33002m32/stmt33002m32_rt.html
lang/STMT/stmt330/stmt33011m3221/stmt33011m3221_rt.html
Comments
Product tested: JDK 11b26 vs JCK 11b12 TestSuite: JCK-runtime OS: Linux x64 Tests Passed: lang/STMT/stmt330/stmt33001mi01/stmt33001mi01_rt.html lang/STMT/stmt330/stmt33001mi0111/stmt33001mi0111_rt.html lang/STMT/stmt330/stmt33001mi012/stmt33001mi012_rt.html lang/STMT/stmt330/stmt33002m0/stmt33002m0_rt.html lang/STMT/stmt330/stmt33002m011/stmt33002m011_rt.html lang/STMT/stmt330/stmt33002m02/stmt33002m02_rt.html lang/STMT/stmt330/stmt33002m1/stmt33002m1_rt.html lang/STMT/stmt330/stmt33002m111/stmt33002m111_rt.html lang/STMT/stmt330/stmt33002m12/stmt33002m12_rt.html lang/STMT/stmt330/stmt33002m2/stmt33002m2_rt.html lang/STMT/stmt330/stmt33002m211/stmt33002m211_rt.html lang/STMT/stmt330/stmt33002m22/stmt33002m22_rt.html lang/STMT/stmt330/stmt33002m3/stmt33002m3_rt.html lang/STMT/stmt330/stmt33002m311/stmt33002m311_rt.html lang/STMT/stmt330/stmt33002m32/stmt33002m32_rt.html lang/STMT/stmt330/stmt33011m3221/stmt33011m3221_rt.html
17-08-2018

Fix request approved.
03-08-2018

Fix request: ---------------- It's important to fix this bug because after the javac changes that have been integrated with JDK-8194978, it's much more likely that C1 will encounter the specific code shape that triggers hangs during compilation. The fix is low risk because we only bail out from a useless recursion during dominator computation. The fix includes a regression test: http://cr.openjdk.java.net/~thartmann/8207355/webrev.00/ Reviewed by [~kvn] (waiting for another review). Tested with hs-tier1/2/3, jdk-tier1/2/3 and hs-precheckin-comp. I've also verified that there is no performance impact with -XX:TieredStopAtLevel=1.
03-08-2018

[~iignatyev], yes, I'll create a regression test for this.
02-08-2018

[~thartmann], do you think it'd be possible to create a regression test? maybe using .jasm file based on a test, so we won't depend on changes in javac.
27-07-2018

Quick prototype fix: http://cr.openjdk.java.net/~thartmann/8207355/webrev.00/
27-07-2018

This bug is triggered by the javac changes for JDK-8194978 in JDK 11 b07. However, using the class file compiled with JDK 11 b07 (-source 9 -target 9), I can reproduce the problem even in JDK 9. I'll therefore add the corresponding affects version.
26-07-2018

ILW = C1 hangs in register allocator during compilation, easy to reproduce with specific test but never showed up in user code, exclude method from compilation = HMM = P2
26-07-2018

C1 gets stuck in an endless loop in the register allocator: #0 0x00007ffff566fbd4 in ComputeLinearScanOrder::common_dominator (this=this@entry=0x7fffcaba00d0, a=0x7fffac2d6b80, b=b@entry=0x7fffac2d6b80) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:754 #1 0x00007ffff566ffcc in ComputeLinearScanOrder::compute_dominator (this=this@entry=0x7fffcaba00d0, cur=0x7ffff0c90490, parent=parent@entry=0x7fffac2d6b80) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:781 [...] #21 0x00007ffff5670031 in ComputeLinearScanOrder::compute_dominator (this=this@entry=0x7fffcaba00d0, cur=cur@entry=0x7ffff0e086b0, parent=parent@entry=0x7fffac2d6b80) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:791 #22 0x00007ffff567441f in ComputeLinearScanOrder::compute_order (this=this@entry=0x7fffcaba00d0, start_block=start_block@entry=0x7fffac2d6b80) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:924 #23 0x00007ffff5675a2d in ComputeLinearScanOrder::ComputeLinearScanOrder (this=this@entry=0x7fffcaba00d0, c=<optimized out>, start_block=0x7fffac2d6b80) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:558 #24 0x00007ffff5675c95 in IR::compute_code (this=0x7ffff0e0c460) at /oracle/jdk11/open/src/hotspot/share/c1/c1_IR.cpp:1180 #25 0x00007ffff56321ef in Compilation::build_hir (this=this@entry=0x7fffcaba05e0) at /oracle/jdk11/open/src/hotspot/share/c1/c1_Compilation.cpp:196 #26 0x00007ffff5638508 in Compilation::build_hir (this=0x7fffcaba05e0) at /oracle/jdk11/open/src/hotspot/share/runtime/thread.hpp:1997 #27 Compilation::compile_java_method (this=this@entry=0x7fffcaba05e0) at /oracle/jdk11/open/src/hotspot/share/c1/c1_Compilation.cpp:387 #28 0x00007ffff5638b20 in Compilation::compile_method (this=this@entry=0x7fffcaba05e0) at /oracle/jdk11/open/src/hotspot/share/c1/c1_Compilation.cpp:460 #29 0x00007ffff56397c7 in Compilation::Compilation (this=0x7fffcaba05e0, compiler=<optimized out>, env=<optimized out>, method=0x7ffff0e11700, osr_bci=<optimized out>, buffer_blob=<optimized out>, directive=0x7fffac01e930) at /oracle/jdk11/open/src/hotspot/share/c1/c1_Compilation.cpp:584 #30 0x00007ffff563b97a in Compiler::compile_method (this=0x7ffff0310510, env=0x7fffcaba0ac0, method=0x7ffff0e11700, entry_bci=-1, directive=0x7fffac01e930) at /oracle/jdk11/open/src/hotspot/share/c1/c1_Compiler.cpp:251 #31 0x00007ffff597f8a0 in CompileBroker::invoke_compiler_on_method (task=task@entry=0x7ffff058dba0) at /oracle/jdk11/open/src/hotspot/share/compiler/compileBroker.cpp:2097 #32 0x00007ffff59805c8 in CompileBroker::compiler_thread_loop () at /oracle/jdk11/open/src/hotspot/share/compiler/compileBroker.cpp:1797 #33 0x00007ffff677efa7 in JavaThread::thread_main_inner (this=this@entry=0x7ffff0310800) at /oracle/jdk11/open/src/hotspot/share/runtime/thread.cpp:1752 #34 0x00007ffff677f201 in JavaThread::run (this=0x7ffff0310800) at /oracle/jdk11/open/src/hotspot/share/runtime/thread.cpp:1732 #35 0x00007ffff646988a in thread_native_entry (thread=0x7ffff0310800) at /oracle/jdk11/open/src/hotspot/os/linux/os_linux.cpp:698 #36 0x00007ffff71c96ba in start_thread (arg=0x7fffcaba1700) at pthread_create.c:333 #37 0x00007ffff790441d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
26-07-2018

I can reproduce this with the latest JDK 11 build. It's a C1 bug (reproducible with -XX:TieredStopAtLevel=1). Investigating.
26-07-2018

Our QA team reported this running JCK with JDK b22, I was able to reproduce on b21. I've sent an email to Mayang asking if QA tea has more info.
25-07-2018

do you have information what jdk build it started to fail on?
25-07-2018