JDK-8354419 : [lworld] Assertion failure during checkcast handling for abstract values of unique concrete value type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-04-11
  • Updated: 2025-04-14
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
Relates :  
Description
(gdb) ssl
Detaching from program: /home/jatinbha/sandboxes/lworld/build/linux-x86_64-server-slowdebug/images/jdk/bin/java, process 2607242
[Inferior 1 (process 2607242) detached]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/jatinbha/sandboxes/lworld/src/hotspot/share/opto/graphKit.cpp:3553), pid=2607242, tid=2607271
#  assert(stopped() || !toop->is_inlinetypeptr() || obj->is_InlineType()) failed: should have been scalarized
#
# JRE version: OpenJDK Runtime Environment (25.0) (slowdebug build 25-internal-adhoc.root.lworld)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 25-internal-adhoc.root.lworld, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x112834b]  GraphKit::gen_checkcast(Node*, Node*, Node**, bool)+0x483

Test case:-


import jdk.internal.misc.*;

value abstract  class MyAbsValue {

}

value class MyValue extends MyAbsValue {
    public float field1;
    public float field2;
    public float field3;
    public float field4;
    public MyValue(float f1, float f2, float f3, float f4) {
        this.field1 = f1;
        this.field2 = f2;
        this.field3 = f3;
        this.field4 = f4;
    }
    public float getAccum() {
        return this.field1 + this.field2 + this.field3 + this.field4;
    }
}

public class test_osr_flow {
    public static Unsafe UNSAFE = Unsafe.getUnsafe();

    public static float micro(MyAbsValue obj) {
        obj = UNSAFE.makePrivateBuffer(obj);
        float res = 0.0f;
        for (int i = 0; i < 100000; i++) {
           res += UNSAFE.getFloat(obj, 12 + ((i * Float.BYTES) & 15));
           UNSAFE.putFloat(obj, 12 + ((i * Float.BYTES) & 15), res);
        }
        obj = UNSAFE.finishPrivateBuffer(obj);
        return res;
    }

    public static void main(String [] args) {
        MyAbsValue obj = new MyValue(10.0f, 20.0f, 30.0f, 40.0f);
        System.out.println("[res] " + micro(obj));
    }
}

Comand Line:
java --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED -XX:-TieredCompilation -Xbatch -XX:+TraceTypeProfile -XX:CompileCommand=compileonly,test_osr_flow::micro --enable-preview  -cp .  test_osr_flow
Comments
Hi [~qamai], this looks related to your recent fix for larval handling. Kindly check. Best Regards
11-04-2025