RFR: 8305903: Deflate monitors of dead objects before they become unreachable

David Holmes dholmes at openjdk.org
Tue May 2 07:53:14 UTC 2023


On Fri, 28 Apr 2023 14:51:54 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> With compact object headers ([JDK-8305895](https://bugs.openjdk.org/browse/JDK-8305895)), I've seen occasional failures in G1, where the refinement thread tries to parse a heap region that has dead objects, and would sometimes see an object with a monitor that has already been deflated. And because deflation does not bother to restore the header of dead objects, when heap iteration tries to load the Klass* of the dead object, it would reach to unknown memory and crash.
> 
> The fix is to restore the header of dead objects just before they become unreachable. This can be done in the closures used by WeakProcessor::weak_oops_do(), right before the weak root will be cleared.
> 
> Notice that this is only a bug with compact object headers. It doesn't hurt to fix this in general, though.
> 
> Testing:
>  - [x] tier1
>  - [x] tier2

Sorry I don't understand: how can we deflate and delete the monitor, yet not update the object header?

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

PR Comment: https://git.openjdk.org/jdk/pull/13721#issuecomment-1531034075


More information about the hotspot-dev mailing list