Integrated: 8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects

Erik Österlund eosterlund at openjdk.org
Tue Dec 19 13:51:56 UTC 2023


On Mon, 18 Dec 2023 12:51:34 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> When cloning object arrays, we should do something more similar to arraycopy. The intrinsics for C2 already do that, but there are colder paths where the runtime version of cloning is used, and objects being cloned can potentially end up in the old generation. This could hypothetically be a problem if the source object is being concurrently modified by an external thread, storing store good pointers into its elements. Then, the destination array will look like it doesn't need any store barriers, while in fact no entries have been inserted to the remembered set.
> 
> This patch modifies cold object array cloning to be done more like array copy and relaxes the related assert for primitive arrays, which is what triggered the assertion that opened this investigation.
> 
> I have tested generational ZGC tier 1-7, general testing tier 1-5, and confirmed the individual test that triggered the assert triggers without this fix and doesn't trigger with this fix.

This pull request has now been integrated.

Changeset: be49dabd
Author:    Erik Österlund <eosterlund at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/be49dabd0d7e1cd270399849e5353bf33361c4c5
Stats:     31 lines in 3 files changed: 26 ins; 1 del; 4 mod

8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects

Reviewed-by: stefank, sjohanss

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

PR: https://git.openjdk.org/jdk/pull/17141


More information about the hotspot-gc-dev mailing list