summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_libignore.cc
AgeCommit message (Collapse)Author
2017-07-20Honour 80-character line limitKamil Rytarowski
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308620 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20Add NetBSD support in sanitizer_libignore.ccKamil Rytarowski
Summary: Reuse Linux, FreeBSD and Apple code - no NetBSD specific changes. 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, vitalybuka, filcab, kcc Reviewed By: filcab Subscribers: emaste, kubamracek, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35628 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11[tsan] Implement a 'ignore_noninstrumented_modules' flag to better suppress ↵Kuba Mracek
false positive races On Darwin, we currently use 'ignore_interceptors_accesses', which is a heavy-weight solution that simply turns of race detection in all interceptors. This was done to suppress false positives coming from system libraries (non-instrumented code), but it also silences a lot of real races. This patch implements an alternative approach that should allow us to enable interceptors and report races coming from them, but only if they are called directly from instrumented code. The patch matches the caller PC in each interceptors. For non-instrumented code, we call ThreadIgnoreBegin. The assumption here is that the number of instrumented modules is low. Most likely there's only one (the instrumented main executable) and all the other modules are system libraries (non-instrumented). Differential Revision: https://reviews.llvm.org/D28264 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22tsan: switch libignore from /proc/self/maps to dl_iterate_phdrDmitry Vyukov
/proc/self/maps can't be read atomically, this leads to episodic crashes in libignore as it thinks that a module is loaded twice. See the new test for an example. dl_iterate_phdr does not have this problem. Switch libignore to dl_iterate_phdr. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03Reapply r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251920 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03Revert r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251919 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03[tsan] Fix build errors for TSan on OS XKuba Brecka
This patch moves a few functions from `sanitizer_linux_libcdep.cc` to `sanitizer_posix_libcdep.cc` in order to use them on OS X as well. Plus a few more small build fixes. This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point. Differential Revision: http://reviews.llvm.org/D14235 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251918 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30[sanitizer_common] Apply modernize-use-nullptr, other minor fixesVedant Kumar
- Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13310 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09Move more POSIX-specific functions to sanitizer_posix.hTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[Sanitizer] Drop LibIgnore dependency on SuppressionContext. NFC.Alexey Samsonov
Let each LibIgnore user (for now it's only TSan) manually go through SuppressionContext and pass ignored library templates to LibIgnore. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229924 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov
Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223164 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26[Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead ↵Alexey Samsonov
of hardcoded constants git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222803 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-06Enable sanitizers' libignore on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D5205 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217306 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05[sanitizer] Introduce VReport and VPrintf macros and use them in sanitizer code.Sergey Matveev
Instead of "if (common_flags()->verbosity) Report(...)" we now have macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16tsan: refactor libignore implementationDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: refactor overly-complex logical conditionDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: resolve symlinks for called_from_lib suppressionsDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03tsan: ignore interceptors coming from specified librariesDmitry Vyukov
LibIgnore allows to ignore all interceptors called from a particular set of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions from the provided SuppressionContext; finds code ranges for the libraries; and checks whether the provided PC value belongs to the code ranges. Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib, then must call our internal allocator instead of libc malloc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191897 91177308-0d34-0410-b5e6-96231b3b80d8