Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8335395: G1: Verification does not detect references into Free regions #19983

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp
Original file line number Diff line number Diff line change
@@ -253,6 +253,7 @@ inline bool G1CollectedHeap::is_obj_filler(const oop obj) {
}

inline bool G1CollectedHeap::is_obj_dead(const oop obj, const G1HeapRegion* hr) const {
assert(!hr->is_free(), "looking up obj " PTR_FORMAT " in Free region %u", p2i(obj), hr->hrm_index());
if (hr->is_in_parsable_area(obj)) {
// This object is in the parsable part of the heap, live unless scrubbed.
return is_obj_filler(obj);
5 changes: 4 additions & 1 deletion src/hotspot/share/gc/g1/g1HeapRegion.cpp
Original file line number Diff line number Diff line change
@@ -547,7 +547,10 @@ class G1VerifyLiveAndRemSetClosure : public BasicOopIterateClosure {
}

bool failed() const {
return !_is_in_heap || this->_g1h->is_obj_dead_cond(this->_obj, _vo);
return !_is_in_heap ||
// is_obj_dead* assume that obj is not in a Free region.
this->_g1h->heap_region_containing(this->_obj)->is_free() ||
this->_g1h->is_obj_dead_cond(this->_obj, _vo);
}

void report_error() {