JDK-8364757 : Missing Store nodes caused by bad wiring in PhaseIdealLoop::insert_post_loop
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,25,26
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2025-08-05
  • Updated: 2025-10-13
  • Resolved: 2025-10-03
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 26
26 b19Fixed
Related Reports
Causes :  
Causes :  
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK26 CI:

applications/javafuzzer/JF_5000Tests.java

Here's a snippet from the log file:

#section:main
----------messages:(7/528)----------
command: main -Xbootclasspath/a:. -Dtest.generator.number_of_tests=5000 -Dtest.generator.filter=javafuzzer_tests applications.javafuzzer.TestGeneratorRunner
reason: User specified action: run main/othervm/timeout=20000 -Xbootclasspath/a:. -Dtest.generator.number_of_tests=5000 -Dtest.generator.filter=javafuzzer_tests applications.javafuzzer.TestGeneratorRunner 
started: Tue Aug 05 10:52:43 UTC 2025
Mode: othervm [/othervm specified]
Process id: 3009677
finished: Tue Aug 05 11:36:55 UTC 2025
elapsed time (seconds): 2651.968
----------configuration:(0/0)----------
----------System.out:(9/1518)----------
For random generator using seed: -1751703659352188602
To re-run test with same seed value please add "-Djdk.test.lib.random.seed=-1751703659352188602" to command line.

<snip - JBS won't let me save this part of the log file>

Generating 5000 tests
Summary total: GEN: 25:52:34     COMP: 00:18:11     REF: 13:14:05     VER: 00:07:06.503
Summary mean : GEN: 00:00:47.527 COMP: 00:00:00.556 REF: 00:00:24.308 VER: 00:00:00.217
----------System.err:(42/4385)----------

<snip>

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by net.logstash.logback.encoder.com.lmax.disruptor.RingBufferFields (file:/opt/mach5/mesos/work_dir/jib-master/install/com/oracle/java/jib/jib/3.0-SNAPSHOT/jib-3.0-20250630.200257-546-distribution.zip/jib-3.0-SNAPSHOT-distribution/lib/logstash-logback-encoder-4.7.jar)
WARNING: Please consider reporting this to the maintainers of class net.logstash.logback.encoder.com.lmax.disruptor.RingBufferFields
WARNING: sun.misc.Unsafe::arrayBaseOffset will be removed in a future release
java.lang.Error: JavaFuzzer process returned exitcode: 124, please check /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S221081/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4617b0a7-893b-46b5-aa9f-3134ccec6e86/runs/ecec3efd-e44d-417b-9598-dcd544db9bb7/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_JF_5000Tests_java/tmp/javafuzzer_tests10966911131946022002/Test_1744.javafuzzer* files
	at applications.javafuzzer.JavaFuzzerBatchCodeGenerator.generateSources(JavaFuzzerBatchCodeGenerator.java:107)
	at applications.javafuzzer.BatchProcessor.process(BatchProcessor.java:80)
	at applications.javafuzzer.TestGeneratorRunner.lambda$processTasks$2(TestGeneratorRunner.java:83)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at applications.javafuzzer.TestGeneratorRunner.lambda$processTasks$1(TestGeneratorRunner.java:80)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:371)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:310)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)
java.lang.RuntimeException: Caught throwable during execution
	at jdk.test.lib.Asserts.fail(Asserts.java:738)
	at applications.javafuzzer.TestGeneratorRunner.processTasks(TestGeneratorRunner.java:113)
	at applications.javafuzzer.TestGeneratorRunner.performFullCycle(TestGeneratorRunner.java:192)
	at applications.javafuzzer.TestGeneratorRunner.main(TestGeneratorRunner.java:226)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.lang.Error: JavaFuzzer process returned exitcode: 124, please check /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S221081/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4617b0a7-893b-46b5-aa9f-3134ccec6e86/runs/ecec3efd-e44d-417b-9598-dcd544db9bb7/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_JF_5000Tests_java/tmp/javafuzzer_tests10966911131946022002/Test_1744.javafuzzer* files
	at applications.javafuzzer.JavaFuzzerBatchCodeGenerator.generateSources(JavaFuzzerBatchCodeGenerator.java:107)
	at applications.javafuzzer.BatchProcessor.process(BatchProcessor.java:80)
	at applications.javafuzzer.TestGeneratorRunner.lambda$processTasks$2(TestGeneratorRunner.java:83)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at applications.javafuzzer.TestGeneratorRunner.lambda$processTasks$1(TestGeneratorRunner.java:80)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:371)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:310)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	... 1 more

JavaTest Message: Test threw exception: java.lang.RuntimeException: Caught throwable during execution
Comments
Changeset: 72319167 Branch: master Author: Benoît Maillard <bmaillard@openjdk.org> Committer: Manuel Hässig <mhaessig@openjdk.org> Date: 2025-10-03 10:40:50 +0000 URL: https://git.openjdk.org/jdk/commit/72319167543a28295276f11178c17bef6680c32f
03-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27225 Date: 2025-09-11 13:05:21 +0000
12-09-2025

There is an even simpler reproducer: java -XX:CompileCommand="compileonly,*Test*::test*" -XX:CompileCommand="printcompilation,*Test*::*" -XX:-TieredCompilation -Xcomp -XX:+PrintIdealGraph -XX:-UseLoopPredicate -XX:-UseAutoVectorizationPredicate Test_reduced.java The root of the issue is a missing Phi node when pulling a Store node out of the inner CountedLoop into the OuterStripMinedLoop. This apparently done on purpose (cf discussions on related issues), as keeping the Phi might confuse further loop optimizations.
05-09-2025

ILW = incorrect results with intrinsic, only seen with fuzzer test, -XX:-UseOnStackReplacement = HLM = P3
15-08-2025

Bisected to this commit: [9925014035ed203ba42cce80a23730328bbe8a50] 8280320: C2: Loop opts are missing during OSR compilation
15-08-2025

OSR might explain why the final no-op loop at the end seems to be necessary.
15-08-2025

Bisected to between jdk-19+29 and jdk-19+30.
15-08-2025

I just had a quick look out of curiosity and found that this does not reproduce with -XX:-UseOnStackReplacement.
15-08-2025

I have attached a reduced reproducer, which I ran with -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch
14-08-2025

Thanks [~dcubed], Test_54.C2_STRESS.diffs does indeed contain the source code we need. I verified on linux-x64 that the test gets different results with c2 vs -Xint.
09-08-2025