[compiler-rt] r354522 - [LSan] Fix `__sanitizer_print_stack_trace` via fast unwinder

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 14:28:11 PST 2019


Author: yln
Date: Wed Feb 20 14:28:11 2019
New Revision: 354522

URL: http://llvm.org/viewvc/llvm-project?rev=354522&view=rev
Log:
[LSan] Fix `__sanitizer_print_stack_trace` via fast unwinder

Summary: Quick follow-up to: https://reviews.llvm.org/D58156

Reviewers: vitalybuka

Differential Revision: https://reviews.llvm.org/D58358

Modified:
    compiler-rt/trunk/lib/lsan/lsan.h
    compiler-rt/trunk/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
    compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
    compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_stack.cc

Modified: compiler-rt/trunk/lib/lsan/lsan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan.h?rev=354522&r1=354521&r2=354522&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan.h (original)
+++ compiler-rt/trunk/lib/lsan/lsan.h Wed Feb 20 14:28:11 2019
@@ -49,7 +49,8 @@ void GetStackTrace(__sanitizer::Buffered
                    __sanitizer::uptr bp, void *context, bool fast) {
   uptr stack_top = 0, stack_bottom = 0;
   ThreadContext *t;
-  if (fast && (t = CurrentThreadContext())) {
+  if (__sanitizer::StackTrace::WillUseFastUnwind(fast) &&
+      (t = CurrentThreadContext())) {
     stack_top = t->stack_end();
     stack_bottom = t->stack_begin();
   }

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc?rev=354522&r1=354521&r2=354522&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc Wed Feb 20 14:28:11 2019
@@ -1,9 +1,6 @@
 // RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
 // RUN: %env_tool_opts=stack_trace_format='"frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
 
-// FIXME(dliew): Make this test work on Darwin with LSan
-// XFAIL: darwin && lsan
-
 #include <sanitizer/common_interface_defs.h>
 
 static inline void FooBarBaz() {

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc?rev=354522&r1=354521&r2=354522&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc Wed Feb 20 14:28:11 2019
@@ -11,7 +11,7 @@
 // XFAIL: netbsd && !asan
 
 // FIXME(dliew): Make this test work with other sanitizers
-// XFAIL: darwin && (lsan || tsan || ubsan)
+// XFAIL: darwin && (tsan || ubsan)
 
 volatile int *null = 0;
 

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_stack.cc?rev=354522&r1=354521&r2=354522&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_stack.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_stack.cc Wed Feb 20 14:28:11 2019
@@ -2,7 +2,7 @@
 
 // Test that symbolizer does not crash on frame with large function name.
 
-// FIXME(dliew): Make this test work on Darwin with LSan
+// On Darwin LSan reports a false positive
 // XFAIL: darwin && lsan
 
 #include <sanitizer/common_interface_defs.h>




More information about the llvm-commits mailing list