RFR: 8285914: AppCDS crash when using shared archive with old class file from JUnit

David Holmes dholmes at openjdk.java.net
Thu May 5 04:59:23 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).

Thanks for the explanation Calvin, so it is not the nest-host that is old, but an interface implemented by the nest-host. The old interface prevents the nest-host from being archived and so the lambda-proxy also should not (can not) be archived. So this is really just a general constraint on class archiving: if a class A has a nest-host B, and B can not be archived, then A can not be archived. Is that correct? Or is there some reason this only affects lambda-proxy classes?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8540


More information about the hotspot-runtime-dev mailing list