RFR: 8287869: -XX:+AutoCreateSharedArchive doesn't work when JDK build is switched [v3]

Calvin Cheung ccheung at openjdk.java.net
Tue Jun 7 16:02:26 UTC 2022


On Tue, 7 Jun 2022 04:56:18 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> When you switch to a different build of the JDK (to a different version, or from product to debug), `-XX:+AutoCreateSharedArchive` should automatically regenerate the dynamic CDS archive.
>> 
>> However, we have a bug where the information about the base archive is incorrectly stored in the dynamic archive. As a result, the new JDK will try to load the default base archive from the old JDK, causing CDS to be disabled, which means that the dynamic CDS archive cannot be generated at VM exit.
>> 
>> The fix is to correctly set `GenericCDSFileMapHeader::__base_archive_name_{offset,size}` to zero when the default base archive is used.
>> 
>> (Currently the fix can be validated only manually -- see JBS bug report. We are looking into a way to test this scenario automatically in the CI).
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixed trailing whitespace

LGTM

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

Marked as reviewed by ccheung (Reviewer).

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


More information about the hotspot-runtime-dev mailing list