JDK-8349009 : JVM fails to start when AOTClassLinking is used with unverifiable old classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24,25
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-30
  • Updated: 2025-02-10
  • Resolved: 2025-01-30
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 24 JDK 25
24Fixed 25 b09Fixed
Related Reports
Relates :  
Description
If an application runs with an AOTCache produced with -XX:+AOTClassLinking, and the app contains code like this, where BadOldClassA is below version 50, and 

        Class c = BadOldClassA.class;
        Object n = new Object();
        if (c.isInstance(n)) {
            throw new RuntimeException("Must not succeed");
        }

The application will fail during JVM bootstrap:

[0.225s][error][cds         ] java.lang.VerifyError: (class: BadOldClassA, method: doit signature: ()Ljava/lang/String;) Wrong return type in function
Error occurred during initialization of VM
Unexpected exception when loading aot-linked classes.
=============================
Work-around: use -XX:-AOTClassLinking if your application contains unverifiable classes (or don't run such applications!)
Comments
A pull request was submitted for review. Branch: jdk24 URL: https://git.openjdk.org/jdk/pull/23372 Date: 2025-01-30 16:35:48 +0000
30-01-2025

Changeset: 1ac2d6e0 Branch: master Author: Ioi Lam <iklam@openjdk.org> Date: 2025-01-30 16:21:57 +0000 URL: https://git.openjdk.org/jdk/commit/1ac2d6e0fb3d503241af1a44c9ed65837c63b646
30-01-2025

Fix request for JDK 24 approved.
30-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23361 Date: 2025-01-30 02:40:10 +0000
30-01-2025

Fix Request (JDK 24) This fix is necessary for validating JDK-8348752, which has been approved for JDK 24. The fix is low risk as it at most will reduce the number of classes that are stored inside the AOT cache. Fix will be reviewed and tested in tier1-9 + (AOT+JCK) testing, before integration.
30-01-2025

I set priority to P2 as this bug causes many failures during test execution after JDK-8348752 is fixed, so it's a blocker for validating the JDK-8348752 fix. Note -- the fix is simple; {JDK-8348752 + this fix} allows testing to proceed.
30-01-2025