[PATCH] D14656: [sanitizer] Stop unwinding the stack when a close-to-zero PC is found

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 02:25:43 PST 2015


kubabrecka updated this revision to Diff 40259.
kubabrecka added a comment.

Updating patch.


http://reviews.llvm.org/D14656

Files:
  lib/sanitizer_common/sanitizer_stacktrace.cc

Index: lib/sanitizer_common/sanitizer_stacktrace.cc
===================================================================
--- lib/sanitizer_common/sanitizer_stacktrace.cc
+++ lib/sanitizer_common/sanitizer_stacktrace.cc
@@ -71,6 +71,7 @@
 
 void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top,
                                          uptr stack_bottom, u32 max_depth) {
+  const uptr kPageSize = GetPageSizeCached();
   CHECK_GE(max_depth, 2);
   trace_buffer[0] = pc;
   size = 1;
@@ -95,6 +96,8 @@
 #else
     uhwptr pc1 = frame[1];
 #endif
+    if (pc1 < kPageSize)
+      break;
     if (pc1 != pc) {
       trace_buffer[size++] = (uptr) pc1;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14656.40259.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/701878f3/attachment.bin>


More information about the llvm-commits mailing list