RFR: 8308387: CLD created and unloading list sharing _next node pointer leads to concurrent YC missing CLD roots [v4]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Jun 1 06:41:07 UTC 2023


On Wed, 31 May 2023 20:40:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Looks good. Is there a way to add a test?

The timing window here is really narrow. It requires the young root scan iteration to reach a dead CLD before it is unlinked by the old collection and hold on to it until after it is linked onto the unloading list, the young root scan filters out dead CLDs so this is just a couple of instructions. It is possible to make the the race more reproducible with a couple of sleeps in the VM and running frequent concurrent young collections and class unloading.

There might be a possibility to abstract the linked list implementation and make it mockable in gtests, and then have gtests which stresses concurrent reads and unlinks and asserts invariants. However that would require a rewrite that does not feel worth it.

> Is the YC in the synopsis meant to be GC? If so please fix in JBS and the PR. Thanks

YC is suppose to abbreviate Young Collection in a generational collector. But maybe YC/OC are not common enough terms to be used in a general bug report. 
I will at least extend the description on JBS to reflect the bug, not just the symptom (the crash).

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

PR Comment: https://git.openjdk.org/jdk/pull/14241#issuecomment-1571445962


More information about the hotspot-runtime-dev mailing list