JDK-8276112 : Inconsistent scalar replacement debug info at safepoints
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-10-28
  • Updated: 2022-04-02
  • Resolved: 2021-11-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.
JDK 17 JDK 18
17.0.2Fixed 18 b24Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/node.hpp:391), pid=2560545, tid=2564754
#  assert(i < _max) failed: oob: i=16, _max=16

Current CompileTask:
C2: 545601 41515   !   4       jdk.proxy2.$Proxy26::doSomething (32 bytes)

Stack: [0x00007fc1944f1000,0x00007fc1945f2000],  sp=0x00007fc1945ecb00,  free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x159325f]  PhaseOutput::FillLocArray(int, MachSafePointNode*, Node*, GrowableArray<ScopeValue*>*, GrowableArray<ScopeValue*>*)+0xd6f
V  [libjvm.so+0x1593cd9]  PhaseOutput::Process_OopMap_Node(MachNode*, int)+0x3c9
V  [libjvm.so+0x1596f4f]  PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0xebf
V  [libjvm.so+0x9f7097]  Compile::Code_Gen()+0x427
V  [libjvm.so+0xa03428]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1668
V  [libjvm.so+0x81ded6]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x646
V  [libjvm.so+0xa13799]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xd09
V  [libjvm.so+0xa14438]  CompileBroker::compiler_thread_loop()+0x518
V  [libjvm.so+0x188962c]  JavaThread::thread_main_inner()+0x27c
V  [libjvm.so+0x188fbe0]  Thread::call_run()+0x100
V  [libjvm.so+0x156f524]  thread_native_entry(Thread*)+0x104

Different but related failure mode:


# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/output.cpp:803), pid=328000, tid=328013
#  assert(local) failed: use _top instead of null
#

Current CompileTask:
C2:    602    2    b  4       Test::test (9 bytes)

Stack: [0x00007faca9d37000,0x00007faca9e38000],  sp=0x00007faca9e32e00,  free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x158e3cc]  PhaseOutput::FillLocArray(int, MachSafePointNode*, Node*, GrowableArray<ScopeValue*>*, GrowableArray<ScopeValue*>*)+0x3fc
V  [libjvm.so+0x158e87e]  PhaseOutput::FillLocArray(int, MachSafePointNode*, Node*, GrowableArray<ScopeValue*>*, GrowableArray<ScopeValue*>*)+0x8ae
V  [libjvm.so+0x158f7d9]  PhaseOutput::Process_OopMap_Node(MachNode*, int)+0x3c9
V  [libjvm.so+0x1592a2c]  PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0xe9c
V  [libjvm.so+0x9fc427]  Compile::Code_Gen()+0x427
V  [libjvm.so+0xa08512]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1652
V  [libjvm.so+0x81cd16]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x646
V  [libjvm.so+0xa186a1]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xd31
V  [libjvm.so+0xa193d8]  CompileBroker::compiler_thread_loop()+0x598
V  [libjvm.so+0x1886bec]  JavaThread::thread_main_inner()+0x27c
V  [libjvm.so+0x188d1e0]  Thread::call_run()+0x100
V  [libjvm.so+0x156b3d4]  thread_native_entry(Thread*)+0x104
Comments
Fix Request (17u): This patch fixes a wrong execution or crash in the C2 compiler (regression in JDK 17). Risk is low because the fix simply disables an optimization (JDK-8261137). Tested in JDK 18 CI and tier1-3 in JDK 17u. The patch applies cleanly.
12-11-2021

Changeset: c29cab8a Author: Tobias Hartmann <thartmann@openjdk.org> Date: 2021-11-11 13:09:05 +0000 URL: https://git.openjdk.java.net/jdk/commit/c29cab8ab475055e02e4300f212907ff2db955ab
11-11-2021

Updated ILW = Wrong execution or crash/assert during C2 compilation, reproducible with simple test but edge case, disable scalar replacement or compilation of affected method = HMM = P2
09-11-2021

I found a simpler reproducer and suspect that the root cause is JDK-8261137.
04-11-2021

Replay compilation fails, see JDK-8276230.
01-11-2021

ILW = Assert/crash during C2 compilation, reproducible with large test and stress options, disable scalar replacement or compilation of affected method = HLM = P3
28-10-2021