RFR: 8349009: JVM fails to start when AOTClassLinking is used with unverifiable old classes [v2]
John R Rose
jrose at openjdk.org
Thu Jan 30 03:51:45 UTC 2025
On Thu, 30 Jan 2025 03:27:34 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> During the testing of [JDK-8348752](https://bugs.openjdk.org/browse/JDK-8348752), we notice test failures caused by unverifiable old classes (i.e., classes with bad instructions and major version < 50).
>>
>> The fix is simple. Simply exclude unlinked classes from the AOTCache when `-XX:+AOTClassLinking` is enabled.
>>
>> Verified with JCK.
>
> Ioi Lam has updated the pull request incrementally with two additional commits since the last revision:
>
> - Fixed copyright
> - Fixed typo
Excluding additional classes (under the new mode) is harmless, so this fix is safe.
And anything unlinked in training is surely uninteresting in the AOT linking world, so this fix is beneficial. That goes for classes which attempted linkage and failed, and also classes which never attempt linkage.
In the unit test, the two example classes are both loaded (during training), but only one (BadOldClassB) gets as far as verification. Both are included in the AOT configuration which is emitted by the training run. It is up to the assembly phase to prevent them from reaching the AOT cache.
test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking/BulkLoaderTest.java line 242:
> 240: Class c = BadOldClassA.class;
> 241: Object n = new Object();
> 242: if (c.isInstance(n)) {
`// Note that type-testing BadOldClassA here neither loads nor initailizes it.`
test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking/BulkLoaderTest.java line 255:
> 253: throw new RuntimeException("Must not succeed");
> 254: } catch (VerifyError e) {
> 255: System.out.println("Caught VerifyError for BadOldClassA: " + e);
s/BadOldClassA/BadOldClassB/
-------------
Marked as reviewed by jrose (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/23361#pullrequestreview-2582833833
PR Review Comment: https://git.openjdk.org/jdk/pull/23361#discussion_r1934955627
PR Review Comment: https://git.openjdk.org/jdk/pull/23361#discussion_r1934956094
More information about the hotspot-runtime-dev
mailing list