test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java fails with this assertion if it runs with -Diters=2000 (see the patch below).
diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
index 0f74bf35e80..7623479d0d5 100644
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
@@ -25,7 +25,7 @@
/*
* @test
- * @run testng/othervm -Diters=2000 VarHandleTestMethodHandleAccessPoint
+ * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessPoint
*/
import org.testng.annotations.BeforeClass;
-----
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (lworld-closed/open/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp:209), pid=51042,
tid=25099
# assert(pre_val->bottom_type()->basic_type() == T_OBJECT) failed: or we shouldn't be here
#
# JRE version: Java(TM) SE Runtime Environment (18.0) (fastdebug build 18-internal+0-adhoc.mlchung.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-internal+0-adhoc.mlchung.open, mixed mode, tiered, compressed oops, c
ompressed class ptrs, g1 gc, bsd-amd64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting
Java again
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
Current CompileTask:
C2: 9846 1668 4 java.lang.invoke.LambdaForm$MH/0x0000000800164800::invoke (60 bytes)
Stack: [0x000070000c47d000,0x000070000c57d000], sp=0x000070000c578ce0, free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0x118d169] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, voi
d*, void*, char const*, int, unsigned long)+0x6e9
V [libjvm.dylib+0x118d7eb] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)
+0x3b
V [libjvm.dylib+0x5fdfbd] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V [libjvm.dylib+0x706a62] G1BarrierSetC2::pre_barrier(GraphKit*, bool, Node*, Node*, Node*, unsigned int, Node*, TypeOopPtr co
nst*, Node*, BasicType) const+0x112
V [libjvm.dylib+0xdff07a] ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess&, Node*, Node*, Type const*)
const+0x7a
V [libjvm.dylib+0x33a1da] BarrierSetC2::atomic_cmpxchg_bool_at(C2AtomicParseAccess&, Node*, Node*, Type const*) const+0x4a
V [libjvm.dylib+0x826d41] GraphKit::access_atomic_cmpxchg_bool_at(Node*, Node*, TypePtr const*, int, Node*, Node*, Type const*
, BasicType, unsigned long long)+0xd1
V [libjvm.dylib+0xc1515e] LibraryCallKit::inline_unsafe_load_store(BasicType, LibraryCallKit::LoadStoreKind, LibraryCallKit::A
ccessKind)+0xa5e
V [libjvm.dylib+0xc0897e] LibraryIntrinsic::generate(JVMState*)+0x24e
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x486b60] PredictedCallGenerator::generate(JVMState*)+0x350
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x59bc53] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1523
V [libjvm.dylib+0x47fcb9] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x109
V [libjvm.dylib+0x5bd852] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x7a2
V [libjvm.dylib+0x5bce90] CompileBroker::compiler_thread_loop()+0x2c0
V [libjvm.dylib+0x10de154] JavaThread::thread_main_inner()+0x254
V [libjvm.dylib+0x10dafd7] Thread::call_run()+0x177
V [libjvm.dylib+0xe8b0e0] thread_native_entry(Thread*)+0x150
C [libsystem_pthread.dylib+0x6109] _pthread_start+0x94
C [libsystem_pthread.dylib+0x1b8b] thread_start+0xf
diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
index 0f74bf35e80..7623479d0d5 100644
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessPoint.java
@@ -25,7 +25,7 @@
/*
* @test
- * @run testng/othervm -Diters=2000 VarHandleTestMethodHandleAccessPoint
+ * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessPoint
*/
import org.testng.annotations.BeforeClass;
-----
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (lworld-closed/open/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp:209), pid=51042,
tid=25099
# assert(pre_val->bottom_type()->basic_type() == T_OBJECT) failed: or we shouldn't be here
#
# JRE version: Java(TM) SE Runtime Environment (18.0) (fastdebug build 18-internal+0-adhoc.mlchung.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-internal+0-adhoc.mlchung.open, mixed mode, tiered, compressed oops, c
ompressed class ptrs, g1 gc, bsd-amd64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting
Java again
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
Current CompileTask:
C2: 9846 1668 4 java.lang.invoke.LambdaForm$MH/0x0000000800164800::invoke (60 bytes)
Stack: [0x000070000c47d000,0x000070000c57d000], sp=0x000070000c578ce0, free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0x118d169] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, voi
d*, void*, char const*, int, unsigned long)+0x6e9
V [libjvm.dylib+0x118d7eb] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)
+0x3b
V [libjvm.dylib+0x5fdfbd] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V [libjvm.dylib+0x706a62] G1BarrierSetC2::pre_barrier(GraphKit*, bool, Node*, Node*, Node*, unsigned int, Node*, TypeOopPtr co
nst*, Node*, BasicType) const+0x112
V [libjvm.dylib+0xdff07a] ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess&, Node*, Node*, Type const*)
const+0x7a
V [libjvm.dylib+0x33a1da] BarrierSetC2::atomic_cmpxchg_bool_at(C2AtomicParseAccess&, Node*, Node*, Type const*) const+0x4a
V [libjvm.dylib+0x826d41] GraphKit::access_atomic_cmpxchg_bool_at(Node*, Node*, TypePtr const*, int, Node*, Node*, Type const*
, BasicType, unsigned long long)+0xd1
V [libjvm.dylib+0xc1515e] LibraryCallKit::inline_unsafe_load_store(BasicType, LibraryCallKit::LoadStoreKind, LibraryCallKit::A
ccessKind)+0xa5e
V [libjvm.dylib+0xc0897e] LibraryIntrinsic::generate(JVMState*)+0x24e
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x486b60] PredictedCallGenerator::generate(JVMState*)+0x350
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x6a2719] Parse::do_call()+0xc19
V [libjvm.dylib+0xed4174] Parse::do_one_bytecode()+0x194
V [libjvm.dylib+0xebcb91] Parse::do_one_block()+0x441
V [libjvm.dylib+0xebab18] Parse::do_all_blocks()+0x3f8
V [libjvm.dylib+0xeb5d5d] Parse::Parse(JVMState*, ciMethod*, float)+0x112d
V [libjvm.dylib+0x48179b] ParseGenerator::generate(JVMState*)+0xab
V [libjvm.dylib+0x59bc53] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1523
V [libjvm.dylib+0x47fcb9] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x109
V [libjvm.dylib+0x5bd852] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x7a2
V [libjvm.dylib+0x5bce90] CompileBroker::compiler_thread_loop()+0x2c0
V [libjvm.dylib+0x10de154] JavaThread::thread_main_inner()+0x254
V [libjvm.dylib+0x10dafd7] Thread::call_run()+0x177
V [libjvm.dylib+0xe8b0e0] thread_native_entry(Thread*)+0x150
C [libsystem_pthread.dylib+0x6109] _pthread_start+0x94
C [libsystem_pthread.dylib+0x1b8b] thread_start+0xf