JDK-8350630 : [lworld] ObjBufferAllocator::initialize fails with assert(has_klass_gap()) failed: precondition
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-25
  • Updated: 2025-02-25
  • Resolved: 2025-02-25
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
Blocks :  
Relates :  
Description
Running my new test test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestFieldNullMarkers.java from https://github.com/openjdk/valhalla/compare/lworld...TobiHartmann:valhalla:JDK-8341767 with "-XX:-UseCompressedOops -XX:-UseCompressedClassPointers -Xint" crashes the runtime

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/oracle/valhalla/open/src/hotspot/share/oops/oop.inline.hpp:167), pid=2806259, tid=2806278
#  assert(has_klass_gap()) failed: precondition
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-02-20-1209440.tobias...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-02-20-1209440.tobias..., interpreted mode, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x14b39e2]  ObjBufferAllocator::initialize(HeapWordImpl**) const+0x72

Stack: [0x0000769fc3600000,0x0000769fc3700000],  sp=0x0000769fc36fe230,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x14b39e2]  ObjBufferAllocator::initialize(HeapWordImpl**) const+0x72  (oop.inline.hpp:167)
V  [libjvm.so+0x14b4aaf]  MemAllocator::allocate() const+0x9f  (memAllocator.cpp:349)
V  [libjvm.so+0xf06f83]  InlineKlass::allocate_instance_buffer(JavaThread*)+0x93  (collectedHeap.inline.hpp:41)
V  [libjvm.so+0xf07bc6]  InlineKlass::read_payload_from_addr(oop, int, LayoutKind, JavaThread*)+0x226  (inlineKlass.cpp:256)
V  [libjvm.so+0xf63730]  InterpreterRuntime::read_flat_field(JavaThread*, oopDesc*, ResolvedFieldEntry*)+0x1b0  (interpreterRuntime.cpp:307)
j  compiler.valhalla.inlinetypes.TestFieldNullMarkers.main([Ljava/lang/String;)V+1831
j  java.lang.invoke.LambdaForm$DMH+0x0000769fa0707428.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base
j  java.lang.invoke.LambdaForm$MH+0x0000769fa091f458.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+33 java.base
j  java.lang.invoke.LambdaForm$MH+0x0000769fa091fc50.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+20 java.base
j  jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+55 java.base
j  jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base
j  com.sun.javatest.regtest.agent.MainWrapper$MainTask.run()V+134
j  java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base
j  java.lang.Thread.run()V+19 java.base
v  ~StubRoutines::call_stub 0x000076a1c5000cfa
Comments
A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1379 Date: 2025-02-25 14:58:45 +0000
25-02-2025

Yeah this is left over mess from merging -XX:+CompactObjectHeaders , any code naming set_klass_gap needs an alt path for CompactObjectHeaders vs UseCompressedClassPointers
25-02-2025