[PATCH] D58358: [LSan] Fix `__sanitizer_print_stack_trace` via fast unwinder

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 14:30:55 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT354522: [LSan] Fix `__sanitizer_print_stack_trace` via fast unwinder (authored by yln, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58358?vs=187271&id=187678#toc

Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58358

Files:
  lib/lsan/lsan.h
  test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
  test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
  test/sanitizer_common/TestCases/symbolize_stack.cc


Index: test/sanitizer_common/TestCases/symbolize_stack.cc
===================================================================
--- test/sanitizer_common/TestCases/symbolize_stack.cc
+++ test/sanitizer_common/TestCases/symbolize_stack.cc
@@ -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>
Index: test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
===================================================================
--- test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
+++ test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
@@ -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;
 
Index: test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
===================================================================
--- test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
+++ test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
@@ -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() {
Index: lib/lsan/lsan.h
===================================================================
--- lib/lsan/lsan.h
+++ lib/lsan/lsan.h
@@ -49,7 +49,8 @@
                    __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();
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58358.187678.patch
Type: text/x-patch
Size: 2174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190220/f9538abe/attachment.bin>


More information about the llvm-commits mailing list