RFR: 8285914: AppCDS crash when using shared archive with old class file from JUnit
Calvin Cheung
ccheung at openjdk.java.net
Thu May 5 04:44:17 UTC 2022
On Wed, 4 May 2022 18:20:14 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
> Please review this change for an additional check before archiving a lambda proxy class. If the nest host of an lambda proxy class cannot be verified during dump time due to its major version is < JDK_6 (50), the lambda proxy class should not be archived. This avoids accessing a null nest host during runtime while loading the lambda proxy class from the CDS archive.
>
> Passed the test in the bug report.
>
> Passed CI tiers 1 - 4 testing (including the new tests).
Hi David,
The `ChildOldInf` class of the test case has an inner class `InnerChild`. A lambda proxy class will be generated if the `doTest` method is called. The nest host of the lambda proxy class is `ChildOldInf` which extends an old interface `OldInf`. So the nest host is considered old.
The test case is just a simplified version of the test in the bug report.
The `ChildOldInf` corresponds to the `JsaCrash` in the bug report test case;
the `ChildOldInf$InnerChild` corresponds to the `JsaCrash$Builder`.
`public class JsaCrash implements TestRule`
`TestRule` is an old class.
Thanks,
Calvin
-------------
PR: https://git.openjdk.java.net/jdk/pull/8540
More information about the hotspot-runtime-dev
mailing list