RFR: 8291653: G1 refinement incorrectly expects always-valid HeapRegion out of the Hot Card Cache

Kim Barrett kbarrett at openjdk.org
Fri Aug 5 03:36:51 UTC 2022


On Wed, 3 Aug 2022 11:36:51 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   can I have reviews for this wrong use of `G1CollectedHeap::heap_region_containing` in `G1RemSet::clean_card_before_refine()`?
> 
> If a card is evicted from the hot card cache it might also be located in an outdated (reclaimed) region (by Remark). So the call needs to explicitly consider that case and use `heap_region_containing_or_null` and appropriately check for that later.
> 
> This is only an issue in debug mode, because while still this is kind of an illegal request, the return value will always be a valid `HeapRegion` instance as we never deallocate them.
> 
> Testing: reproduced crashes with the given test case (1:5), no more crashes afterwards.
> 
> Thanks,
>   Thomas

Looks good.

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

Marked as reviewed by kbarrett (Reviewer).

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



More information about the hotspot-gc-dev mailing list