summaryrefslogtreecommitdiff
path: root/lib/asan/asan_stack.h
AgeCommit message (Collapse)Author
2017-11-09[sanitizers] Rename GetStackTraceWithPcBpAndContextVitaly Buka
Name does not need to enumerate arguments. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[asan] Remove ScopedDeadlySignalVitaly Buka
This is used only to make fast = true in GetStackTraceWithPcBpAndContext on SANITIZER_FREEBSD and SANITIZER_NETBSD and can be done explicitly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01Fix constant-logical-operand warning.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312394 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07Add NetBSD support in asan_stack.hKamil Rytarowski
Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, filcab, fjricci Reviewed By: vitalybuka Subscribers: davide, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36377 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18[LSAN] Fix test swapcontext.cc on MIPSSagar Thakur
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. Reviewed by aizatsky. Differential: http://reviews.llvm.org/D19961 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22Revert "[LSAN] Fix test swapcontext.cc on MIPS"Renato Golin
This reverts commit r266716, as it breaks the self-hosting on Thumb2 buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19[LSAN] Fix test swapcontext.cc on MIPSSagar Thakur
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
2015-10-01[compiler-rt] Apply modernize-use-nullptr fixes in sanitizersVedant Kumar
- Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. - Add blank lines to separate function definitions. - Add 'extern "C"' or 'namespace foo' comments after the appropriate closing brackets This is a continuation of work from 409b7b82. The focus here is on the various sanitizers (not sanitizer_common, as before). Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13225 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248966 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16[ASan] Allow to atomically modify malloc_context_size at runtime.Alexey Samsonov
Summary: Introduce __asan::malloc_context_size atomic that is used to determine required malloc/free stack trace size. It is initialized with common_flags()->malloc_context_size flag, but can later be overwritten at runtime (e.g. when ASan is activated / deactivated). Test Plan: regression test suite Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6645 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25[Asan] Pack signal context into a structureViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6148 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222756 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10[Sanitizers] Enable stack traces on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6086 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-26[Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov
introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14[asan] Add fast_unwind_on_check flag.Evgeniy Stepanov
Allows to specify the unwinder to use for CHECK failures. Previous behaviour was to use the "fatal" unwinder. As compiler-rt is built without frame pointers, only the slow unwinder really makes sense here, and it is the default. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219677 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14[asan] use some LIKELY/UNLIKELYKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208776 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04Fix StackTrace::LocatePcInTrace, add more unit tests for generic StackTraceAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202849 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[ASan] Speed up stack trace unwinding for stacks of size 2.Alexey Samsonov
Summary: We don't need to do any work in this case - just take the current PC and caller PC. Reviewers: eugenis, ygribov Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2936 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202845 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11[sanitizer] Use system unwinder in signal handlers on Android.Evgeniy Stepanov
Because of the way Bionic sets up signal stack frames, libc unwinder is unable to step through it, resulting in broken SEGV stack traces. Luckily, libcorkscrew.so on Android implements an unwinder that can start with a signal context, thus sidestepping the issue. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19[ASan] Get rid of ASan-specific functions for printing stack tracesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197672 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03[sanitizer] Expose __sanitizer_print_stack_trace().Sergey Matveev
Expose a new interface function for debugging code built with sanitizer tools. Add an ASan implementation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196302 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29Fix current stack unwinding when using DRASanTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18[asan] reduce the size of AsanThreadContext by storing the stack trace in ↵Kostya Serebryany
the stack depot git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12[Sanitizer] Turn GetStackTrace() into StackTrace::Unwind()Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192533 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12[asan] Fix deadlock in stack unwinder on android/x86.Evgeniy Stepanov
Fixes PR17116. Patch by 林作健 (manjian2006 at gmail.com). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08[sanitizer] Move GetStackTrace from ASan to sanitizer_common.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181424 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06[asan] Common flags in ASan.Sergey Matveev
Some flags that are common to ASan/MSan/TSan/LSan have been moved to sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181193 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13[asan] add two asan flags: fast_unwind_on_fatal and fast_unwind_on_malloc to ↵Kostya Serebryany
allow using the slow CFI-based unwinder git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170117 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] actually move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162757 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] even more refactoring to move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] more refactoring to move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] some renaming before we move StackTrace into sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-09[ASan] Use common flags parsing machinery.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-25Lots of trivial changes to remove extraneous semicolons throughout ASan.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159128 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15[asan] fix unwinding inside libc intercepors (asan issue #46)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@152768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19EHABI-based stack trace on ARM.Evgeniy Stepanov
The change removes the unused FLAG_fast_unwind, and forces EHABI-based unwind on ARM, and fast (FP-based) unwind everywhere else. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@148468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17AddressSanitizer: create AsanThreadSummary together with AsanThread (in ↵Alexey Samsonov
parent thread) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@148286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30AddressSanitizer run-time library. Not yet integrated with the compiler-rt ↵Kostya Serebryany
build system, but can be built using the old makefile. See details in README.txt git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145463 91177308-0d34-0410-b5e6-96231b3b80d8