JDK-8353212 : [lworld] TestFlatArrayAliasesCardMark.java crashes when run with -XX:+UseAtomicValueFlattening
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-03-28
  • Updated: 2025-03-31
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
Description
When run with -XX:+UseAtomicValueFlattening, test compiler/valhalla/inlinetypes/TestFlatArrayAliasesCardMark.java crashes with the following message:

#  Internal Error (/valhalla/open/src/hotspot/share/opto/compile.cpp:5741), pid=2280567, tid=2280585
#  assert(bt == T_SHORT) failed: unexpected narrow type
#
# 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+0xabecef]  Compile::narrow_value(BasicType, Node*, Type const*, PhaseGVN*, bool)+0x2ef
#


Stack trace:

Current thread (0x0000732aa02816d0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2280585, stack(0x0000732a9ff00000,0x0000732aa0000000) (1024K)]


Current CompileTask:
C2:1813  336 %  b  4       TestFlatArrayAliasesCardMark::method1 @ 16 (57 bytes)

Stack: [0x0000732a9ff00000,0x0000732aa0000000],  sp=0x0000732a9fffc170,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xabecef]  Compile::narrow_value(BasicType, Node*, Type const*, PhaseGVN*, bool)+0x2ef  (compile.cpp:5741)
V  [libjvm.so+0xf678bf]  InlineTypeNode::convert_from_payload(GraphKit*, BasicType, Node*, int, bool, int)+0x1cf  (inlinetypenode.cpp:609)
V  [libjvm.so+0xf683c9]  InlineTypeNode::make_from_flat_impl(GraphKit*, ciInlineKlass*, Node*, Node*, Node*, ciInstanceKlass*, int, bool, int, unsigned long, GrowableArray<ciType*>&)+0x3b9  (inlinetypenode.cpp:1429)
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]

Comments
Test compiler/valhalla/inlinetypes/TestGenerated.java crashes because of the same assert when run with -XX:+UseAtomicValueFlattening
28-03-2025