RFR: 8341020: Error handler crashes when Metaspace is not fully initialized [v2]

Aleksey Shipilev shade at openjdk.org
Thu Oct 17 14:34:48 UTC 2024


> When debugging CDS, I asked for `os::print_location` when Metaspace was not completely initialized. I suspect the same might happen if error handler fires very early in startup sequence.
> 
> `os::print_location` got to `Metaspace::contains`, which ended up in `Metaspace::is_in_nonclass_metaspace`, which crashed, since `VirtualSpaceList` was null. Other checks in `Metaspace::contains` seem to only check the address against the boundaries, and are not affected.
> 
> Additional testing:
>  - [x] The same debugging session did not crash the VM after the patch

Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Just check in error handler
 - Merge branch 'master' into JDK-8341020-metaspace-crash
 - Fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21206/files
  - new: https://git.openjdk.org/jdk/pull/21206/files/7efa13b9..3769ca28

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21206&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21206&range=00-01

  Stats: 84523 lines in 1498 files changed: 68148 ins; 8791 del; 7584 mod
  Patch: https://git.openjdk.org/jdk/pull/21206.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21206/head:pull/21206

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


More information about the hotspot-runtime-dev mailing list