Reorder debug logging statements when marking a reference in an unused region.
Crash reports do not always contain the full logs and sometimes only
show the first line printed with level FATAL. Reorder debug logging to
dump essential information about the faulty reference first.
Test: art/test.py
Bug: 75967215
Change-Id: I3a2448bcf5b3a097fb69fa6137c37e51fe3a97a0
diff --git a/runtime/gc/collector/concurrent_copying-inl.h b/runtime/gc/collector/concurrent_copying-inl.h
index 6e345fb..b331e97 100644
--- a/runtime/gc/collector/concurrent_copying-inl.h
+++ b/runtime/gc/collector/concurrent_copying-inl.h
@@ -146,8 +146,8 @@
return MarkUnevacFromSpaceRegion(from_ref, region_space_bitmap_);
default:
// The reference is in an unused region.
- region_space_->DumpNonFreeRegions(LOG_STREAM(FATAL_WITHOUT_ABORT));
LOG(FATAL_WITHOUT_ABORT) << DumpHeapReference(holder, offset, from_ref);
+ region_space_->DumpNonFreeRegions(LOG_STREAM(FATAL_WITHOUT_ABORT));
heap_->GetVerification()->LogHeapCorruption(holder, offset, from_ref, /* fatal */ true);
UNREACHABLE();
}