JDK-8347018 : C2: Insertion of Assertion Predicates ignores the effects of PhaseIdealLoop::clone_up_backedge_goo()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24,25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-05
  • Updated: 2025-02-11
  • Resolved: 2025-01-20
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 25
25 b07Fixed
Related Reports
Relates :  
Description
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\sb\prod\1735558438\workspace\open\src\hotspot\share\opto\gcm.cpp:1424), pid=45708, tid=37908
#  assert(find_block_for_node(self->in(0)) == early) failed: The home of a memory writer must also be its earliest placement
#
# JRE version: Java(TM) SE Runtime Environment (24.0+30) (fastdebug build 24-ea+30-3589)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-ea+30-3589, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x7d280e]  PhaseCFG::schedule_late+0x72e
#
# Core dump will be written. Default location: C:\sb\prod\1735640123\testoutput\test-support\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_LongRunningTests_java\tmpfuzzer.tmp.I3Djr3HN4e\hs_err_pid45708.mdmp
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -XX:+UnlockDiagnosticVMOptions -XX:RepeatCompilation=40 -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:StressSeed=2145932343 -XX:+VerifyLoopOptimizations -XX:VerifyIterativeGVN=10 -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=c:\ade\mesos\work_dir\jib-master\install\jdk\23\37\bundles\windows-x64\jdk-23_windows-x64_bin.zip\jdk-23 -Djava.io.tmpdir=c:\sb\prod\1735640123\testoutput\test-support\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_LongRunningTests_java\tmp -XX:+CreateCoredumpOnCrash Test

Host: AMD EPYC 7J13 64-Core Processor                , 12 cores, 23G,  Windows 11 , 64 bit Build 22621 (10.0.22621.3527)
Time: Tue Dec 31 10:48:06 2024 Etc elapsed time: 0.459592 seconds (0d 0h 0m 0s)

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

Current thread (0x0000025295a5f550):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=37908, stack(0x000000b550700000,0x000000b550800000) (1024K)]


Current CompileTask:
C2:459    3 %  b        Test::mainTest @ 222 (570 bytes)

Stack: [0x000000b550700000,0x000000b550800000],  sp=0x000000b5507fc250,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x7d280e]  PhaseCFG::schedule_late+0x72e  (gcm.cpp:1423)
V  [jvm.dll+0x7cd5ce]  PhaseCFG::global_code_motion+0x2fe  (gcm.cpp:1633)
V  [jvm.dll+0x7cc0cd]  PhaseCFG::do_global_code_motion+0x6d  (gcm.cpp:1757)
V  [jvm.dll+0x55661d]  Compile::Code_Gen+0x19d  (compile.cpp:2965)
V  [jvm.dll+0x555061]  Compile::Compile+0x12e1  (compile.cpp:886)
V  [jvm.dll+0x45c619]  C2Compiler::compile_method+0x179  (c2compiler.cpp:145)
V  [jvm.dll+0x573013]  CompileBroker::invoke_compiler_on_method+0x7b3  (compileBroker.cpp:2319)
V  [jvm.dll+0x57060b]  CompileBroker::compiler_thread_loop+0x33b  (compileBroker.cpp:1978)
V  [jvm.dll+0x8c1956]  JavaThread::thread_main_inner+0x266  (javaThread.cpp:777)
V  [jvm.dll+0xfa80a4]  Thread::call_run+0x1b4  (thread.cpp:237)
V  [jvm.dll+0xd6cbf1]  thread_native_entry+0xe1  (os_windows.cpp:545)
C  [ucrtbase.dll+0x29333]  (no source info available)
C  [KERNEL32.DLL+0x1257d]  (no source info available)
C  [ntdll.dll+0x5aa48]  (no source info available)
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk24u/pull/66 Date: 2025-02-10 08:41:20 +0000
10-02-2025

Fix Request (JDK 24u) The issue leads to a crash during C2 compilation (regression in JDK 24). The fix is medium risk and was thoroughly tested in JDK 25 (integrated two weeks ago). The backport does not apply cleanly due to differences in the copyright dates (trivial to resolve).
10-02-2025

Changeset: 8a83dc21 Branch: master Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2025-01-20 12:24:33 +0000 URL: https://git.openjdk.org/jdk/commit/8a83dc213ac630ec79d62637133fe7aa102a27a3
20-01-2025

Deferral Request: As discussed in the currently open PR, this bug is more difficult to understand and the fix is not straight forward. Given that we are late in RDP 1, the risk seems too high. Additionally, it is an edge case that was only observed twice in fuzzing in the last two months. In product, the failing test seems to work. I'm therefore requesting a deferral to JDK 25 with the intention to backport it to 25.0.1 later.
15-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23071 Date: 2025-01-13 13:42:43 +0000
13-01-2025

ILW = Assertion failure in GCM, single Java fuzzer test, disable compilation of affected method = HLM = P3
07-01-2025

Could trace it back to JDK-8342943 which went into JDK 24+23. I'm looking into it.
07-01-2025