summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] add CombinedAllocator::InitIfLinkerInitialized and use it in ↵Kostya Serebryany2014-12-171-1/+1
| | | | | | lsan: speeds up lsan start-up time by ~25% llvm-svn: 224469
* [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, compiler-rt partKostya Serebryany2014-12-171-0/+6
| | | | llvm-svn: 224464
* [Sanitizer] Introduce Allocator::may_return_null bool flag.Alexey Samsonov2014-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Turn "allocator_may_return_null" common flag into an Allocator::may_return_null bool flag. We want to make sure that common flags are immutable after initialization. There are cases when we want to change this flag in the allocator at runtime: e.g. in unit tests and during ASan activation on Android. Test Plan: regression test suite, real-life applications Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6623 llvm-svn: 224148
* [ASan, LSan] Improve tracking of thread creation.Sergey Matveev2014-12-051-1/+1
| | | | | | | | | | | | | | | In the current scheme of things, the call to ThreadStart() in the child thread is not synchronized with the parent thread. So, if a pointer is passed to pthread_create, there may be a window of time during which this pointer will not be discoverable by LSan. I.e. the pthread_create interceptor has already returneed and thus the pointer is no longer on the parent stack, but we don't yet know the location of the child stack. This has caused bogus leak reports (see http://llvm.org/bugs/show_bug.cgi?id=21621/). This patch makes the pthread_create interceptor wait until the child thread is properly registered before returning. llvm-svn: 223419
* Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov2014-12-021-4/+3
| | | | | | | | | | | | | | | | Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 llvm-svn: 223164
* Simplify Symbolizer::SymbolizePC() interface.Alexey Samsonov2014-12-021-15/+12
| | | | | | | | | | | 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. llvm-svn: 223145
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-181-1/+1
| | | | | | | | | | MSanDR is a dynamic instrumentation tool that can instrument the code (prebuilt libraries and such) that could not be instrumented at compile time. This code is unused (to the best of our knowledge) and unmaintained, and starting to bit-rot. llvm-svn: 222232
* Change StackDepot interface to use StackTrace more extensivelyAlexey Samsonov2014-10-263-7/+6
| | | | llvm-svn: 220637
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-262-23/+19
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 220635
* [asan] make sure coverage is dumped even if leaks are reportedKostya Serebryany2014-10-161-1/+4
| | | | llvm-svn: 219946
* [sanitizer] Android build cleanup.Evgeniy Stepanov2014-09-291-1/+1
| | | | | | | | | | | | * Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. llvm-svn: 218605
* [Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().Alexey Samsonov2014-09-102-5/+3
| | | | | | | | | 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. llvm-svn: 217558
* [lsan] Implement the public allocator interface in standalone LSan.Sergey Matveev2014-08-262-3/+41
| | | | llvm-svn: 216459
* [lsan] Implement __sanitizer_print_stack_trace() in standalone LSan.Sergey Matveev2014-08-263-24/+34
| | | | llvm-svn: 216454
* [LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined withAlexey Samsonov2014-08-183-16/+16
| | | | | | | | | | another sanitizer. A user may run both LSan and LSan+ASan. It is weird to pass path to leak suppression file (or other common sanitizer flags, like "verbosity") in "LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case. llvm-svn: 215949
* Fix build on some architectures caused by r215247.Alexey Samsonov2014-08-111-5/+0
| | | | llvm-svn: 215380
* [Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().Alexey Samsonov2014-08-051-1/+5
| | | | | | | Suppression context might be used in multiple sanitizers working simultaneously (e.g. LSan and UBSan) and not knowing about each other. llvm-svn: 214831
* [Sanitizer] Hoist the code parsing suppressions file into sanitizer_common.Alexey Samsonov2014-07-301-10/+0
| | | | | | Remove corresponding bits from LSan and TSan runtimes. No functionality change. llvm-svn: 214344
* [Sanitizer] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov2014-07-302-12/+4
| | | | | | No functionality change. llvm-svn: 214343
* [Sanitizer] Make SuppressionContext a singleton class, residing in ↵Alexey Samsonov2014-07-301-11/+9
| | | | | | | | | | sanitizer_common. Convert TSan and LSan to the new interface. More changes will follow: 1) "suppressions" should become a common runtime flag. 2) Code for parsing suppressions file should be moved to SuppressionContext::Init(). llvm-svn: 214334
* [Sanitizer] Simplify Symbolizer creation interface.Alexey Samsonov2014-07-261-1/+1
| | | | | | | | | | | Get rid of Symbolizer::Init(path_to_external) in favor of thread-safe Symbolizer::GetOrInit(), and use the latter version everywhere. Implicitly depend on the value of external_symbolizer_path runtime flag instead of passing it around manually. No functionality change. llvm-svn: 214005
* [Sanitizer] Introduce SANITIZER_CAN_USE_PREINIT_ARRAY definition and use it ↵Alexey Samsonov2014-07-251-5/+1
| | | | | | | | | | across sanitizers. Get rid of ASAN_USE_PREINIT_ARRAY and LSAN_USE_PREINIT_ARRAY - just always use .preinit_array if it's available. This mode seems stable enough, and we've been relying on default values of these macro for a long time. llvm-svn: 213980
* [sanitizer] support c11 aligned_alloc, Linux only for nowKostya Serebryany2014-07-041-0/+6
| | | | llvm-svn: 212322
* [asan] adding support of 32-bit address sanitizer for MIPSDaniel Sanders2014-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch supports both the clang cross-compiler and native compiler Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com> Test Plan: Kumar had the following asan test results when compiled on a MIPS board: Expected Passes : 96 Expected Failures : 2 Unsupported Tests : 84 Unexpected Passes : 4 Unexpected Failures: 19 The list of unexpected failures can be found in the review. Reviewers: kcc, petarj, dsanders Reviewed By: kcc Subscribers: farazs, kcc, llvm-commits Differential Revision: http://reviews.llvm.org/D4208 llvm-svn: 211587
* [sanitizer] Make LSan/MSan/TSan honor the "color" flag.Sergey Matveev2014-06-041-2/+2
| | | | | | Based on a patch by Stephan Bergmann. llvm-svn: 210199
* light up sanitizers for ARM, take 2Greg Fitzgerald2014-05-291-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D3794 llvm-svn: 209856
* Revert "light up sanitizers for ARM"Greg Fitzgerald2014-05-291-1/+1
| | | | | | | | This commit broke the Windows build, where CMAKE_C_COMPILER can compile and link with -march=armv7-a but the just-built-clang cannot. llvm-svn: 209851
* light up sanitizers for ARMGreg Fitzgerald2014-05-291-1/+1
| | | | | | | | | | | | You can expect the sanitizers to be built under any of the following conditions: 1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM 2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target) 3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot Differential Revision: http://reviews.llvm.org/D3794 llvm-svn: 209835
* [lsan] disable lsan if wordsize is not 64Kostya Serebryany2014-05-211-1/+1
| | | | llvm-svn: 209283
* [CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov2014-03-311-1/+1
| | | | | | | | Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. llvm-svn: 205183
* Avoid aliases to weak aliases in interceptors.Rafael Espindola2014-03-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interceptors had code that after macro expansion ended up looking like extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("memalign"))); That is, * __interceptor_memalign is a function * memalign is a weak alias to __interceptor_memalign * __interceptor___libc_memalign is an alias to memalign Both gcc and clang produce assembly that look like __interceptor_memalign: ... .weak memalign memalign = __interceptor_memalign .globl __interceptor___libc_memalign __interceptor___libc_memalign = memalign What it means in the end is that we have 3 symbols pointing to the same position in the file, one of which is weak: 8: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor_memalign 9: 0000000000000000 1 FUNC WEAK DEFAULT 1 memalign 10: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor___libc_memalign In particular, note that __interceptor___libc_memalign will always point to __interceptor_memalign, even if we do link in a strong symbol for memalign. In fact, the above code produces exactly the same binary as extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("__interceptor_memalign"))); If nothing else, this patch makes it more obvious what is going on. llvm-svn: 204823
* [libsanitizer] Introduce flag descriptions.Alexander Potapenko2014-03-201-15/+15
| | | | | | | | | Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags. As the flags are parsed their descriptions are stored in a global linked list. The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions. Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1. llvm-svn: 204339
* AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific ↵Kostya Serebryany2014-02-241-1/+1
| | | | | | | | | code so it seems it should have more generic name and moved to a common scope. Renamed to AdjustStackSize. Patch by Viktor Kutuzov. llvm-svn: 202011
* [CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov2014-02-181-0/+2
| | | | | | 'compiler-rt' target encompassing them all. llvm-svn: 201556
* [CMake] Simplify setting compile flag disabling RTTIAlexey Samsonov2014-02-181-3/+2
| | | | llvm-svn: 201547
* LSan: Print warning about dynamic linker only in verbose modeAlexey Samsonov2014-02-141-4/+5
| | | | llvm-svn: 201421
* Move LSan test suite under test/Alexey Samsonov2014-02-1440-1134/+2
| | | | llvm-svn: 201408
* Delete LSan unit testsAlexey Samsonov2014-02-146-129/+0
| | | | llvm-svn: 201406
* Move shared configs for lit test suites to test/ and unittests/ directoriesAlexey Samsonov2014-02-143-3/+3
| | | | llvm-svn: 201399
* [sanitizer] Fix build.Evgeniy Stepanov2014-02-111-13/+13
| | | | llvm-svn: 201152
* Add throw() specifiers to more redeclarations of operator delete and ↵Nick Lewycky2014-02-081-2/+2
| | | | | | operator delete[]. llvm-svn: 201016
* [lsan] simplify use_tls_dynamic.cc testKostya Serebryany2014-02-043-17/+18
| | | | llvm-svn: 200748
* Enable compilation of RT on ARMRenato Golin2014-01-311-1/+1
| | | | | | | | | | | | Adding the ARM RT sources to the CMake files, and enabling some sanitizers to also build on ARM. This is far from supported or production quality, but enabling it to build will get us errors that we can actually fix. Having said that, the Compiler-RT and the Asan libraries are know to work on some variations of ARM. llvm-svn: 200546
* [lsan] Expand a comment to document our dynamic TLS hack.Sergey Matveev2014-01-231-0/+15
| | | | llvm-svn: 199900
* [lsan] remove LeakSanitizerIsTurnedOffForTheCurrentProcess (this was a bad ↵Kostya Serebryany2014-01-153-13/+2
| | | | | | idea), leave __lsan_is_turned_off llvm-svn: 199304
* [lsan] handle 'new T[0]' where T is a type with DTOR; fixes ↵Kostya Serebryany2014-01-103-1/+33
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=257 llvm-svn: 198932
* [lsan] rename __lsan_is_turned_off to ↵Kostya Serebryany2014-01-103-3/+14
| | | | | | LeakSanitizerIsTurnedOffForTheCurrentProcess (leave the old variant for now for compatibility) llvm-svn: 198921
* [Sanitizer] Add Symbolizer::GetModuleNameAndOffsetForPC() and use it in LSan ↵Alexey Samsonov2013-12-251-3/+12
| | | | | | | | suppression matching. This allows us to avoid retrieving file/line info for suppressed modules. llvm-svn: 198025
* [lsan] Minor code health stuff.Sergey Matveev2013-12-252-32/+33
| | | | | | | - introduce logging macros - fix incorrect vector construction llvm-svn: 198021
* [lsan] Refactor the LeakReport class.Sergey Matveev2013-12-242-49/+67
| | | | | | Those methods were too damn bloated. llvm-svn: 197978
OpenPOWER on IntegriCloud