summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_symbolize.cc
AgeCommit message (Collapse)Author
2015-12-10[TSan] Try harder to avoid compiler-generated memcpy calls.Alexey Samsonov
check_memcpy test added in r254959 fails on some configurations due to memcpy() calls inserted by Clang. Try harder to avoid them by using internal_memcpy() where applicable. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30[tsan] Fix weakly imported functions on OS XKuba Brecka
On OS X, for weak function (that user can override by providing their own implementation in the main binary), we need extern `"C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE`. Fixes a broken test case on OS X, java_symbolization.cc, which uses a weak function __tsan_symbolize_external. Differential Revision: http://reviews.llvm.org/D14907 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25tsan: merge function definition and declarationDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24tsan: don't print external PCs in reportsDmitry Vyukov
They are meaningless. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240539 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11tsan: don't subtract one from fake PCsDmitry Vyukov
These are fake and not actual PCs, more like function IDs. Pass them to external symbolizer untouched. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224022 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-04[TSan] Refactor/simplify ReportLocation structure.Alexey Samsonov
# Make DataInfo (describing a global) a member of ReportLocation to avoid unnecessary copies and allocations. # Introduce a constructor and a factory method, so that all structure users don't have to go to internal allocator directly. # Remove unused fields (file/line). No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04Correct the usage of DataInfo structure in TSanAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221297 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04[TSan] Make ReportStack contain __sanitizer::AddressInfo object.Alexey Samsonov
AddressInfo contains the results of symbolization. Store this object directly in the symbolized stack, instead of copying data around and making unnecessary memory allocations. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221294 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04[TSan] Don't strip binary/library name until the moment we print it.Alexey Samsonov
This commit changes the place where TSan runtime turns full path to binary or shared library into its basename (/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible (when we obtained the full path from the symbolizer), we now do it as late as possible (right before printing the error report). This seems like a right thing to do - stripping to basename is a detail of report formatting implementation, and should belong there. Also, we might need the full path at some point - for example, to match the suppressions. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221225 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03[TSan] Remove bogus unused global variablesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10[Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().Alexey Samsonov
We may as well just use Symbolizer::GetOrInit() in all the cases. Don't call Symbolizer::Get() early in tools initialization: these days it doesn't do any important setup work, and we may as well create the symbolizer the first time it's actually needed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11tsan: ignore interceptors from symbolizerDmitry Vyukov
ocassionally we see races coming from symbolizer interceptors (e.g. memcmp) reproducible only only on large complex programs git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12[TSan] Kill tsan_symbolize_addr2line_linux.ccAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201219 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-25[Sanitizer] Replace Symbolizer::IsAvailable and ↵Alexey Samsonov
Symbolizer::IsExternalAvailable with Symbolizer::CanReturnFileLineInfo. Remove now redundant checks in symbolizer initialization in TSan and MSan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198000 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-18[Sanitizers] Rename Symbolizer::SymbolizeCode to Symbolizer::SymbolizePCTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197569 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Reapply asan coverage changes 194702-194704.Bob Wilson
I still don't know what is causing our bootstrapped LTO buildbots to fail, but llvm r194701 seems to be OK and I can't imagine that these changes could cause the problem. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Speculatively revert asan coverage changes 194702-194704.Bob Wilson
Apple's bootstrapped LTO builds have been failing, and these changes (along with llvm 194701) are the only things on the blamelist. I will either reapply these changes or help debug the problem, depending on whether this fixes the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14[asan] Poor man's coverage that works with ASan (compiler-rt part)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31[Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.Alexey Samsonov
Summary: TSan and MSan need to know if interceptor was called by the user code or by the symbolizer and use pre- and post-symbolization hooks for that. Make Symbolizer class responsible for calling these hooks instead. This would ensure the hooks are only called when necessary (during in-process symbolization, they are not needed for out-of-process) and save specific sanitizers from tracing all places in the code where symbolization will be performed. Reviewers: eugenis, dvyukov Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2067 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25Overhaul the symbolizer interface.Peter Collingbourne
This moves away from creating the symbolizer object and initializing the external symbolizer as separate steps. Those steps now always take place together. Sanitizers with a legacy requirement to specify their own symbolizer path should use InitSymbolizer to initialize the symbolizer with the desired path, and GetSymbolizer to access the symbolizer. Sanitizers with no such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for initialization. The symbolizer interface has been made thread-safe (as far as I can tell) by protecting its member functions with mutexes. Finally, the symbolizer interface no longer relies on weak externals, the introduction of which was probably a mistake on my part. Differential Revision: http://llvm-reviews.chandlerc.com/D1985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-22tsan: allow symbolization of non-native PCs, e.g. coming from JIT/JAVA/etcDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[Sanitizer] Refactor symbolization interface: use class instead of several ↵Alexey Samsonov
functions. Move some code around to get rid of extra source files git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19tsan: symbolizer "flush caches" supportDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29tsan: remember when we are inside of symbolizer code (required for inprocess ↵Dmitry Vyukov
symbolizer) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173796 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29tsan: add IsSymbolizerAvailable() function for querying for presence of ↵Dmitry Vyukov
internal/external symbolizer git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11tsan: symbolize global variablesDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172181 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-03tsan: describe global vars (module+offset for now)Dmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169122 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06[TSan] add support for running external symbolizer other than addr2line (for ↵Alexey Samsonov
testing purposes) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05[Sanitizer] Remove implicit conversion of InternalScopedBuffer<T> to T*Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22[TSan] switch tsan to using InternalScopedBuffer from sanitizer_commonAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05[TSan] add a new option 'use_internal_symbolizer' that allows to choose ↵Alexey Samsonov
between addr2line-based and llvm-based symbolizer w/o having to rebuild the runtime. This is hopefully a temporary solution that simplifies testing process. In the end, we should leave a single symbolizer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159730 91177308-0d34-0410-b5e6-96231b3b80d8