Skip to content

Commit

Permalink
[LSan] Fix __sanitizer_print_stack_trace via fast unwinder
Browse files Browse the repository at this point in the history
Summary: Quick follow-up to: https://reviews.llvm.org/D58156

Reviewers: vitalybuka

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

llvm-svn: 354522
  • Loading branch information
yln committed Feb 20, 2019
1 parent a946d05 commit 65e9f98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion compiler-rt/lib/lsan/lsan.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ void GetStackTrace(__sanitizer::BufferedStackTrace *stack,
__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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 65e9f98

Please sign in to comment.