RFR: 8340420: ZGC: Should call `vm_shutdown_during_initialization` if initialization fails
Axel Boldt-Christmas
aboldtch at openjdk.org
Mon Sep 30 06:40:06 UTC 2024
ZGC does not call `vm_shutdown_during_initialization` if initialization fails during the setup of the CollectedHeap, in contrast to the other GC.
I propose we add a `ZInitialize::error` which we can use during initialisation to record errors. The first error recored is also stored and used as the error message when shutting down the VM.
Initially used malloc to allocate the error (ed9ba5dd6805291a6b1b56566c933424230d3b4a) but feels like it is just better to have static storage for the string and not have to care about malloc potentially failing to allocate.
-------------
Commit messages:
- Avoid malloc
- Add AllStatic and ZInitializer
- 8340420: ZGC: Should call `vm_shutdown_during_initialization` if initialization fails
Changes: https://git.openjdk.org/jdk/pull/21254/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21254&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8340420
Stats: 118 lines in 9 files changed: 91 ins; 2 del; 25 mod
Patch: https://git.openjdk.org/jdk/pull/21254.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21254/head:pull/21254
PR: https://git.openjdk.org/jdk/pull/21254
More information about the hotspot-dev
mailing list