RFR: 8292269: Log more CDS failure messages in the warning channel [v6]

Ioi Lam iklam at openjdk.org
Mon Feb 20 05:48:25 UTC 2023


On Mon, 20 Feb 2023 04:25:45 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Why do the tests now explicitly need -Xshare:auto?

That was my suggestion to Matias, but I realized there's a better way to do it. My new suggestion is here:

- https://github.com/iklam/jdk/commit/3cbad64a730f88572ea566b6993917c9dc43cb2d

Background: there are two kinds of CDS mapping errors: soft and hard.

- You can have a soft error if a command-line VM option is incompatible with the CDS archive. For example, the default CDS archive is dumped with `-XX:+CompactStrings`, so it cannot be loaded if you run `java -XX:-CompactStrings ...`
- You can have a hard error if there's something wrong with the archive. E.g., it's been corrupted and CRC check fails

Before this PR, both soft and hard errors are logged to stderr when `-Xshare:on` is specified.

In the PR, we have chosen to log the soft errors to the `info` channel. The reason is to avoid excessive warning messages.

Some of the CDS tests check for the soft errors. Before this PR, these tests would find the expected messages in stderr. After this PR, we need to explicitly add `-Xlog:cds` to the command-line (See the above commit).

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

PR: https://git.openjdk.org/jdk/pull/12419


More information about the hotspot-runtime-dev mailing list