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

Ioi Lam iklam at openjdk.java.net
Tue Jun 7 04:25:14 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).

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  Fixed test cases

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/9046/files
  - new: https://git.openjdk.java.net/jdk/pull/9046/files/8eded2fa..560cc6e8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=9046&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=9046&range=00-01

  Stats: 14 lines in 2 files changed: 8 ins; 0 del; 6 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