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
Alexey Samsonov
e6a6183e9b
Move TSan lit-tests under test/tsan
...
llvm-svn: 201414
2014-02-14 14:35:48 +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
Dmitry Vyukov
16e7a758b0
tsan: do not deadlock on fork
...
Currently correct programs can deadlock after fork, because atomic operations and async-signal-safe calls are not async-signal-safe under tsan.
With this change:
- if a single-threaded program forks, the child continues running with verification enabled (the tsan background thread is recreated as well)
- if a multi-threaded program forks, then the child runs with verification disabled (memory accesses, atomic operations and interceptors are disabled); it's expected that it will exec soon anyway
- if the child tries to create more threads after multi-threaded fork, the program aborts with error message
- die_after_fork flag is added that allows to continue running, but all bets are off
http://llvm-reviews.chandlerc.com/D2614
llvm-svn: 199993
2014-01-24 12:33:35 +00:00
Alexey Samsonov
5746c07629
[Sanitizer] Use different MemoryMappingLayout::DumpListOfModules on Linux and Mac.
...
Make a unit test added in r198004 more robust.
llvm-svn: 198012
2013-12-25 11:29:19 +00:00
Dmitry Vyukov
ce3721057d
tsan: remove in_rtl counter
...
This is intended to address the following problem.
Episodically we see CHECK-failures when recursive interceptors call back into user code. Effectively we are not "in_rtl" at this point, but it's very complicated and fragile to properly maintain in_rtl property. Instead get rid of it. It was used mostly for sanity CHECKs, which basically never uncover real problems.
Instead introduce ignore_interceptors flag, which is used in very few narrow places to disable recursive interceptors (e.g. during runtime initialization).
llvm-svn: 197979
2013-12-24 12:55:56 +00:00
Alexey Samsonov
25d010a98d
[Sanitizer] Always initialize a Symbolizer (even if 'symbolize' is false).
...
If 'symbolize' flag is not set, we still want to transform virtual address
to module+offset pair in the call to Symbolizer::SymbolizeCode().
See https://code.google.com/p/address-sanitizer/issues/detail?id=251 for
more details.
llvm-svn: 197491
2013-12-17 11:15:39 +00:00
Dmitry Vyukov
89117e1fcc
tsan: do not leave verbosity>0 in tests
...
llvm-svn: 195833
2013-11-27 10:05:22 +00:00
Dmitry Vyukov
7bd319cc08
tsan: fix flags parsing
...
- running_on_valgrind was not parsed in some contexts
- refactor code a bit
- add comprehensive tests for flags parsing
llvm-svn: 195831
2013-11-27 09:54:10 +00:00
Dmitry Vyukov
464ebbd67b
tsan: move shadow stack from thread descriptors to fixed addresses
...
This allows to increase max shadow stack size to 64K,
and reliably catch shadow stack overflows instead of silently
corrupting memory.
llvm-svn: 192797
2013-10-16 15:35:12 +00:00
Alexey Samsonov
e99a0b9b76
[TSan] Use Clang to compile and link TSan unit tests with TSan runtime
...
llvm-svn: 190503
2013-09-11 09:56:33 +00:00
Kostya Serebryany
895ff83e47
[tsan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190135
2013-09-06 11:04:14 +00:00
Sergey Matveev
d109eb052b
[tsan] Move some suppressions-related code to common.
...
Factor out code to be reused in LSan. Also switch from linked list to vector.
llvm-svn: 184957
2013-06-26 15:37:14 +00:00
Sergey Matveev
954c6ef10f
[sanitizer] Move GetThreadStackAndTls from TSan to sanitizer_common.
...
Move this function to sanitizer_common because LSan uses it too. Also, fix a bug
where the TLS range reported for main thread was off by the size of the thread
descriptor from libc (TSan doesn't care much, but for LSan it's critical).
llvm-svn: 181322
2013-05-07 14:41:43 +00:00
Alexey Samsonov
31a2c483ed
[TSan] Build TSan unit tests with the same compile flags as TSan runtime
...
llvm-svn: 177859
2013-03-25 10:23:20 +00:00
Dmitry Vyukov
3330200d92
tsan: fix incorrect test
...
llvm-svn: 177519
2013-03-20 13:49:45 +00:00
Dmitry Vyukov
4ddd37ba5b
tsan: smaller memory block headers (32b->16b)
...
llvm-svn: 177312
2013-03-18 19:47:36 +00:00
Alexey Samsonov
85f0a7e644
[TSan] Add interceptor for malloc_usable_size()
...
llvm-svn: 176013
2013-02-25 08:43:10 +00:00
Alexey Samsonov
2c5cbd2b38
[Sanitizer] extend internal libc with stat/fstat/lstat functions
...
llvm-svn: 174316
2013-02-04 10:16:50 +00:00
Alexey Samsonov
39313b780d
[Sanitizer] make internal_open have the same interface as libc version
...
llvm-svn: 174187
2013-02-01 15:58:46 +00:00
Dmitry Vyukov
71242b064e
tsan: flip is_write bit in shadow to is_read
...
this makes calculation of interesting predicates faster
llvm-svn: 174164
2013-02-01 10:02:55 +00:00
Dmitry Vyukov
ba4291480d
tsan: detect races between plain and atomic memory accesses
...
llvm-svn: 174163
2013-02-01 09:42:06 +00:00
Alexey Samsonov
49a32c1d08
[Sanitizer] update style checker script and fix namespace style warnings
...
llvm-svn: 173910
2013-01-30 07:45:58 +00:00
Kostya Serebryany
fa79cd65e2
[sanitizer] fix calloc overflow in asan/tsan/msan
...
llvm-svn: 173441
2013-01-25 11:46:22 +00:00
Dmitry Vyukov
83566dadaf
tsan: allow a front-end to provide default suppressions
...
llvm-svn: 173345
2013-01-24 13:50:10 +00:00
Dmitry Vyukov
6e406cda4b
tsan: implement malloc stats querying
...
llvm-svn: 173332
2013-01-24 09:08:03 +00:00
Alexey Samsonov
193b45f4fe
CMake variables renaming: X86_64->x86_64 I386->i386
...
llvm-svn: 172812
2013-01-18 12:45:44 +00:00
Dmitry Vyukov
1046031e1a
tsan: exclude flaky test
...
llvm-svn: 169729
2012-12-10 09:16:17 +00:00
Dmitry Vyukov
fd5ebcd1b0
tsan: add mutexsets to reports
...
With this change reports say what mutexes the threads hold around the racy memory accesses.
llvm-svn: 169493
2012-12-06 12:16:15 +00:00
Dmitry Vyukov
e1a7f338a3
tsan: dynamic history size
...
introduces history_size parameter that can be used to control trace size at startup
llvm-svn: 168786
2012-11-28 12:19:50 +00:00
Dmitry Vyukov
00e4604d6b
tsan: change fast state layout in preparation to dynamic traces
...
llvm-svn: 168784
2012-11-28 10:49:27 +00:00
Dmitry Vyukov
2429b02770
tsan: move traces from tls into dedicated storage at fixed address
...
helps to reduce tls size (it's weird to have multi-MB tls)
will help with dynamically adjustable trace size
llvm-svn: 168783
2012-11-28 10:35:31 +00:00
Alexey Samsonov
008274440a
[Sanitizer] move unit test for Printf from tsan to sanitizer_common
...
llvm-svn: 167296
2012-11-02 12:36:11 +00:00
Alexey Samsonov
848abbd236
[TSan] s/uintptr_t/intptr_t in TSan test and enforce stack size limit in one of TSan output tests that somewhy fails otherwise
...
llvm-svn: 164116
2012-09-18 09:09:35 +00:00
Alexey Samsonov
3040830fcd
[TSan] fix a typo in test dependencies. Silence few remaining pedantic gcc warnings in TSan tests.
...
llvm-svn: 164115
2012-09-18 08:33:37 +00:00
Alexey Samsonov
0fa3ea69e2
[TSan] move: rtl_tests->tests/rtl unit_tests->tests/unit to make a single root for gtest-based tests. Support running these tests from lit via check-tsan command.
...
llvm-svn: 164022
2012-09-17 10:02:17 +00:00