JDK-8353195 : [lworld] Several failures with -XX:+UseNullableValueFlattening
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-03-28
  • Updated: 2025-04-11
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-valhallaUnresolved
Related Reports
Causes :  
Duplicate :  
Duplicate :  
Description
When run with -XX:+UseNullableValueFlattening, test compiler/valhalla/inlinetypes/TestValueConstruction.java crashes with the following message:

#  Internal Error (/valhalla/open/src/hotspot/share/opto/inlinetypenode.cpp:524), p
id=1424246, tid=1424262
#  assert(!needs_atomic_access) failed: Atomic access in non-atomic container
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (slowdebug build 25-lworld5ea-LTS-2025-03-28-1300093.fred...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 25-lworld5ea-LTS-2025-03-28-1300093.fred..., mixed mode, tiered, com
pressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x117ef87]  InlineTypeNode::load(GraphKit*, Node*, Node*, ciInstanceKlass*, GrowableArray<ciType*>&, int, un
signed long)+0x19d
#


Stack trace is:

Current thread (0x0000740e142827c0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1424262, stack(0x0000740ded400000,0x0000740ded500000) (1024K)]


Current CompileTask:
C2:55280 1057    b  4       compiler.valhalla.inlinetypes.TestValueConstruction$MyValue9::<init> (27 bytes)

Stack: [0x0000740ded400000,0x0000740ded500000],  sp=0x0000740ded4fc5c0,  free space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x117ef87]  InlineTypeNode::load(GraphKit*, Node*, Node*, ciInstanceKlass*, GrowableArray<ciType*>&, int, unsigned long)+0x19d  (inlinetypenode.cpp:524)
V  [libjvm.so+0x1184362]  InlineTypeNode::make_from_oop_impl(GraphKit*, Node*, ciInlineKlass*, bool, GrowableArray<ciType*>&, bool)+0x53e  (inlinetypenode.cpp:1298)
V  [libjvm.so+0x1183e0b]  InlineTypeNode::make_from_oop(GraphKit*, Node*, ciInlineKlass*, bool, bool)+0x93  (inlinetypenode.cpp:1228)
V  [libjvm.so+0x1815f60]  Parse::Parse(JVMState*, ciMethod*, float)+0x10b6  (parse1.cpp:627)
V  [libjvm.so+0xb70619]  ParseGenerator::generate(JVMState*)+0x187  (callGenerator.cpp:98)
V  [libjvm.so+0xccb5bf]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x137f  (compile.cpp:811)
V  [libjvm.so+0xb6dce2]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x482  (c2compiler.cpp:142)
V  [libjvm.so+0xcf6313]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xdbf  (compileBroker.cpp:2331)
V  [libjvm.so+0xcf4766]  CompileBroker::compiler_thread_loop()+0x558  (compileBroker.cpp:1975)
V  [libjvm.so+0xd1689f]  CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x89  (compilerThread.cpp:67)
V  [libjvm.so+0x11fee48]  JavaThread::thread_main_inner()+0x1a6  (javaThread.cpp:777)
V  [libjvm.so+0x11fec9f]  JavaThread::run()+0x1d7  (javaThread.cpp:762)
V  [libjvm.so+0x1aca0f1]  Thread::call_run()+0x1b9  (thread.cpp:231)
V  [libjvm.so+0x17d438b]  thread_native_entry(Thread*)+0x1f5  (os_linux.cpp:877)
C  [libc.so.6+0x9caa4]


Comments
I'm fixing multiple issues with this bug (see duplicate links) because some of the failures are related and I can't properly test the fix(es) without being able to run more testing which will in turn trigger several issues.
11-04-2025

The following tests crash because of the same assert when run with -XX:+UseNullableValueFlattening: compiler/valhalla/inlinetypes/TestGetfieldChains.java compiler/valhalla/inlinetypes/TestAllocationMergeAndFolding.java compiler/valhalla/inlinetypes/TestUnexpectedMemBar.java compiler/valhalla/inlinetypes/TestValueClasses.java
28-03-2025