Skip to content

Commit 65e9f98

Browse files
committed
[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 llvm-svn: 354522
1 parent a946d05 commit 65e9f98

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

compiler-rt/lib/lsan/lsan.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ void GetStackTrace(__sanitizer::BufferedStackTrace *stack,
4949
__sanitizer::uptr bp, void *context, bool fast) {
5050
uptr stack_top = 0, stack_bottom = 0;
5151
ThreadContext *t;
52-
if (fast && (t = CurrentThreadContext())) {
52+
if (__sanitizer::StackTrace::WillUseFastUnwind(fast) &&
53+
(t = CurrentThreadContext())) {
5354
stack_top = t->stack_end();
5455
stack_bottom = t->stack_begin();
5556
}

compiler-rt/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
22
// RUN: %env_tool_opts=stack_trace_format='"frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
33

4-
// FIXME(dliew): Make this test work on Darwin with LSan
5-
// XFAIL: darwin && lsan
6-
74
#include <sanitizer/common_interface_defs.h>
85

96
static inline void FooBarBaz() {

compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// XFAIL: netbsd && !asan
1212

1313
// FIXME(dliew): Make this test work with other sanitizers
14-
// XFAIL: darwin && (lsan || tsan || ubsan)
14+
// XFAIL: darwin && (tsan || ubsan)
1515

1616
volatile int *null = 0;
1717

compiler-rt/test/sanitizer_common/TestCases/symbolize_stack.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Test that symbolizer does not crash on frame with large function name.
44

5-
// FIXME(dliew): Make this test work on Darwin with LSan
5+
// On Darwin LSan reports a false positive
66
// XFAIL: darwin && lsan
77

88
#include <sanitizer/common_interface_defs.h>

0 commit comments

Comments
 (0)