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

Thomas Schatzl tschatzl at openjdk.org
Wed Aug 3 12:29:07 UTC 2022


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

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

Commit messages:
 - Initial version

Changes: https://git.openjdk.org/jdk/pull/9724/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9724&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8291653
  Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/9724.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9724/head:pull/9724

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



More information about the hotspot-gc-dev mailing list