summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan
Commit message (Collapse)AuthorAgeFilesLines
...
* [TSan] Fix dl_iterate_phdr callback for the case when info->dlpi_name is ↵Alexey Samsonov2015-07-101-4/+8
| | | | | | overwritten by user. llvm-svn: 241876
* tsan: fix handling of condition variable destructionDmitry Vyukov2015-06-301-2/+2
| | | | | | | | | | | | POSIX states that "It shall be safe to destroy an initialized condition variable upon which no threads are currently blocked", and later clarifies "A condition variable can be destroyed immediately after all the threads that are blocked on it are awakened) (in examples section). Tsan reported such destruction as a data race. Fixes https://llvm.org/bugs/show_bug.cgi?id=23616 Reviewed in http://reviews.llvm.org/D10693 llvm-svn: 241082
* [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
* tsan: implement suppressions for top frame onlyDmitry Vyukov2015-06-292-13/+22
| | | | | | | | | | The new suppression type is called "race_top" and is matched only against top frame in report stacks. This is required for situations when we want to suppress a race in a "thread pool" or "event loop" implementation. If we simply use "race:ThreadPool::Execute" suppression, that can suppress everything in the program. Reviewed in http://reviews.llvm.org/D10686 llvm-svn: 240949
* tsan: fix handling of dup2 Dmitry Vyukov2015-06-253-14/+32
| | | | | | | | | | | | Previously tsan modelled dup2(oldfd, newfd) as write on newfd. We hit several cases where the write lead to false positives: 1. Some software dups a closed pipe in place of a socket before closing the socket (to prevent races actually). 2. Some daemons dup /dev/null in place of stdin/stdout. On the other hand we have not seen cases when write here catches real bugs. So model dup2 as read on newfd instead. llvm-svn: 240687
* tsan: merge function definition and declarationDmitry Vyukov2015-06-251-10/+4
| | | | llvm-svn: 240633
* tsan: fix false positive between dlopen and dl_iterate_phdrDmitry Vyukov2015-06-241-0/+41
| | | | | | | | | We see false reports between dlopen and dl_iterate_phdr. This happens because tsan does not see dynamic linker internal synchronization. Unpoison module names in dl_iterate_phdr callback. llvm-svn: 240576
* tsan: don't print external PCs in reportsDmitry Vyukov2015-06-242-5/+1
| | | | | | They are meaningless. llvm-svn: 240539
* tsan: fix unbounded memory consumption for large mallocsDmitry Vyukov2015-06-241-0/+17
| | | | | | | This happens only in corner cases, but we observed this on a real app. See the test for description of the exact scenario that lead to unbounded memory consumption. llvm-svn: 240535
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-192-2/+2
| | | | | | | | | | | | | | | | | | | | | 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
* tsan: mark meta shadow as NOHUGEPAGEDmitry Vyukov2015-06-181-0/+4
| | | | | | | | Meta shadow is compressing and we don't flush it, so it makes sense to mark it as NOHUGEPAGE to not over-allocate memory. On one program it reduces memory consumption from 5GB to 2.5GB. llvm-svn: 240028
* [CMake] Remove redundant checks in TSan CMakeLists.txtAlexey Samsonov2015-06-171-44/+40
| | | | llvm-svn: 239956
* [CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman2015-06-101-1/+2
| | | | | | | | | | | | | | | | | 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
* [ASan] Make binary name reader cross-platform.Yury Gribov2015-06-041-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D10213 llvm-svn: 239020
* [sanitizer_common] Added VS-style output for source locationsFilipe Cabecinhas2015-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 239000
* [sanitizer] Add -lrt to dyndd link line.Evgeniy Stepanov2015-05-291-0/+1
| | | | llvm-svn: 238626
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-294-12/+16
| | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. llvm-svn: 238621
* [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, ↵Yury Gribov2015-05-281-11/+0
| | | | | | | | | | strpbrk. Patch by Maria Guseva. Differential Revision: http://reviews.llvm.org/D9017 llvm-svn: 238406
* [sanitizer] Recognize static TLS in __tls_get_addr interceptor.Evgeniy Stepanov2015-05-161-0/+8
| | | | | | | Current code tries to find the dynamic TLS header to the left of the TLS block without checking that it's not a static TLS allocation. llvm-svn: 237495
* tsan: add memory access functions that accept pcDmitry Vyukov2015-05-053-0/+54
| | | | | | This is required for Java support, as real PCs don't work for Java. llvm-svn: 236484
* tsan: fix a bug memory access handlingDmitry Vyukov2015-04-281-1/+2
| | | | | | | | | | We incorrectly replaced shadow slots when the new value is not stronger than the old one. The bug can lead to false negatives. The bug was detected by Go race test suite: https://github.com/golang/go/issues/10589 llvm-svn: 236008
* [TSan] Attempt to fix old Makefile build.Alexey Samsonov2015-04-282-2/+3
| | | | llvm-svn: 235960
* Export __ubsan_* symbols from MSan and TSan runtimes.Alexey Samsonov2015-04-281-0/+1
| | | | llvm-svn: 235958
* Allow UBSan+MSan and UBSan+TSan combinations (Clang part).Alexey Samsonov2015-04-284-6/+34
| | | | | | | | Embed UBSan runtime into TSan and MSan runtimes in the same as we do in ASan. Extend UBSan test suite to also run tests for these combinations. llvm-svn: 235954
* Introduce tsan_cxx and msan_cxx libraries (compiler-rt part).Alexey Samsonov2015-04-271-5/+13
| | | | | | | | For now tsan_cxx and msan_cxx contain only operator new/delete replacements. In the future, when we add support for running UBSan+TSan and UBSan+MSan, they will also contain bits ubsan_cxx runtime. llvm-svn: 235928
* [TSan] Move new/delete interceptors into a separate source file. NFC.Alexey Samsonov2015-04-274-93/+128
| | | | llvm-svn: 235906
* tsan: fix handling of pthread_detachDmitry Vyukov2015-04-201-1/+8
| | | | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=23235 If pthread_create is followed by pthread_detach, the new thread may not acquire synchronize with the parent thread. llvm-svn: 235293
* tsan: fix parsing of second_deadlock_stack flagDmitry Vyukov2015-04-141-0/+4
| | | | | | | It was broken during flag parsing refactoring. Enable test for the flag. llvm-svn: 234878
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-113-14/+10
| | | | | | | | | | | | 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
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+1
| | | | | | | On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. llvm-svn: 234602
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-1/+1
| | | | llvm-svn: 234487
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-0/+1
| | | | | | sanitizer_posix.h llvm-svn: 234418
* [Sanitizers] Make OpenFile more portableTimur Iskhodzhanov2015-04-081-3/+3
| | | | llvm-svn: 234410
* tsan: handle async signals while blocked in pthread_cond_waitDmitry Vyukov2015-04-083-8/+33
| | | | | | Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=91 llvm-svn: 234394
* sanitizer: new "strict_string_checks" run-time flagDmitry Vyukov2015-04-061-3/+25
| | | | | | | | | | This patch is related to Issue 346: moar string interceptors: strstr, strcasestr, strcspn, strpbrk As was suggested in original review http://reviews.llvm.org/D6056 a new "strict_string_checks" run-time flag introduced. The flag support applied for existing common, asan, msan and tsan interceptors. New asan tests added. Change by Maria Guseva reviewed in http://reviews.llvm.org/D7123 llvm-svn: 234187
* tsan: fix munmap interceptorDmitry Vyukov2015-04-061-2/+5
| | | | | | | | | MetaMap::ResetRange/FreeRange rounds the range up to at least kMetaShadowSize. This is requried for e.g. free(malloc(0)). However, munmap returns EINVAL and do not unmap any memory when length arguments is equal to 0. So don't free meta shadow in this case as well. llvm-svn: 234145
* [Tsan] Do not sanitize memset() and other functions during initializationViktor Kutuzov2015-03-271-3/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D8544 llvm-svn: 233378
* tsan: don't write to meta shadow unnecessarilyDmitry Vyukov2015-03-271-4/+6
| | | | | | | If user does malloc(1<<30), the write to meta shadow can cause excessive memory consumption. llvm-svn: 233373
* [TSan] Disable -Wno-maybe-uninitialized in yet another place.Alexey Samsonov2015-03-241-0/+1
| | | | llvm-svn: 233044
* [TSan] Fixup for r233038: restrict the -Wno-maybe-uninitialized flag to GCC ↵Alexey Samsonov2015-03-231-2/+3
| | | | | | only. llvm-svn: 233042
* [TSan] Disable noisy GCC warning.Alexey Samsonov2015-03-231-0/+1
| | | | llvm-svn: 233038
* [libsanitizer] Fix OpenFile() usage in TSan and DFSan.Alexander Potapenko2015-03-231-1/+1
| | | | | | This is a follow-up for r232936. llvm-svn: 232937
* [Tsan] Do not sanitize memcpy() during thread initialization on FreeBSDViktor Kutuzov2015-03-164-5/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D8324 llvm-svn: 232381
* [Tsan] Do not declare std_suppressions when not usedViktor Kutuzov2015-03-121-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8288 llvm-svn: 232074
* [Tsan] Adjust SA_SIGINFO and SIG_SETMASK values on FreeBSD.Viktor Kutuzov2015-03-121-4/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D8176 llvm-svn: 232073
* tsan: fix a bug in MetaMap::ResetRangeDmitry Vyukov2015-03-121-2/+4
| | | | | | | The bug was uncovered by NegativeTests.MmapTest from data-race-test suite, so port it as well. llvm-svn: 232032
* tsan: fix crash during __tsan_java_moveDmitry Vyukov2015-03-123-2/+62
| | | | | | | | Munmap interceptor did not reset meta shadow for the range, and __tsan_java_move crashed because it encountered non-zero meta shadow for the destination. llvm-svn: 232029
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-022-16/+16
| | | | | | | | | | | The problem is that without SA_RESTORER flag, kernel ignores the handler. So tracer actually did not setup any handler. Add SA_RESTORER flag when setting up handlers. Add a test that causes SIGSEGV in stoptheworld callback. Move SignalContext from asan to sanitizer_common to print better diagnostics about signal in the tracer thread. http://reviews.llvm.org/D8005 llvm-svn: 230978
* [Sanitizer] Print column number in SUMMARY line if it's available.Alexey Samsonov2015-02-271-4/+2
| | | | llvm-svn: 230721
* Re-land part of r230171: fix GoTsanRuntimeCheck with ccache.Alexey Samsonov2015-02-231-1/+2
| | | | llvm-svn: 230247
OpenPOWER on IntegriCloud