When run with -XX:+UseNullableValueFlattening, test compiler/valhalla/inlinetypes/TestArrays.java crashes with the following message:
# Internal Error (/valhalla/open/src/hotspot/share/opto/inlinetypenode.cpp:852), pid=1835803, tid=1835819
# assert(null_free) failed: Nullable flat implies atomic
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-03-28-1144114.fred...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-03-28-1144114.fred..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xf60970] InlineTypeNode::store_flat(GraphKit*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long) const+0xd60
#
The stack trace looks like that:
Current thread (0x00007e1d7c27f660): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1832807, stack(0x00007e1d60400000,0x00007e1d60500000) (1024K)]
Current CompileTask:
C2:21661 1593 b 4 compiler.valhalla.inlinetypes.TestArrays::test130 (14 bytes)
Stack: [0x00007e1d60400000,0x00007e1d60500000], sp=0x00007e1d604fc310, free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xf60970] InlineTypeNode::store_flat(GraphKit*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long) const+0xd60 (inlinetypenode.cpp:852)
V [libjvm.so+0x1710ae9] Parse::array_store(BasicType)+0x829 (parse2.cpp:296)
V [libjvm.so+0x171ee6a] Parse::do_one_bytecode()+0x96a (parse2.cpp:2977)
V [libjvm.so+0x17064dd] Parse::do_one_block()+0x35d (parse1.cpp:1664)
V [libjvm.so+0x1707745] Parse::do_all_blocks()+0x135 (parse1.cpp:754)
V [libjvm.so+0x170b202] Parse::Parse(JVMState*, ciMethod*, float)+0xeb2 (parse1.cpp:658)
V [libjvm.so+0x8fa565] ParseGenerator::generate(JVMState*)+0x135 (callGenerator.cpp:98)
V [libjvm.so+0xaccb56] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x17f6 (compile.cpp:811)
V [libjvm.so+0x8f75ad] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x46d (c2compiler.cpp:142)
V [libjvm.so+0xadab8c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbfc (compileBroker.cpp:2331)
V [libjvm.so+0xadbac8] CompileBroker::compiler_thread_loop()+0x598 (compileBroker.cpp:1975)
V [libjvm.so+0x101c47f] JavaThread::thread_main_inner()+0x12f (javaThread.cpp:777)
V [libjvm.so+0x1a28e46] Thread::call_run()+0xb6 (thread.cpp:231)
V [libjvm.so+0x16b8378] thread_native_entry(Thread*)+0x128 (os_linux.cpp:877)
C [libc.so.6+0x9caa4]
# Internal Error (/valhalla/open/src/hotspot/share/opto/inlinetypenode.cpp:852), pid=1835803, tid=1835819
# assert(null_free) failed: Nullable flat implies atomic
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-03-28-1144114.fred...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-03-28-1144114.fred..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xf60970] InlineTypeNode::store_flat(GraphKit*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long) const+0xd60
#
The stack trace looks like that:
Current thread (0x00007e1d7c27f660): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1832807, stack(0x00007e1d60400000,0x00007e1d60500000) (1024K)]
Current CompileTask:
C2:21661 1593 b 4 compiler.valhalla.inlinetypes.TestArrays::test130 (14 bytes)
Stack: [0x00007e1d60400000,0x00007e1d60500000], sp=0x00007e1d604fc310, free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xf60970] InlineTypeNode::store_flat(GraphKit*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long) const+0xd60 (inlinetypenode.cpp:852)
V [libjvm.so+0x1710ae9] Parse::array_store(BasicType)+0x829 (parse2.cpp:296)
V [libjvm.so+0x171ee6a] Parse::do_one_bytecode()+0x96a (parse2.cpp:2977)
V [libjvm.so+0x17064dd] Parse::do_one_block()+0x35d (parse1.cpp:1664)
V [libjvm.so+0x1707745] Parse::do_all_blocks()+0x135 (parse1.cpp:754)
V [libjvm.so+0x170b202] Parse::Parse(JVMState*, ciMethod*, float)+0xeb2 (parse1.cpp:658)
V [libjvm.so+0x8fa565] ParseGenerator::generate(JVMState*)+0x135 (callGenerator.cpp:98)
V [libjvm.so+0xaccb56] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x17f6 (compile.cpp:811)
V [libjvm.so+0x8f75ad] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x46d (c2compiler.cpp:142)
V [libjvm.so+0xadab8c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbfc (compileBroker.cpp:2331)
V [libjvm.so+0xadbac8] CompileBroker::compiler_thread_loop()+0x598 (compileBroker.cpp:1975)
V [libjvm.so+0x101c47f] JavaThread::thread_main_inner()+0x12f (javaThread.cpp:777)
V [libjvm.so+0x1a28e46] Thread::call_run()+0xb6 (thread.cpp:231)
V [libjvm.so+0x16b8378] thread_native_entry(Thread*)+0x128 (os_linux.cpp:877)
C [libc.so.6+0x9caa4]