[master] RFR: Fix self-forwarding on 32 bit platforms

Aleksey Shipilev shade at openjdk.java.net
Fri Oct 15 11:09:10 UTC 2021


On Fri, 15 Oct 2021 10:49:16 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Self-forwarding as implemented by #10 uses the 3rd header bit to indicate self-forwarded object. However, on 32bit platforms, oops are only 4-byte-aligned, and a regular forwarding may set the 3rd bit, and thus make it look like self-forwarded. This breaks one of the gtests, and potentially causes severe heap corruption. OTOH, on 32 bit platforms we don't need to preserve the upper header bits, and can therefore use regular forwarding mechanism to do self-forwarding (as it was before #10).
> 
> The change also changes the test_preservedMarks.cpp gtest to install 0b1 as original mark, not 0b11 which would also look like a forwarded object. It has not caused failure because it was not tested before the forwarding gets installed, but is wrong nonetheless.
> 
> Testing:
>  - [x] gtest (which was failing before)
>  - [x] tier1
>  - [x] tier2
>  - [x] hotspot_gc

Looks fine.

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

Marked as reviewed by shade (Committer).

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


More information about the lilliput-dev mailing list