Kostya Serebryany
2ff42d98fa
[sanitizer] do not acquire a global mutex in deadlock detector when dealing with Unlock (it is essentially a thread-local operation)
...
llvm-svn: 202401
2014-02-27 14:38:42 +00:00
Dmitry Vyukov
a12923e265
tsan: intercept vfork
...
this fixes obscure false positives
see the comments and the test for details
llvm-svn: 202400
2014-02-27 14:36:16 +00:00
Dmitry Vyukov
6fd67f9c7a
tsan: fix internal deadlock detector for external deadlock detector
...
we must go deeper!
llvm-svn: 202365
2014-02-27 09:02:58 +00:00
Joerg Sonnenberger
9d09e2fe90
Reapply r201910. MSVC gets __func__ defined explicitly, even though it
...
can't build anything here.
llvm-svn: 202297
2014-02-26 20:33:22 +00:00
Kostya Serebryany
67968cbf93
[sanitizer] minimal support for recursive locks indeadlock detector
...
llvm-svn: 202153
2014-02-25 14:02:01 +00:00
Kostya Serebryany
01be296dbb
[sanitizer] support pthread_rwlock_rd* in deadlock detector
...
llvm-svn: 202132
2014-02-25 10:33:37 +00:00
Kostya Serebryany
fd88edfddb
[sanitizer] partially support pthread_rwlock_* (no rd* form yet)
...
llvm-svn: 202128
2014-02-25 09:33:10 +00:00
Kostya Serebryany
11f4f30fa7
[sanitizer] add support for try_lock in deadlock detector
...
llvm-svn: 202120
2014-02-25 08:24:15 +00:00
Kostya Serebryany
6d54611fd4
[sanitizer] fix epoch handling in deadlock detector (before the fix, we could have had edges from locks in the previous epoch to locks in the current epoch)
...
llvm-svn: 202118
2014-02-25 07:34:41 +00:00
Dmitry Vyukov
a661a13c0f
tsan: fix SIGRTMAX handling
...
llvm-svn: 202022
2014-02-24 11:28:59 +00:00
Kostya Serebryany
cf5d8e4f29
AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific 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
2014-02-24 08:53:26 +00:00
Dmitry Vyukov
249cd9af9c
tsan: fix compiler warning
...
error: address of array 'tctx->name' will always evaluate to 'true'
llvm-svn: 202008
2014-02-24 08:19:53 +00:00
Reid Kleckner
324eee45a7
Revert "Replace __FUNCTION__ with __func__, the latter being standard C99/C++11."
...
This reverts commit r201910.
While __func__ may be standard in C++11, it was only recently added to
MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be
standard, but it's *very* portable.
llvm-svn: 201916
2014-02-22 00:37:45 +00:00
Joerg Sonnenberger
b15779f307
Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.
...
llvm-svn: 201910
2014-02-21 23:55:15 +00:00
Kostya Serebryany
0548c79859
[tsan] add coarse-grained lock around the DeadlockDetector. We can do better than that, but that's a start.
...
llvm-svn: 201861
2014-02-21 15:07:18 +00:00
Alexey Samsonov
11705b2f10
[CMake] break dependency between unit tests and runtimes in standalone build
...
llvm-svn: 201778
2014-02-20 12:03:56 +00:00
Kostya Serebryany
b51f8d4990
[tsan] when printing a mutex, also print its address. Properly print the deadlock report.
...
llvm-svn: 201675
2014-02-19 14:17:25 +00:00
Alexey Samsonov
cd8535a96d
[CMake] Introduce COMPILER_RT_INCLUDE_TESTS option
...
llvm-svn: 201666
2014-02-19 11:18:47 +00:00
Kostya Serebryany
37ce26cb16
[sanitizer] when reporting a deadlock also report the lock cycle
...
llvm-svn: 201576
2014-02-18 14:56:19 +00:00
Kostya Serebryany
bd86a29a2a
[sanitizer] make sure the deadlock detector survives the change of epochs; add a test and a comment
...
llvm-svn: 201572
2014-02-18 13:41:49 +00:00
Kostya Serebryany
aa416c39cd
[tsan] in deadlock detector do not register locks on their creation and unregister them on destruction; added a relevant test
...
llvm-svn: 201568
2014-02-18 12:50:31 +00:00
Alexey Samsonov
63a4af7346
[CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt' target encompassing them all.
...
llvm-svn: 201556
2014-02-18 09:33:45 +00:00
Alexey Samsonov
878a9a5de2
[CMake] Check for -fPIE and -ffreestanding flags for consistency
...
llvm-svn: 201549
2014-02-18 08:07:09 +00:00
Alexey Samsonov
b73db72a17
[CMake] Simplify setting compile flag disabling RTTI
...
llvm-svn: 201547
2014-02-18 07:52:40 +00:00
Alexey Samsonov
9a1ffce25a
[CMake] Simplify code for detecting/setting compiler flags
...
llvm-svn: 201543
2014-02-18 07:26:58 +00:00
Kostya Serebryany
ec68429c5d
[sanitizer] simplify DeadlockDetectorTLS
...
llvm-svn: 201505
2014-02-17 08:47:48 +00:00
Alexey Samsonov
e6a6183e9b
Move TSan lit-tests under test/tsan
...
llvm-svn: 201414
2014-02-14 14:35:48 +00:00
Kostya Serebryany
a63632a5c6
[tsan] rudimentary support for deadlock detector in tsan (nothing really works yet except for a single tiny test). Also rename tsan's DeadlockDetector to InternalDeadlockDetector
...
llvm-svn: 201407
2014-02-14 12:20:42 +00:00
Evgeniy Stepanov
05938a23f5
[sanitizer] Use mmap to zero-fill large shadow regions.
...
This is covered by existing ASan test.
This does not change anything for TSan by default (but provides a flag to
change the threshold size).
Based on a patch by florent.bruneau here:
https://code.google.com/p/address-sanitizer/issues/detail?id=256
llvm-svn: 201400
2014-02-14 11:41:26 +00:00
Alexey Samsonov
81a2b466e9
Move shared configs for lit test suites to test/ and unittests/ directories
...
llvm-svn: 201399
2014-02-14 11:00:07 +00:00
Alexey Samsonov
ce9c449a4d
[TSan] Kill tsan_symbolize_addr2line_linux.cc
...
llvm-svn: 201219
2014-02-12 08:37:09 +00:00
Alexey Samsonov
7304b4201f
[Sanitizer] Teach external symbolizer to work with addr2line if llvm-symbolizer is unavailable. Allow this mode in TSan.
...
llvm-svn: 201218
2014-02-12 08:29:42 +00:00
Alexey Samsonov
167c15a98f
[Sanitizer] Build sanitizer_common with -Wframe-larger-than=512 flag
...
llvm-svn: 201213
2014-02-12 07:26:40 +00:00
Evgeniy Stepanov
769d46f373
[sanitizer] Use system unwinder in signal handlers on Android.
...
Because of the way Bionic sets up signal stack frames, libc unwinder is unable
to step through it, resulting in broken SEGV stack traces.
Luckily, libcorkscrew.so on Android implements an unwinder that can start with
a signal context, thus sidestepping the issue.
llvm-svn: 201151
2014-02-11 13:38:57 +00:00
Alexey Samsonov
dce6dd9d29
[TSan] Fix mismatched mangled names in operator delete interceptors
...
llvm-svn: 201069
2014-02-10 08:34:46 +00:00
Nick Lewycky
c0930b808b
Stick to C++98 for this.
...
llvm-svn: 201015
2014-02-08 01:36:21 +00:00
Nick Lewycky
fff46e01fd
Update these declarations of operator delete (and delete[]) to have noexcept,
...
as required per core issue 1552 and warned about with
-Wimplicit-exception-spec-mismatch.
llvm-svn: 201014
2014-02-08 01:29:07 +00:00
Dmitry Vyukov
b2b3e4bd77
tsan: improve the test
...
remove TSAN_OPTIONS from the test, so that it runs in the presubmit script
add a CHECK, so that it can run with FileCheck as well
llvm-svn: 200972
2014-02-07 11:48:06 +00:00
Dmitry Vyukov
c57987c7fb
tsan: run user OnInitialize callback later
...
when global and thread state are initialized,
this allows to do more things in the callback.
llvm-svn: 200966
2014-02-07 09:28:57 +00:00
Alexander Potapenko
1a0aadcd77
[TSan] Add a regression test for https://code.google.com/p/thread-sanitizer/issues/detail?id=47
...
llvm-svn: 200923
2014-02-06 14:06:12 +00:00
Alexander Potapenko
a1193a50b0
[TSan] Don't flush all file streams on program shutdown to avoid deadlocks on file stream locks.
...
This should fix https://code.google.com/p/thread-sanitizer/issues/detail?id=47 .
llvm-svn: 200922
2014-02-06 13:37:14 +00:00
Dmitry Vyukov
9ba840865f
tsan: simplify Go build script
...
we don't use assembly files
llvm-svn: 200916
2014-02-06 09:23:12 +00:00
Dmitry Vyukov
447bb46e03
tsan: remove unused functions
...
llvm-svn: 200915
2014-02-06 09:22:50 +00:00
Dmitry Vyukov
93474a9acd
tsan: fix windows alignment check
...
llvm-svn: 200838
2014-02-05 13:41:09 +00:00
Dmitry Vyukov
a54308fc6d
tsan: deflake flaky test
...
llvm-svn: 200833
2014-02-05 12:01:34 +00:00
Dmitry Vyukov
7799eb123b
tsan: ensure proper alignment of mmaps on windows
...
llvm-svn: 200832
2014-02-05 11:37:20 +00:00
Dmitry Vyukov
d7fcee8d8c
tsan: add windows native build script
...
llvm-svn: 200780
2014-02-04 17:52:41 +00:00
Dmitry Vyukov
a61c2b0bd5
tsan: fix windows build
...
llvm-svn: 200779
2014-02-04 17:29:44 +00:00
Dmitry Vyukov
2da2cee706
tsan: update Go public interface
...
in preparation for https://codereview.appspot.com/55100044
llvm-svn: 200766
2014-02-04 14:45:54 +00:00
Dmitry Vyukov
2e1634b69f
tsan: fix darwin Go build
...
llvm-svn: 200755
2014-02-04 11:29:09 +00:00