JDK-8332823 : C2: assert(false) failed: Bad graph detected in build_loop_late
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2024-05-23
  • Updated: 2024-05-23
  • Resolved: 2024-05-23
Related Reports
Duplicate :  
Relates :  
Description
The following test failed in the JDK23 CI:

applications/javafuzzer/BigTest.java

Here's a snippet from the log file:

#section:driver
----------messages:(7/309)----------
command: driver applications.javafuzzer.JavaFuzzerRunner -NT 300
reason: User specified action: run driver/timeout=100000 applications.javafuzzer.JavaFuzzerRunner -NT 300 
started: Wed May 22 21:27:52 UTC 2024
Mode: agentvm
Agent id: 2
finished: Thu May 23 06:11:23 UTC 2024
elapsed time (seconds): 31410.867
----------configuration:(20/3456)----------

<snip>

----------System.out:(70/5942)----------
For random generator using seed: -6969539666147125957
To re-run test with same seed value please add "-Djdk.test.lib.random.seed=-6969539666147125957" to command line.
Using JRuby dist path: /opt/mach5/mesos/work_dir/jib-master/install/org/jruby/jruby-dist/9.2.12.0/jruby-dist-9.2.12.0-bin.zip/jruby-9.2.12.0
[DBG] Created generator string: '/opt/mach5/mesos/work_dir/jib-master/install/jdk-23+24-1968/linux-x64-debug.jdk/jdk-23/fastdebug/bin/java --module-path /opt/mach5/mesos/work_dir/jib-master/install/org/jruby/jruby-dist/9.2.12.0/jruby-dist-9.2.12.0-bin.zip/jruby-9.2.12.0/lib/jruby.jar --add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist --enable-native-access=org.jruby.dist -Djruby.home=/opt/mach5/mesos/work_dir/jib-master/install/org/jruby/jruby-dist/9.2.12.0/jruby-dist-9.2.12.0-bin.zip/jruby-9.2.12.0 -Djruby.lib=/opt/mach5/mesos/work_dir/jib-master/install/org/jruby/jruby-dist/9.2.12.0/jruby-dist-9.2.12.0-bin.zip/jruby-9.2.12.0/lib org.jruby.Main -W0 -I /opt/mach5/mesos/work_dir/jib-master/install/com/oracle/jpg/bigapps/javafuzzer/javafuzzer/3.4/javafuzzer-3.4.zip/rb /opt/mach5/mesos/work_dir/jib-master/install/com/oracle/jpg/bigapps/javafuzzer/javafuzzer/3.4/javafuzzer-3.4.zip/rb/Fuzzer.rb -f /opt/mach5/mesos/work_dir/jib-master/install/com/oracle/jpg/bigapps/javafuzzer/javafuzzer/3.4/javafuzzer-3.4.zip/rb/config.yml'
Using the following path for FailureHandler: '/opt/mach5/mesos/work_dir/jib-master/install/jdk-23+24-1968/linux-x64-debug.test/failure_handler/jtregFailureHandler.jar'
Starting JavaFuzzer: '/bin/bash /opt/mach5/mesos/work_dir/jib-master/install/com/oracle/jpg/bigapps/javafuzzer/javafuzzer/3.4/javafuzzer-3.4.zip/mrt.sh -R /opt/mach5/mesos/work_dir/slaves/a4a7850a-7c35-410a-b879-d77fbb2f6087-S24674/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/5f2890d5-7b20-40d8-84bc-479c88b8403a/runs/5a8c8fb9-8ba5-492f-8326-04443a2cac3b/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_BigTest_java/scratch/0 -NT 300 -NP 12 -A -conf config.yml'
[2024-05-22T21:28:01.196532400Z] Gathering output for process 2386009
[2024-05-22T21:28:01.296190716Z] Waiting for completion for process 2386009
[2024-05-23T06:11:23.056892499Z] Waiting for completion finished for process 2386009
Output and diagnostic info for process 2386009 was saved into 'pid-2386009-output.log'

Summary of the JavaFuzzer run:
------------------------------
Host:     ol9-x64-561956
Tests:    12 x 300
Args:     -conf config.yml

Started  at: Wed May 22 21:28:01 UTC 2024


r3- 300: 192 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 108 Reference Java failures
r5- 300: 184 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 116 Reference Java failures
r12- 300: 188 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 112 Reference Java failures
r4- 300: 186 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 114 Reference Java failures
r8- 300: 167 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 133 Reference Java failures
r9- 300: 179 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 121 Reference Java failures
r6- 300: 175 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 125 Reference Java failures
r7- 300: 188 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 112 Reference Java failures
r11- 300: 181 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 119 Reference Java failures
r2- 300: 184 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 116 Reference Java failures
r1- 300: 182 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 118 Reference Java failures
r10- 300: 175 passed, 2 crashes, 0 fails, 0 hangs, 0 incorrect tests, 124 Reference Java failures

Finished at: Thu May 23 06:11:23 UTC 2024


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/a4a7850a-7c35-410a-b879-d77fbb2f6087-S15108/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/22e0e6be-a0ba-4dbd-8bab-717ab62107df/runs/0ea5caca-fb44-45a4-bd22-6f7ce7be4d7b/workspace/open/src/hotspot/share/opto/loopnode.cpp:6366), pid=2818842, tid=2818860
#  assert(false) failed: Bad graph detected in build_loop_late
#
# JRE version: Java(TM) SE Runtime Environment (23.0+24) (fastdebug build 23-ea+24-1968)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-ea+24-1968, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x129b037]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x8e7
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.dZiCkryYgy/core.2818842)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/a4a7850a-7c35-410a-b879-d77fbb2f6087-S15108/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/22e0e6be-a0ba-4dbd-8bab-717ab62107df/runs/0ea5caca-fb44-45a4-bd22-6f7ce7be4d7b/workspace/open/src/hotspot/share/opto/loopnode.cpp:6366), pid=2819135, tid=2819150
#  assert(false) failed: Bad graph detected in build_loop_late
#
# JRE version: Java(TM) SE Runtime Environment (23.0+24) (fastdebug build 23-ea+24-1968)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-ea+24-1968, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x129b037]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x8e7
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.dZiCkryYgy/core.2819135)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

----------System.err:(15/908)----------
java.lang.RuntimeException: assertEquals expected: 1 but was: 2
	at jdk.test.lib.Asserts.fail(Asserts.java:691)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:204)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:191)
	at applications.javafuzzer.JavaFuzzerRunner.reportResults(JavaFuzzerRunner.java:294)
	at applications.javafuzzer.JavaFuzzerRunner.runWithConfigurations(JavaFuzzerRunner.java:315)
	at applications.javafuzzer.JavaFuzzerRunner.main(JavaFuzzerRunner.java:337)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1575)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: assertEquals expected: 1 but was: 2


I tried to find an existing bug with this failure mode, but the bugs that
I did find are all resolved so I filed this new one.
Comments
It's another regression from JDK-8324517. java -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -Xcomp -XX:MaxRAMPercentage=4.16667 Test.java
23-05-2024