RFR: 8335395: G1: Verification does not detect references into Free regions
Thomas Schatzl
tschatzl at openjdk.org
Tue Jul 2 10:33:17 UTC 2024
On Tue, 2 Jul 2024 08:50:14 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> > references into free regions were inadvertedly considered as live
>
> Can you provide an running example to illustrate when/how this occurs? To me, `G1CollectedHeap::is_obj_dead` should have `!hs->free()` as precondition... How come the caller can hold such an invalid pointer?
This occurs in error conditions where the VM/compiler misses some roots after some (internal) changes and incorrectly reclaims regions. I.e. this is purely about heap verification not handling this situation well.
E.g. in case of debug builds it would fail elsewhere (when verifying the classes of referenced objects).
I am open to changing the check in `is_obj_dead` to an assert, making this explicit, and handling this in the `LiveChecker`/verification code to (effectively) print a nice failure message.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19983#issuecomment-2202683465
More information about the hotspot-gc-dev
mailing list