RFR: 8287869: -XX:+AutoCreateSharedArchive doesn't work when JDK build is switched
Ioi Lam
iklam at openjdk.java.net
Mon Jun 6 22:53:54 UTC 2022
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).
-------------
Commit messages:
- 8287869: -XX:+AutoCreateSharedArchive doesn't work when JDK build is switched
Changes: https://git.openjdk.java.net/jdk/pull/9046/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=9046&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8287869
Stats: 13 lines in 2 files changed: 4 ins; 0 del; 9 mod
Patch: https://git.openjdk.java.net/jdk/pull/9046.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/9046/head:pull/9046
PR: https://git.openjdk.java.net/jdk/pull/9046
More information about the hotspot-runtime-dev
mailing list