Skip to content

Commit 2fe0bf6

Browse files
committedFeb 15, 2022
8281748: runtime/logging/RedefineClasses.java failed "assert(addr != __null) failed: invariant"
Reviewed-by: ayang, kbarrett
1 parent bc61484 commit 2fe0bf6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@
4141
#include "utilities/bitMap.inline.hpp"
4242

4343
inline bool G1CMIsAliveClosure::do_object_b(oop obj) {
44-
HeapRegion* hr = _g1h->heap_region_containing(cast_from_oop<HeapWord*>(obj));
44+
// Check whether the passed in object is null. During discovery the referent
45+
// may be cleared between the initial check and being passed in here.
46+
if (obj == NULL) {
47+
// Return true to avoid discovery when the referent is NULL.
48+
return true;
49+
}
4550

51+
HeapRegion* hr = _g1h->heap_region_containing(cast_from_oop<HeapWord*>(obj));
4652
// All objects allocated since the start of marking are considered live.
4753
if (hr->obj_allocated_since_next_marking(obj)) {
4854
return true;

0 commit comments

Comments
 (0)
Please sign in to comment.