[master] RFR: Deflate monitors of dead objects before they become unreachable

Aleksey Shipilev shade at openjdk.java.net
Tue Nov 30 10:16:41 UTC 2021


On Wed, 17 Nov 2021 21:49:50 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> 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, 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.
> 
> Testing:
>  - [x] tier1
>  - [x] tier2
>  - [x] tier3
>  - [ ] tier4

Well, the fix looks okay for the explanation.

But I do wonder. Is this affecting mainline too? How's Lilliput different that it encounters this bug? Should G1 even touch dead objects at all? I'd assume the object contents (including mark word) are generally garbage at that point?

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

PR: https://git.openjdk.java.net/lilliput/pull/28


More information about the lilliput-dev mailing list