summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2020-04-21 12:48:53 -0700
committer Mathieu Chartier <mathieuc@google.com> 2020-04-23 20:01:08 +0000
commit30ac39834fbd7ea276f4dd497f158be03da86249 (patch)
tree3a4fe97f7ab7bad1501b9d583641f582b4c1d81c
parent6127ace4619f735a7f9555947329edddb9e627f9 (diff)
Improve printing for heap verification failures
Avoid printing proc maps since they are already printed in the tombstone. Printing them again may cause truncated output. Change ordering to put important data first since the latter lines are more likely to get truncated. Test: test-art-host-gtest Bug: 139805154 Change-Id: I27a2da4831643fd2eb42f39900f3e3ed98acd04d
-rw-r--r--runtime/gc/verification.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/gc/verification.cc b/runtime/gc/verification.cc
index 8670a22431..9e0b8a2ff1 100644
--- a/runtime/gc/verification.cc
+++ b/runtime/gc/verification.cc
@@ -86,10 +86,7 @@ void Verification::LogHeapCorruption(ObjPtr<mirror::Object> holder,
MemberOffset offset,
mirror::Object* ref,
bool fatal) const {
- // Lowest priority logging first:
- PrintFileToLog("/proc/self/maps", android::base::LogSeverity::FATAL_WITHOUT_ABORT);
- MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse= */ true);
- Runtime::Current()->GetHeap()->DumpSpaces(LOG_STREAM(FATAL_WITHOUT_ABORT));
+ // Highest priority logging first.
// Buffer the output in the string stream since it is more important than the stack traces
// and we want it to have log priority. The stack traces are printed from Runtime::Abort
// which is called from LOG(FATAL) but before the abort message.
@@ -110,6 +107,8 @@ void Verification::LogHeapCorruption(ObjPtr<mirror::Object> holder,
oss << " reference addr"
<< DumpRAMAroundAddress(reinterpret_cast<uintptr_t>(addr), 4 * kObjectAlignment);
}
+ Runtime::Current()->GetHeap()->DumpSpaces(oss);
+ MemMap::DumpMaps(oss, /* terse= */ true);
if (fatal) {
LOG(FATAL) << oss.str();