JDK-8353202 : [lworld] TestArrays.java crashes with -XX:+UseNullableValueFlattening
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-03-28
  • Updated: 2025-04-08
  • Resolved: 2025-04-08
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.
Other
repo-valhallaFixed
Related Reports
Causes :  
Relates :  
Relates :  
Description
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]



Comments
A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1418 Date: 2025-04-04 08:45:39 +0000
04-04-2025

The following tests crash because of the same assert when run -XX:+UseNullableValueFlattening: compiler/valhalla/inlinetypes/TestGenerated.java compiler/valhalla/inlinetypes/TestLWorld.java compiler/valhalla/inlinetypes/TestLWorldProfiling.java compiler/valhalla/inlinetypes/TestNestmateAccess.java
28-03-2025

A similar failures occurs with compiler/valhalla/inlinetypes/TestC1.java when run with -XX:+UseNullableValueFlattening: # Internal Error (valhalla/open/src/hotspot/share/opto/inlinetypenode.cpp:1432), pid=1864480, tid=1864496 # 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..., compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0xf68730] InlineTypeNode::make_from_flat_impl(GraphKit*, ciInlineKlass*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long, GrowableArray<ciType*>&)+0x720 Stack trace: Current thread (0x000070de9c27e5d0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1864496, stack(0x000070de7eb00000,0x000070de7ec00000) (1024K)] Current CompileTask: C2:37759 5457 b compiler.valhalla.inlinetypes.TestC1::test11 (4 bytes) Stack: [0x000070de7eb00000,0x000070de7ec00000], sp=0x000070de7ebfc290, free space=1008k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0xf68730] InlineTypeNode::make_from_flat_impl(GraphKit*, ciInlineKlass*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long, GrowableArray<ciType*>&)+0x720 (inlinetypenode.cpp:1432) V [libjvm.so+0xf6c35e] InlineTypeNode::make_from_flat(GraphKit*, ciInlineKlass*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long)+0x10e (inlinetypenode.cpp:1312) V [libjvm.so+0x170fda3] Parse::array_load(BasicType)+0x8c3 (parse2.cpp:130) V [libjvm.so+0x171ed6b] Parse::do_one_bytecode()+0x86b (parse2.cpp:2969) 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]
28-03-2025