[PATCH] Only use fast stack unwinding for sanitizers failure reports on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Tue Jul 8 05:35:54 PDT 2014


Hi kcc, samsonov,

http://reviews.llvm.org/D4420

Files:
  lib/sanitizer_common/sanitizer_stacktrace.h

Index: lib/sanitizer_common/sanitizer_stacktrace.h
===================================================================
--- lib/sanitizer_common/sanitizer_stacktrace.h
+++ lib/sanitizer_common/sanitizer_stacktrace.h
@@ -52,9 +52,12 @@
 
   static bool WillUseFastUnwind(bool request_fast_unwind) {
     // Check if fast unwind is available. Fast unwind is the only option on Mac.
+    // It is also the only option on FreeBSD as the slow unwinding that
+    // leverages _Unwind_Backtrace() yields the call stack of the signal's
+    // handler and not of the code that raised the signal (as it does on Linux).
     if (!SANITIZER_CAN_FAST_UNWIND)
       return false;
-    else if (SANITIZER_MAC)
+    else if (SANITIZER_MAC != 0 || SANITIZER_FREEBSD != 0)
       return true;
     return request_fast_unwind;
   }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4420.11157.patch
Type: text/x-patch
Size: 815 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140708/54601925/attachment.bin>


More information about the llvm-commits mailing list