diff options
author | Sagar Thakur <sagar.thakur@imgtec.com> | 2016-04-19 06:00:35 +0000 |
---|---|---|
committer | Sagar Thakur <sagar.thakur@imgtec.com> | 2016-04-19 06:00:35 +0000 |
commit | 377ab596ed448aaed44c66179d4d00411bf9a45e (patch) | |
tree | e722c67e3c4ad476fa07fe43cad77e18c09e0002 /lib/lsan | |
parent | de3d40e84dc22a9f116b60ac1f13fd1fdb853b2e (diff) |
[LSAN] Fix test swapcontext.cc on MIPS
Summary: There is no frame validity check in the slow unwinder like there is in the fast unwinder due to which lsan reports a leak even for heap allocated coroutine in the test swapcontext.cc. Since mips/linux uses slow unwindwer instead of fast unwinder, the test fails for mips/linux. Therefore adding the checks before unwinding fixes the test for mips/linux.
Reviewers: samsonov, earthdok, kcc
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential: http://reviews.llvm.org/D18690
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/lsan')
-rw-r--r-- | lib/lsan/lsan.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/lsan/lsan.h b/lib/lsan/lsan.h index 53783cdc9..f6f7a1b10 100644 --- a/lib/lsan/lsan.h +++ b/lib/lsan/lsan.h @@ -20,12 +20,14 @@ { \ uptr stack_top = 0, stack_bottom = 0; \ ThreadContext *t; \ - if (fast && (t = CurrentThreadContext())) { \ + if ((t = CurrentThreadContext())) { \ stack_top = t->stack_end(); \ stack_bottom = t->stack_begin(); \ } \ - stack.Unwind(max_size, StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ - /* context */ 0, stack_top, stack_bottom, fast); \ + if (IsValidFrame(GET_CURRENT_FRAME(), stack_top, stack_bottom)) { \ + stack.Unwind(max_size, StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ + /* context */ 0, stack_top, stack_bottom, fast); \ + } \ } #define GET_STACK_TRACE_FATAL \ |