Skip to content

Commit

Permalink
[hwasan] Separate sections in report (#76130)
Browse files Browse the repository at this point in the history
It makes them easier to read.
  • Loading branch information
vitalybuka committed Dec 21, 2023
1 parent 1830fad commit 528150b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compiler-rt/lib/hwasan/hwasan_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static void PrintStackAllocations(const StackAllocationsRingBuffer *sa,
if (obj_offset >= local.size)
continue;
if (!found_local) {
Printf("Potentially referenced stack objects:\n");
Printf("\nPotentially referenced stack objects:\n");
found_local = true;
}
Printf(" %s in %s %s:%d\n", local.name, local.function_name,
Expand Down Expand Up @@ -363,7 +363,7 @@ static void PrintTagsAroundAddr(uptr addr, GetTag get_tag,
InternalScopedString s;
addr = MemToShadow(addr);
s.AppendF(
"Memory tags around the buggy address (one tag corresponds to %zd "
"\nMemory tags around the buggy address (one tag corresponds to %zd "
"bytes):\n",
kShadowAlignment);
PrintTagInfoAroundAddr(addr, kShadowLines, s,
Expand Down Expand Up @@ -803,8 +803,10 @@ void BaseReport::PrintAddressDescription() const {
}

// Print the remaining threads, as an extra information, 1 line per thread.
if (flags()->print_live_threads_info)
if (flags()->print_live_threads_info) {
Printf("\n");
hwasanThreadList().VisitAllLiveThreads([&](Thread *t) { t->Announce(); });
}

if (!num_descriptions_printed)
// We exhausted our possibilities. Bail out.
Expand Down Expand Up @@ -1020,7 +1022,7 @@ void ReportTagMismatch(StackTrace *stack, uptr tagged_addr, uptr access_size,
// See the frame breakdown defined in __hwasan_tag_mismatch (from
// hwasan_tag_mismatch_{aarch64,riscv64}.S).
void ReportRegisters(const uptr *frame, uptr pc) {
Printf("Registers where the failure occurred (pc %p):\n", pc);
Printf("\nRegisters where the failure occurred (pc %p):\n", pc);

// We explicitly print a single line (4 registers/line) each iteration to
// reduce the amount of logcat error messages printed. Each Printf() will
Expand Down

0 comments on commit 528150b

Please sign in to comment.