summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
AgeCommit message (Collapse)Author
2017-07-10Do not crash with missing symbolication when running in DEDUP modeGeorge Karpenkov
Printing stacktrace from ASAN crashes with a segfault in DEDUP mode when symbolication is missing. Differential Revision: https://reviews.llvm.org/D34914 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05[sanitizers] __sanitizer_get_module_and_offset_for_pc interface functionMike Aizatsky
Summary: The function computes full module name and coverts pc into offset. Reviewers: kcc Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D26820 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19[sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany
__sanitizer_symbolize_global (to avoid conflict with another definition) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19[sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany
globals for now) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[sanitizer] Fixup 2: Do not introduce __sanitizer namespace globallyAnna Zaks
This got committed by mistake. Should fix some bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281668 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks
The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc ↵Kostya Serebryany
(need to put a zero after strncmp). LOL git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25[sanitizer] add __sanitizer_symbolize_pc. ↵Kostya Serebryany
https://github.com/google/sanitizers/issues/322 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28[sanitizers] introduce a common run-time option dedup_token_length to help ↵Kostya Serebryany
with report deduplication, off by default for now. See https://github.com/google/sanitizers/issues/684 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271085 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02[sanitizer] add #ifdefs around slow unwinder to fix OS X debug buildKuba Brecka
A recent change in slow unwinder causes the OS X build to fail when using COMPILER_RT_DEBUG=On. Let's fix this by #ifdef'ing it with #if SANITIZER_CAN_SLOW_UNWIND. See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150622/284294.html Reviewed at http://reviews.llvm.org/D10870 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04[sanitizer_common] Added VS-style output for source locationsFilipe Cabecinhas
Summary: With this patch, we have a flag to toggle displaying source locations in the regular style: file:line:column or Visual Studio style: file(line,column) This way, they get picked up on the Visual Studio output window and one can double-click them to get to that file location. Reviewers: samsonov, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10113 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22[msan] Better use-after-free reports.Evgeniy Stepanov
By attaching an extra integer tag to heap origins, we are able to distinguish between uninits - created by heap allocation, - created by heap deallocation (i.e. use-after-free), - created by __msan_allocated_memory call, - etc. See https://code.google.com/p/memory-sanitizer/issues/detail?id=35. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02Simplify Symbolizer::SymbolizePC() interface.Alexey Samsonov
Return a linked list of AddressInfo objects, instead of using an array of these objects as an output parameter. This simplifies the code in callers of this function (especially TSan). Fix a few memory leaks from internal allocator, when the returned AddressInfo objects were not properly cleared. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223145 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06[Sanitizer] Introduce "stack_trace_format" runtime flag.Alexey Samsonov
This flag can be used to specify the format of stack frames - user can now provide a string with placeholders, which should be printed for each stack frame with placeholders replaced with actual data. For example "%p" will be replaced by PC, "%s" will be replaced by the source file name etc. "DEFAULT" value enforces default stack trace format currently used in all the sanitizers except TSan. This change also implements __sanitizer_print_stack_trace interface function in TSan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05[Sanitizer] Introduce generic stack frame rendering machineryAlexey Samsonov
Summary: This commit introduces function __sanitizer::RenderFrame() that allows to render the contents of AddressInfo (essentially, symbolized stack frame) using the custom format string. This function can be used to implement stack frame formatting for both ThreadSanitizer and generic StackTrace::Print(), used in another places. This paves the way towards allowing user to control the format of stack frames, obtaining them in any format he desires, and/or enforcing the consistent output from all sanitizers. Test Plan: compiler-rt test suite Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6140 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221409 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-20Remove unused local variableAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23[sanitizer] Make stack traces from dlclose()'d modules more meaningful.Sergey Matveev
Previously, they silently omitted PCs belonging to unknown modules. Now we print (<unknown module>) instead. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04Avoid doing any work when unwinding stack traces with 0 or 1 frameAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202837 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11[sanitizer] Fix build.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201152 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-25[Sanitizer] Don't use MemoryMappingLayout in StackTrace::PrintStack - it is ↵Alexey Samsonov
now a responsibility of Symbolizer class. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13[ASan] Do not rely on malloc context in allocator reports.Alexey Samsonov
Invoke a fatal stack trace unwinder when ASan prints allocator-relevant error reports (double-free, alloc-dealloc-mismatch, invalid-free). Thus we'll be able to print complete stack trace even if allocation/free stacks are not stored (malloc_context_size=0). Based on the patch by Yuri Gribov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194579 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07[Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194196 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07[Sanitizer] Call Windows unwinder 'slow' and share StackTrace::Unwind across ↵Alexey Samsonov
all platforms. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194193 91177308-0d34-0410-b5e6-96231b3b80d8