8277434: tests fail with "assert(is_forwarded()) failed: only decode when actually forwarded"

Reviewed-by: ayang, shade, tschatzl
This commit is contained in:
Kim Barrett 2021-11-30 20:22:35 +00:00
parent 21d9ca6cd9
commit 15a680647c
3 changed files with 6 additions and 4 deletions

View File

@ -482,6 +482,10 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
const oop obj = cast_to_oop(obj_ptr);
// Because the forwarding is done with memory_order_relaxed there is no
// ordering with the above copy. Clients that get the forwardee must not
// examine its contents without other synchronization, since the contents
// may not be up to date for them.
const oop forward_ptr = old->forward_to_atomic(obj, old_mark, memory_order_relaxed);
if (forward_ptr == NULL) {

View File

@ -111,9 +111,9 @@ template <class T> void G1ParScanThreadState::write_ref_field_post(T* p, oop obj
// References to the current collection set are references to objects that failed
// evacuation. Currently these regions are always relabelled as old without
// remembered sets, so skip them.
assert(dest_attr.is_in_cset() == (obj->is_forwarded() && obj->forwardee() == obj),
"Only evac-failed objects must be in the collection set here but " PTR_FORMAT " is not", p2i(obj));
if (dest_attr.is_in_cset()) {
assert(obj->is_forwarded(), "evac-failed but not forwarded: " PTR_FORMAT, p2i(obj));
assert(obj->forwardee() == obj, "evac-failed but not self-forwarded: " PTR_FORMAT, p2i(obj));
return;
}
enqueue_card_if_tracked(dest_attr, p, obj);

View File

@ -89,8 +89,6 @@ gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all
gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8241293 macosx-x64
applications/jcstress/acqrel.java 8277434 linux-aarch64
#############################################################################
# :hotspot_runtime