diff --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp --- a/compiler-rt/lib/hwasan/hwasan_report.cpp +++ b/compiler-rt/lib/hwasan/hwasan_report.cpp @@ -547,6 +547,12 @@ Report("ERROR: %s: %s; heap object [%p,%p) of size %zd\n", SanitizerToolName, bug_type, untagged_addr, untagged_addr + orig_size, orig_size); Printf("\n%s", d.Default()); + Printf( + "Stack of invalid access unknown. Issue detected at deallocation " + "time.\n"); + Printf("%s", d.Allocation()); + Printf("deallocated here:\n"); + Printf("%s", d.Default()); stack->Print(); HwasanChunkView chunk = FindHeapChunkByAddress(untagged_addr); if (chunk.Beg()) { diff --git a/compiler-rt/test/hwasan/TestCases/tail-magic.c b/compiler-rt/test/hwasan/TestCases/tail-magic.c --- a/compiler-rt/test/hwasan/TestCases/tail-magic.c +++ b/compiler-rt/test/hwasan/TestCases/tail-magic.c @@ -27,8 +27,10 @@ overwrite_tail(); free(p); // CHECK: ERROR: HWAddressSanitizer: allocation-tail-overwritten; heap object [{{.*}}) of size 20 -// CHECK: in main {{.*}}tail-magic.c:[[@LINE-2]] +// CHECK: Stack of invalid access unknown. Issue detected at deallocation time. +// CHECK: deallocated here: +// CHECK: in main {{.*}}tail-magic.c:[[@LINE-4]] // CHECK: allocated here: -// CHECK: in main {{.*}}tail-magic.c:[[@LINE-7]] +// CHECK: in main {{.*}}tail-magic.c:[[@LINE-9]] // CHECK: Tail contains: .. .. .. .. 42 {{.. .. ..}} 66 }