summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[CMake] Provide options for toggling on and off various runtime ↵Chris Bieneman2015-12-101-1/+0
| | | | | | | | libraries." This reverts r255170. This change caused a bunch of bot failures and needs to be revised. llvm-svn: 255184
* [CMake] Provide options for toggling on and off various runtime libraries.Chris Bieneman2015-12-091-0/+1
| | | | | | | | | | | | | | | Summary: Rather than having to add new "experimental" options each time someone wants to work on bringing a sanitizer to a new platform, this patch makes options for all of them. The default values for the options are set by the platform checks that would have enabled them, but they can be overridden on or off. Reviewers: kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14846 llvm-svn: 255170
* Tell clang-format that (most) sanitizers are written using Google style guide.Alexey Samsonov2015-11-191-0/+1
| | | | llvm-svn: 253608
* [compiler-rt] [asan] Use same shadow offset for aarch64Adhemerval Zanella2015-11-091-1/+3
| | | | | | | | This patch makes ASAN for aarch64 use the same shadow offset for all currently supported VMAs (39 and 42 bits). The shadow offset is the same for 39-bit (36). llvm-svn: 252497
* [lsan] [aarch64] Add support for AArch64Adhemerval Zanella2015-10-213-3/+5
| | | | | | | | | | This patch add support for leak sanitizer for aarch64. Similar to MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64 currently supports 39 and 42-bit VMA). It also fixes the android build issue. llvm-svn: 250898
* Revert "[lsan] [aarch64] Add support for AArch64"Evgeniy Stepanov2015-10-083-6/+3
| | | | | | | | | This reverts commit ea02fa45225c35613bfecab383fb526e24b74497 (r249337). Reason: broken "ninja AsanUnitTests" on Android/AArch64. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/20675/steps/build%20compiler-rt%20android%2Faarch64/logs/stdio llvm-svn: 249730
* [lsan] [aarch64] Add support for AArch64Adhemerval Zanella2015-10-053-3/+6
| | | | | | | | This patch add support for leak sanitizer for aarch64. Similar to MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64 currently supports 39 and 42-bit VMA). llvm-svn: 249337
* [compiler-rt] Apply modernize-use-nullptr fixes in sanitizersVedant Kumar2015-10-015-28/+29
| | | | | | | | | | | | | | | | | | - 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 llvm-svn: 248966
* Fix compilation warning in compiler-rt.Evgeniy Stepanov2015-09-161-1/+1
| | | | | | | error: width of bit-field 'allocated' (8 bits) exceeds the width of its type; value will be truncated to 1 bit [-Werror,-Wbitfield-width] llvm-svn: 247840
* tsan: speed up race deduplicationDmitry Vyukov2015-09-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Race deduplication code proved to be a performance bottleneck in the past if suppressions/annotations are used, or just some races left unaddressed. And we still get user complaints about this: https://groups.google.com/forum/#!topic/thread-sanitizer/hB0WyiTI4e4 ReportRace already has several layers of caching for racy pcs/addresses to make deduplication faster. However, ReportRace still takes a global mutex (ThreadRegistry and ReportMutex) during deduplication and also calls mmap/munmap (which take process-wide semaphore in kernel), this makes deduplication non-scalable. This patch moves race deduplication outside of global mutexes and also removes all mmap/munmap calls. As the result, race_stress.cc with 100 threads and 10000 iterations become 30x faster: before: real 0m21.673s user 0m5.932s sys 0m34.885s after: real 0m0.720s user 0m23.646s sys 0m1.254s http://reviews.llvm.org/D12554 llvm-svn: 246758
* [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime ↵Chris Bieneman2015-08-251-3/+5
| | | | | | | | | | | | | | | | into a single function Summary: This refactoring moves much of the Apple-specific behavior into a function in AddCompilerRT. The next cleanup patch will remove more of the if(APPLE) checks in the outlying CMakeLists. This patch adds a bunch of new functionality to add_compiler_rt_runtime so that the target names don't need to be reconstructed outside the call. It also updates some of the call sites to exercise the new functionality, but does not update all uses fully. Subsequent patches will further update call sites and move to using the new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: beanz, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D12292 llvm-svn: 245970
* [Sanitizer] Dump coverage if we're killing the program with __sanitizer::Die().Alexey Samsonov2015-08-241-2/+0
| | | | | | | | | | | Previously we had to call __sanitizer_cov_dump() from tool-specific callbacks - instead, let sanitizer_common library handle this in a single place. This is a re-application of r245770, with slightly different approach taken. llvm-svn: 245890
* Revert r245770 and r245777.Alexey Samsonov2015-08-221-0/+2
| | | | | | | These changes break both autoconf Mac OS X buildbot (linker errors due to wrong Makefiles) and CMake buildbot (safestack test failures). llvm-svn: 245784
* [Sanitizer] Dump coverage if we're killing the program with __sanitizer::Die().Alexey Samsonov2015-08-221-2/+0
| | | | | | | Previously we had to call __sanitizer_cov_dump() from tool-specific callbacks - instead, let sanitizer_common library handle this in a single place. llvm-svn: 245770
* [LSan] Support __sanitizer_set_death_callback in standalone LSan.Alexey Samsonov2015-08-211-1/+1
| | | | llvm-svn: 245758
* [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across ↵Alexey Samsonov2015-08-213-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all sanitizers. Summary: Merge "exitcode" flag from ASan, LSan, TSan and "exit_code" from MSan into one entity. Additionally, make sure sanitizer_common now uses the value of common_flags()->exitcode when dying on error, so that this flag will automatically work for other sanitizers (UBSan and DFSan) as well. User-visible changes: * "exit_code" MSan runtime flag is now deprecated. If explicitly specified, this flag will take precedence over "exitcode". The users are encouraged to migrate to the new version. * __asan_set_error_exit_code() and __msan_set_exit_code() functions are removed. With few exceptions, we don't support changing runtime flags during program execution - we can't make them thread-safe. The users should use __sanitizer_set_death_callback() that would call _exit() with proper exit code instead. * Plugin tools (LSan and UBSan) now inherit the exit code of the parent tool. In particular, this means that ASan would now crash the program with exit code "1" instead of "23" if it detects leaks. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12120 llvm-svn: 245734
* -Wdeprecated: Use noexcept rather than throw() where supportedDavid Blaikie2015-08-101-2/+2
| | | | | | | | | | Summary: I've copy/pasted the LLVM_NOEXCEPT definition macro goo from LLVM's Compiler.h. Is there somewhere I should put this in Compiler RT? Is there a useful header to define/share things like this? Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D11780 llvm-svn: 244453
* [sanitizer] Implement include_if_exists with process name substitution.Evgeniy Stepanov2015-07-211-0/+1
| | | | | | | | | include_if_exists=/path/to/sanitizer/options reads flags from the file if it is present. "%b" in the include file path (for both variants of the flag) is replaced with the basename of the main executable. llvm-svn: 242853
* [asan] Fix SanitizerCommon.PthreadDestructorIterations test on Android L.Evgeniy Stepanov2015-06-291-1/+1
| | | | | | | On Android L, TSD destructors run 8 times instead of 4. Back to 4 times on the current master branch (as well as on K). llvm-svn: 240992
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 llvm-svn: 240120
* Revert "Revert "[CMake] LSan is not actually available on Darwin.""Alexey Samsonov2015-06-191-1/+1
| | | | | | Re-land fixed version of r239955. llvm-svn: 240108
* Revert "[CMake] LSan is not actually available on Darwin."Justin Bogner2015-06-181-10/+12
| | | | | | | | | This change makes cmake fail to even run on Darwin with errors evaluating "$<TARGET_OBJECTS:RTInterception.x86_64>". This reverts r239955 llvm-svn: 239985
* [CMake] LSan is not actually available on Darwin.Alexey Samsonov2015-06-171-12/+10
| | | | llvm-svn: 239955
* [CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman2015-06-101-13/+6
| | | | | | | | | | | | | | | | | Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 llvm-svn: 239498
* [LSan] Add function attribute forgotten in r235728.Alexey Samsonov2015-04-241-0/+1
| | | | llvm-svn: 235761
* [lsan] Add an interface function for on-demand leak checking.Sergey Matveev2015-04-242-33/+67
| | | | | | | | | | | | | | | | | | | | | | Summary: Add an interface function which can be used to periodically trigger leak detection in a long-running process. NB: The meaning of the kIgnored tag has been changed to allow easy clean-up between subsequent leak checks. Previously, this tag was applied to explicitly ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any chunks only reachable from those. With this change, it's only applied to explicitly ignored chunks. Reviewers: samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9159 llvm-svn: 235728
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-2/+2
| | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix \ -format llvm-svn: 234680
* [sanitizer] use simpler symbolizer interface (GetModuleNameForPc) where ↵Kostya Serebryany2015-03-051-6/+4
| | | | | | applicable llvm-svn: 231337
* [lsan] Fix indent.Sergey Matveev2015-02-261-2/+2
| | | | llvm-svn: 230633
* LSan: fix a deadlock caused by dl_iterate_phdr().Sergey Matveev2015-02-263-6/+29
| | | | | | | | Wrap the StopTheWorld call in a dl_iterate_phdr() callback. This ensures that no other threads are holding the libdl lock, and we can safely reenter it in the tracer thread. llvm-svn: 230631
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-202-10/+20
| | | | | | | | | | | | | | SuppressionContext is no longer a singleton, shared by all sanitizers, but a regular class. Each of ASan, LSan, UBSan and TSan now have their own SuppressionContext, which only parses suppressions specific to that sanitizer. "suppressions" flag is moved away from common flags into tool-specific flags, so the user now may pass ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt in a single invocation. llvm-svn: 230026
* [LSan] [MIPS] adding support of LSan for mips64/mips64el archMohit K. Bhakkad2015-02-193-6/+19
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: petarj, earthdok, kcc. Subscribers: samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7013 llvm-svn: 229830
* Remove support for building sanitizers from Makefile/autoconf build on Linux.Alexey Samsonov2015-02-181-3/+0
| | | | | | | This is a re-application of r229554 restricted to Linux build only. Apple still uses Makefile/autoconf to build Clang and sanitizers. llvm-svn: 229756
* Revert "Remove support for building sanitizers from Makefile/autoconf build."Matthias Braun2015-02-171-0/+28
| | | | | | | | | This reverts commit r229556. Reverting this for now as internal apple builds rely on this functionality. llvm-svn: 229585
* Remove support for building sanitizers from Makefile/autoconf build.Alexey Samsonov2015-02-171-28/+0
| | | | | | | | They autotools build has a number of missing features, supports less OS, architectures, build configurations, doesn't have any tests and is hard to support in sync with CMake build. llvm-svn: 229556
* [LSan] Make parent tool responsible for initializing LSan flags.Alexey Samsonov2015-02-173-38/+39
| | | | | | | | | | | | | | | | | | | | | Summary: LSan can be combined with a parent tool (for now it's only ASan). Also, we allow LSAN_OPTIONS to override certain common flags. It means we have to parse LSAN_OPTIONS early enough, before the rest of the parent tool (including chunks of sanitizer_common) is initialized. In future, we can use the same approach for UBSan, after we embed it into ASan runtime in a similar way. Test Plan: regression test suite Reviewers: earthdok, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7577 llvm-svn: 229519
* [msan] Better use-after-free reports.Evgeniy Stepanov2015-01-221-1/+1
| | | | | | | | | | | | | 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. llvm-svn: 226821
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-201-1/+3
| | | | | | | This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. llvm-svn: 226566
* [sanitizer] Make unrecognized flags not fatal.Evgeniy Stepanov2015-01-191-0/+2
| | | | | | Print a warning at verbosity=1 and higher instead of dying immediately. llvm-svn: 226458
* [sanitizer] Move options-related tests to sanitizer_common.Evgeniy Stepanov2015-01-191-0/+5
| | | | | | And handle help=1 in standalone LSan. llvm-svn: 226438
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-152-8/+11
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-073-62/+65
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-4/+6
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-5/+4
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-261-4/+1
| | | | | | | | This is a re-commit of r224838 + r224839, previously reverted in r224850. Test failures were likely (still can not reproduce) caused by two lit tests using the same name for an intermediate build target. llvm-svn: 224853
* Revert r224838, r224839.Evgeniy Stepanov2014-12-261-1/+4
| | | | | | Flaky failures on the build bots. llvm-svn: 224850
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-251-4/+1
| | | | llvm-svn: 224838
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-4/+5
| | | | | | | | | | | | | | | | | | | Summary: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-2/+2
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized.Sergey Matveev2014-12-191-1/+1
| | | | llvm-svn: 224577
OpenPOWER on IntegriCloud