JDK-8356963 : [lworld] MemNode::optimize_simple_memory_chain fails with "sanity check for basic cases"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-05-14
  • Updated: 2025-05-19
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 :  
Relates :  
Description
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/oracle/valhalla/open/src/hotspot/share/opto/memnode.cpp:231), pid=3357853, tid=3357867
#  assert(is_strict_final_load) failed: sanity check for basic cases
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-04-22-0723438.tobias...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-04-22-0723438.tobias..., mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x15fb659]  MemNode::optimize_simple_memory_chain(Node*, TypeOopPtr const*, Node*, PhaseGVN*)+0xff9

Current CompileTask:
C2:2733  109             Test::test (13 bytes)

Stack: [0x00007cec85900000,0x00007cec85a00000],  sp=0x00007cec859fafb0,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x15fb659]  MemNode::optimize_simple_memory_chain(Node*, TypeOopPtr const*, Node*, PhaseGVN*)+0xff9  (memnode.cpp:231)
V  [libjvm.so+0x15fb70e]  MemNode::optimize_memory_chain(Node*, TypePtr const*, Node*, PhaseGVN*)+0x2e  (memnode.cpp:330)
V  [libjvm.so+0x16067bf]  LoadNode::Ideal(PhaseGVN*, bool)+0x1ff  (memnode.cpp:2026)
V  [libjvm.so+0x17df5fd]  PhaseIterGVN::transform_old(Node*)+0xbd  (phaseX.cpp:668)
V  [libjvm.so+0x17d4ace]  PhaseIterGVN::optimize()+0x9e  (phaseX.cpp:1046)
V  [libjvm.so+0xb253cd]  Compile::Optimize()+0x32d  (compile.cpp:2768)
V  [libjvm.so+0xb28f3b]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1feb  (compile.cpp:874)
V  [libjvm.so+0x94e81d]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x46d  (c2compiler.cpp:142)
V  [libjvm.so+0xb37bc2]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb22  (compileBroker.cpp:2307)
V  [libjvm.so+0xb38bc8]  CompileBroker::compiler_thread_loop()+0x588  (compileBroker.cpp:1951)
V  [libjvm.so+0x1091a9f]  JavaThread::thread_main_inner()+0x12f  (javaThread.cpp:773)
V  [libjvm.so+0x1ac1706]  Thread::call_run()+0xb6  (thread.cpp:231)
V  [libjvm.so+0x1748608]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:877)

The problematic load is a null marker load emitted here:

    Node* adr = kit->basic_plus_adr(obj, ptr, null_marker_offset);
    Node* nm_value = kit->access_load_at(obj, adr, TypeRawPtr::BOTTOM, TypeInt::BOOL, T_BOOLEAN, is_array ? (decorators | IS_ARRAY) : decorators);
    vt->set_req(IsInit, nm_value);

It does not belong to any field and therefore 'field' is nullptr.
Comments
A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1456 Date: 2025-05-15 16:40:57 +0000
15-05-2025