RFR: 8373411: Crash when PrintSharedArchiveAndExit is enabled but shared heap is disabled

Aleksey Shipilev shade at openjdk.org
Thu Dec 11 09:46:21 UTC 2025


On Thu, 11 Dec 2025 08:56:54 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> Personally, I think it is redundant, because the second assert would catch a failure of the first. But if you all think this is better, then I'll add it.

Meh, can go either way. I won't quibble for this patch.

Honestly, my expectation is that when `HeapShared::is_loading_mapping_mode() == true`, then  `HeapShared::is_loading() == true`, and when `is_loading_mapping_mode() == false`, then `is_loading()` is undefined/dont-care value. In that sense, current code that checks only `HeapShared::is_loading_mapping_mode()` would have been correct already. But I am guessing you don't want to miss a bug when `is_loading_mapping_mode()` returns `false`, just because we have a lifecycle bug somewhere and loading mode is uninitialized. OTOH, it is literally the same as checking `is_loading()` explicitly like your PR does, so it gains us nothing safety-wise, and only confuses ourselves. Maybe rethinking the state machinery a bit here would be a good cleanup.

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

PR Comment: https://git.openjdk.org/jdk/pull/28741#issuecomment-3641077572


More information about the hotspot-runtime-dev mailing list