[PATCH] D58267: [hwasan] Fix unsymbolized stack history printing.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 15 10:38:15 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL354157: Fix unsymbolized stack history printing. (authored by eugenis, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D58267?vs=186953&id=187042#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58267/new/

https://reviews.llvm.org/D58267

Files:
  compiler-rt/trunk/lib/hwasan/hwasan_report.cc
  compiler-rt/trunk/test/hwasan/TestCases/stack-uar.c


Index: compiler-rt/trunk/test/hwasan/TestCases/stack-uar.c
===================================================================
--- compiler-rt/trunk/test/hwasan/TestCases/stack-uar.c
+++ compiler-rt/trunk/test/hwasan/TestCases/stack-uar.c
@@ -1,5 +1,6 @@
 // Tests use-after-return detection and reporting.
 // RUN: %clang_hwasan -O0 -fno-discard-value-names %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clang_hwasan -O0 -fno-discard-value-names %s -o %t && not %env_hwasan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM
 
 // REQUIRES: stable-runtime
 
@@ -37,5 +38,9 @@
   // CHECK: buggy
   // CHECK: 4096 zzz
 
+  // NOSYM: Previously allocated frames:
+  // NOSYM-NEXT: sp: 0x{{.*}} #0 0x{{.*}} ({{.*}}/stack-uar.c.tmp+0x{{.*}}){{$}}
+  // NOSYM-NEXT: 16 CCC;
+
   // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in main
 }
Index: compiler-rt/trunk/lib/hwasan/hwasan_report.cc
===================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan_report.cc
+++ compiler-rt/trunk/lib/hwasan/hwasan_report.cc
@@ -252,8 +252,8 @@
         uptr pc_mask = (1ULL << 48) - 1;
         uptr pc = record & pc_mask;
         if (SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc)) {
-          frame_desc.append(" sp: 0x%zx pc: %p ", sp, pc);
-          RenderFrame(&frame_desc, "in %f %s:%l\n", 0, frame->info,
+          frame_desc.append(" sp: 0x%zx ", sp);
+          RenderFrame(&frame_desc, "#%n %p %F %L\n", 0, frame->info,
                       common_flags()->symbolize_vs_style,
                       common_flags()->strip_path_prefix);
           frame->ClearAll();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58267.187042.patch
Type: text/x-patch
Size: 1666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190215/7c4a428d/attachment.bin>


More information about the llvm-commits mailing list