summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/gc/collector/concurrent_copying.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 3ac2486db4..3a800088ba 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -643,9 +643,16 @@ class ConcurrentCopying::VerifyNoMissingCardMarkVisitor {
void CheckReference(mirror::Object* ref, int32_t offset = -1) const
REQUIRES_SHARED(Locks::mutator_lock_) {
- CHECK(ref == nullptr || !cc_->region_space_->IsInNewlyAllocatedRegion(ref))
+ if (ref != nullptr && cc_->region_space_->IsInNewlyAllocatedRegion(ref)) {
+ LOG(FATAL_WITHOUT_ABORT)
<< holder_->PrettyTypeOf() << "(" << holder_.Ptr() << ") references object "
<< ref->PrettyTypeOf() << "(" << ref << ") in newly allocated region at offset=" << offset;
+ LOG(FATAL_WITHOUT_ABORT) << "time=" << cc_->region_space_->Time();
+ constexpr const char* kIndent = " ";
+ LOG(FATAL_WITHOUT_ABORT) << cc_->DumpReferenceInfo(holder_.Ptr(), "holder_", kIndent);
+ LOG(FATAL_WITHOUT_ABORT) << cc_->DumpReferenceInfo(ref, "ref", kIndent);
+ LOG(FATAL) << "Unexpected reference to newly allocated region.";
+ }
}
private: