JDK-8280353 : -XX:ArchiveClassesAtExit should print warning if base archive failed to load
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-20
  • Updated: 2022-01-31
  • Resolved: 2022-01-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19 masterFixed
Related Reports
Relates :  
Relates :  
Description
Before JDK-8261455:

$ java -XX:+UseCompressedOops -XX:SharedArchiveFile=foo.jsa -Xshare:dump 
$ java -XX:-UseCompressedOops -XX:SharedArchiveFile=foo.jsa -XX:ArchiveClassesAtExit=bar.jsa  -version
Error occurred during initialization of VM
-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info.

After JDK-8261455:
$ java -XX:+UseCompressedOops -XX:SharedArchiveFile=foo.jsa -Xshare:dump 
$ java -XX:-UseCompressedOops -XX:SharedArchiveFile=foo.jsa -XX:ArchiveClassesAtExit=bar.jsa  -version
java version "19-internal" 2022-09-20
Java(TM) SE Runtime Environment (build 19-internal+0-adhoc.iklam.open)
Java HotSpot(TM) 64-Bit Server VM (build 19-internal+0-adhoc.iklam.open, mixed mode)
$ ls -l bar.jsa
ls: cannot access 'bar.jsa': No such file or directory



Comments
Changeset: a3a0dcd9 Author: Yumin Qi <minqi@openjdk.org> Date: 2022-01-27 18:58:49 +0000 URL: https://git.openjdk.java.net/jdk/commit/a3a0dcd9215beb6baf43c6e94f8e16fb6a2ccf68
27-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7241 Date: 2022-01-27 04:48:37 +0000
27-01-2022

A warning message should be printed "-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."
26-01-2022

Before fix the message is not correct, since java -XX:-UseCompressedOops -XX:SharedArchiveFile=foo.jsa -XX:ArchiveClassesAtExit=bar.jsa -version the mode is 'auto' --- if foo.jsa could not be mapped, CDS is disabled and no share, it should continue without sharing. After fix, it continues without sharing. Since foo.jsa could not be mapped, bar.jsa will not be generated.
26-01-2022