JDK-8286361 : C2: TestSkeletonPredicates.java using -XX:-DoEscapeAnalysis fails with "Bad graph detected in build_loop_late"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux,windows
  • CPU: x86_64
  • Submitted: 2022-05-08
  • Updated: 2022-05-15
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 19
19Unresolved
Related Reports
Relates :  
Sub Tasks
JDK-8286442 :  
JDK-8286791 :  
Description
The following test failed in the JDK19 CI:

compiler/c2/irTests/TestSkeletonPredicates.java

Here's a snippet from the log file:

idom[40]  43  Proj  ===  42  [[ 46 ]] #0 !jvms: TestSkeletonPredicates::test1 @ bci:2 (line 62)
idom[41]  42  AllocateArray  ===  5  6  7  8  1 ( 36  23  28  22  38  10  1  1 ) [[ 43  44  45  52  53  54 ]]  rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int, bool ) TestSkeletonPredicates::test1 @ bci:2 (line 62) !jvms: TestSkeletonPredicates::test1 @ bci:2 (line 62)
idom[42]  5  Parm  ===  3  [[ 42 ]] Control !jvms: TestSkeletonPredicates::test1 @ bci:-1 (line 62)

Real LCA of early 250 (idom[4]) and (wrong) LCA 330 (idom[3]):
 214  If  ===  596  213  [[ 215  216 ]] P=0.900000, C=-1.000000 !jvms: TestSkeletonPredicates::test1_helper @ bci:10 (line 50) TestSkeletonPredicates::test1 @ bci:16 (line 64)

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/loopnode.cpp:5856
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14832/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8c00153c-faa5-4803-b109-07e29ed8b1be/runs/e5b92008-393a-4aa3-8cd8-a5f6ea964bd1/workspace/open/src/hotspot/share/opto/loopnode.cpp:5856), pid=19980, tid=19995
#  assert(false) failed: Bad graph detected in build_loop_late
#
# JRE version: Java(TM) SE Runtime Environment (19.0+22) (fastdebug build 19-ea+22-1524)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-ea+22-1524, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1480a27]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x187
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/scratch/0/core.19980)
#
Unsupported internal testing APIs have been used.

# An error report file with more information is saved as:
# /opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/scratch/0/hs_err_pid19980.log
#
# Compiler replay data is saved as:
# /opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/scratch/0/replay_pid19980.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

Command Line:
/opt/mach5/mesos/work_dir/jib-master/install/jdk-19+22-1524/linux-x64-debug.jdk/jdk-19/fastdebug/bin/java -DReproduce=true -cp /opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/2/compiler/c2/irTests/TestSkeletonPredicates.d:/opt/mach5/mesos/work_dir/jib-master/install/jdk-19+22-1524/src.full/open/test/hotspot/jtreg/compiler/c2/irTests:/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/2/test/lib:/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/2:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/javatest.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/jtreg.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/junit.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/hamcrest.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/testng.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/jcommander.jar:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/guice.jar -Djava.library.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-19+22-1524/linux-x64-debug.test/hotspot/jtreg/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:MaxRAMPercentage=4.16667 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14455/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a6828202-e02b-409f-889d-350876ac9c06/runs/accd8529-8968-4ea0-a794-67f70c696cad/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/tmp -Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:-DoEscapeAnalysis -Dir.framework.server.port=44439 -XX:-UseLoopPredicate -XX:LoopUnrollLimit=240 -XX:+StressIGVN -XX:StressSeed=255527877 -XX:-BackgroundCompilation -XX:CompileCommand=quiet compiler.lib.ir_framework.test.TestVM compiler.c2.irTests.TestSkeletonPredicates


Error Output
------------


  #############################################################
   - To only run the failed tests use -DTest, -DExclude,
     and/or -DScenarios.
   - To also get the standard output of the test VM run with
     -DReportStdout=true or for even more fine-grained logging
     use -DVerbose=true.
  #############################################################


compiler.lib.ir_framework.driver.TestVMException: There were one or multiple errors. Please check stderr for more information.
	at compiler.lib.ir_framework.driver.TestVMProcess.throwTestVMException(TestVMProcess.java:238)
	at compiler.lib.ir_framework.driver.TestVMProcess.checkTestVMExitCode(TestVMProcess.java:219)
	at compiler.lib.ir_framework.driver.TestVMProcess.<init>(TestVMProcess.java:74)
	at compiler.lib.ir_framework.TestFramework.runTestVM(TestFramework.java:699)
	at compiler.lib.ir_framework.TestFramework.start(TestFramework.java:671)
	at compiler.lib.ir_framework.TestFramework.start(TestFramework.java:324)
	at compiler.lib.ir_framework.TestFramework.runWithFlags(TestFramework.java:232)
	at compiler.c2.irTests.TestSkeletonPredicates.main(TestSkeletonPredicates.java:41)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:1585)

JavaTest Message: Test threw exception: compiler.lib.ir_framework.driver.TestVMException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: compiler.lib.ir_framework.driver.TestVMException: There were one or multiple errors. Please check stderr for more information.


Here's the crashing thread's stack:

---------------  T H R E A D  ---------------

Current thread (0x00007f6050464320):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=19995, stack(0x00007f602c995000,0x00007f602ca96000)]


Current CompileTask:
C2:  42651 8319    b  4       compiler.c2.irTests.TestSkeletonPredicates::test1 (32 bytes)

Stack: [0x00007f602c995000,0x00007f602ca96000],  sp=0x00007f602ca8ff70,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1480a27]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x187
V  [libjvm.so+0x14811e2]  PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0xb2
V  [libjvm.so+0x1481c77]  PhaseIdealLoop::build_and_optimize()+0x617
V  [libjvm.so+0xad4eda]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x27a
V  [libjvm.so+0xad16fa]  Compile::Optimize()+0x10ea
V  [libjvm.so+0xad3890]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1590
V  [libjvm.so+0x8e7fc3]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x683
V  [libjvm.so+0xae2730]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xce0
V  [libjvm.so+0xae3658]  CompileBroker::compiler_thread_loop()+0x6c8
V  [libjvm.so+0x1a5665a]  JavaThread::thread_main_inner()+0x21a
V  [libjvm.so+0x1a63fa0]  Thread::call_run()+0x100
V  [libjvm.so+0x170d8b4]  thread_native_entry(Thread*)+0x104

So far there are 4 sightings of this test failure:

2 - linux-x64-debug
2 - windows-x64-debug

However, the Tier7 job set isn't done yet.
Comments
Potentially related to JDK-8283386.
09-05-2022

The failure is reproducible deterministically using -XX:-DoEscapeAnalysis, but only after (not including) jdk-19+21.
09-05-2022

ILW = assert failure in debug mode; using non-default flag value; use -XX:+DoEscapeAnalysis (default) = MMM = P3
09-05-2022