Skip to content

Commit f9bb367

Browse files
author
Thomas Schatzl
committed
8291653: G1 refinement incorrectly expects always-valid HeapRegion out of the Hot Card Cache
Reviewed-by: kbarrett, ayang
1 parent b17a745 commit f9bb367

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hotspot/share/gc/g1/g1RemSet.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1668,12 +1668,13 @@ bool G1RemSet::clean_card_before_refine(CardValue** const card_ptr_addr) {
16681668
} else if (card_ptr != orig_card_ptr) {
16691669
// Original card was inserted and an old card was evicted.
16701670
start = _ct->addr_for(card_ptr);
1671-
r = _g1h->heap_region_containing(start);
1671+
r = _g1h->heap_region_containing_or_null(start);
16721672

16731673
// Check whether the region formerly in the cache should be
16741674
// ignored, as discussed earlier for the original card. The
1675-
// region could have been freed while in the cache.
1676-
if (!r->is_old_or_humongous_or_archive()) {
1675+
// region could have been freed (or even uncommitted) while
1676+
// in the cache.
1677+
if (r == nullptr || !r->is_old_or_humongous_or_archive()) {
16771678
return false;
16781679
}
16791680
*card_ptr_addr = card_ptr;

0 commit comments

Comments
 (0)