We should add the TestA4.java to regression testing, and probably backport it at least to JDK11.
It turns out that the bug is already fixed in all old versions with JDK-8328544 and its backport of this snipped:
// We did not find the int_index. Just to be safe, reject this VPointer.
if (!_has_int_index_after_convI2L) {
return false;
}
But if somebody were to remove it, we would re-reveal the bug with the CastX2P and Allocation removal, described below.
------------------------------------------------------------------ Original Description ------------------------------------------------------------------
During the investigation of JDK-8339349, we found a replay file that has a different failure mode.
unuzip jars.zip -> place in jars directory.
[~thartmann] narrowed it down:
> I narrowed it down. The issue is introduced/triggered by JDK-8308606 in JDK 22 b03 (see hs_err_pid1979173.log) and fixed/hidden by JDK-8310190 in JDK 23 b05.
> Emanuel, please have a look and verify that the fix was indeed introduced by JDK-8308606 and fixed JDK-8310190. If so, we need to re-triage those bugs.
DEBUG:
/oracle-work/jdk-fork1/build/linux-x64-debug/jdk/bin/java -XX:+ReplayCompiles -XX:+ReplayIgnoreInitErrors -XX:ReplayDataFile=replay_pid3400217.log -cp "jars/*:jars/" -XX:+TraceSuperWord -XX:+UseSuperWord -XX:+TraceNewVectors -Xbatch -XX:+UseG1GC -XX:+PrintIdeal
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/oracle-work/jdk-fork1/open/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp:730), pid=980994, tid=981014
# Error: assert(this_region != nullptr) failed
#
# JRE version: Java(TM) SE Runtime Environment (23.0) (fastdebug build 23-internal-2024-10-14-1158199.emanuel...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-internal-2024-10-14-1158199.emanuel..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xc38091] G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand*, Node*) const+0x411
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /oracle-work/JDK-8339349/core.980994)
#
# An error report file with more information is saved as:
# /oracle-work/JDK-8339349/hs_err_pid980994.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
Current CompileTask:
C2:56926 186 b 4 org.apache.coyote.http11.Http11OutputBuffer::write (93 bytes)
Stack: [0x00007facbd1bc000,0x00007facbd2bd000], sp=0x00007facbd2b7fa0, free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xc38091] G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand*, Node*) const+0x411 (g1BarrierSetC2.cpp:730)
V [libjvm.so+0x12d3064] PhaseMacroExpand::process_users_of_allocation(CallNode*)+0x694 (macro.cpp:159)
V [libjvm.so+0x12decae] PhaseMacroExpand::eliminate_allocate_node(AllocateNode*)+0x35e (macro.cpp:1100)
V [libjvm.so+0x12df2b2] PhaseMacroExpand::eliminate_macro_nodes()+0x3b2 (macro.cpp:2386)
V [libjvm.so+0x12df569] PhaseMacroExpand::expand_macro_nodes()+0x19 (macro.cpp:2434)
V [libjvm.so+0x9ece06] Compile::Optimize()+0xef6 (compile.cpp:2446)
V [libjvm.so+0x9f04cb] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1beb (compile.cpp:857)
V [libjvm.so+0x83dc17] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1e7 (c2compiler.cpp:134)
V [libjvm.so+0x9fba8c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x92c (compileBroker.cpp:2299)
V [libjvm.so+0x9fc718] CompileBroker::compiler_thread_loop()+0x468 (compileBroker.cpp:1958)
V [libjvm.so+0xeb99ac] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:721)
V [libjvm.so+0x179e956] Thread::call_run()+0xb6 (thread.cpp:220)
V [libjvm.so+0x14a92a7] thread_native_entry(Thread*)+0x127 (os_linux.cpp:789)
PRODUCT:
/oracle-work/jdk-fork1/build/linux-x64/jdk/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+ReplayCompiles -XX:+ReplayIgnoreInitErrors -XX:ReplayDataFile=replay_pid3400217.log -cp "jars/*:jars/" -XX:+UseSuperWord -Xbatch -XX:+UseG1GC
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fc3455e00fa, pid=892245, tid=892653
#
# JRE version: Java(TM) SE Runtime Environment (23.0) (build 23-internal-2024-10-14-1157432.xyz...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23-internal-2024-10-14-1157432.xyz..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x7910fa] G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand*, Node*) const+0x22a
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /oracle-work/JDK-8339349/core.892245)
#
# An error report file with more information is saved as:
# /oracle-work/JDK-8339349/hs_err_pid892245.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
Current CompileTask:
C2:42341 186 b 4 org.apache.coyote.http11.Http11OutputBuffer::write (93 bytes)
Stack: [0x00007fc30efaf000,0x00007fc30f0b0000], sp=0x00007fc30f0ab760, free space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x7910fa] G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand*, Node*) const+0x22a (node.hpp:406)
V [libjvm.so+0xbd119f] PhaseMacroExpand::process_users_of_allocation(CallNode*)+0x6bf (macro.cpp:159)
V [libjvm.so+0xbd6d0e] PhaseMacroExpand::eliminate_allocate_node(AllocateNode*)+0x1ee (macro.cpp:1100)
V [libjvm.so+0xbd6e92] PhaseMacroExpand::eliminate_macro_nodes()+0x122 (macro.cpp:2386)
V [libjvm.so+0xbd6f39] PhaseMacroExpand::expand_macro_nodes()+0x19 (macro.cpp:2434)
V [libjvm.so+0x641bee] Compile::Optimize()+0x89e (compile.cpp:2446)
V [libjvm.so+0x6432ad] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0xedd (compile.cpp:857)
V [libjvm.so+0x56b091] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1f1 (c2compiler.cpp:134)
V [libjvm.so+0x648c71] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xae1 (compileBroker.cpp:2299)
V [libjvm.so+0x64bd58] CompileBroker::compiler_thread_loop()+0x498 (compileBroker.cpp:1958)
V [libjvm.so+0x909d38] JavaThread::thread_main_inner() [clone .part.0]+0xb8 (javaThread.cpp:721)
V [libjvm.so+0xebcf7f] Thread::call_run()+0x9f (thread.cpp:220)
V [libjvm.so+0xce0485] thread_native_entry(Thread*)+0xd5 (os_linux.cpp:789)