Commit Graph

105 Commits

Author SHA1 Message Date
Dmitry Vyukov c0ae07e98c tsan: fix signal_longjmp test in debug mode
In debug mode tsan checks that user accesses
access user memory. NULL is not user memory.
So the test fails. Allocate real inaccessible
memory for the test.

llvm-svn: 218069
2014-09-18 19:00:02 +00:00
Dmitry Vyukov 9767d2f8da tsan: fix double semicolon ;;
llvm-svn: 218067
2014-09-18 18:58:44 +00:00
Dmitry Vyukov 538ceee2b9 tsan: fix bug number in comment
llvm-svn: 217992
2014-09-17 22:57:57 +00:00
Dmitry Vyukov 6466f43688 tsan: fix crash when a program registers zillions of atexit callbacks
I don't remember that crash on mmap in internal allocator
ever yielded anything useful, only crashes in rare wierd untested situations.
One of the reasons for crash was to catch if tsan starts allocating
clocks using mmap. Tsan does not allocate clocks using internal_alloc anymore.
Solve it once and for all by allowing mmaps.

llvm-svn: 217929
2014-09-17 00:12:50 +00:00
Dmitry Vyukov 69c4d37b45 tsan: support longjmp out of signal handlers
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=75

llvm-svn: 217908
2014-09-16 21:48:22 +00:00
Alexey Samsonov 62063b46fc Use "-gline-tables-only" instead of "-g" in sanitizer test suites.
We are interested in verifying that -gline-tables-only provides enough
debug information for verbose error reports and symbolized stack traces.

llvm-svn: 217284
2014-09-05 22:05:32 +00:00
Dmitry Vyukov f8cfdd9207 tsan: handle early signals
The second part of the fix of
https://code.google.com/p/thread-sanitizer/issues/detail?id=71

llvm-svn: 217031
2014-09-03 12:25:22 +00:00
Dmitry Vyukov 26411d6929 tsan: more precise handling of atexit callbacks
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=74

llvm-svn: 216906
2014-09-02 14:22:31 +00:00
Dmitry Vyukov 1841219abd tsan: restructure signal handling to allow recursive handling
Fixes issue
https://code.google.com/p/thread-sanitizer/issues/detail?id=71

llvm-svn: 216903
2014-09-02 12:27:45 +00:00
Dmitry Vyukov 34fb3799a3 tsan: fix false positive related to signal handlers
Users expect synchronization between sigaction and arrival
of the signal. See the test for details.

llvm-svn: 216878
2014-09-01 12:46:42 +00:00
Alexey Samsonov 591d15272e [TSan] Add -lpthread to the test which uses pthread_ functions
llvm-svn: 215939
2014-08-18 22:09:17 +00:00
Dmitry Vyukov 70db9d4d72 tsan: allocate vector clocks using slab allocator
Vector clocks is the most actively allocated object in tsan runtime.
Current internal allocator is not scalable enough to handle allocation
of clocks in scalable way (too small caches). This changes transforms
clocks to 2-level array with 512-byte blocks. Since all blocks are of
the same size, it's possible to cache them more efficiently in per-thread caches.

llvm-svn: 214912
2014-08-05 18:45:02 +00:00
Dmitry Vyukov 5b1b02eb29 tsan: improve shadow flush benchmark
allow to specify access stride

llvm-svn: 214029
2014-07-26 16:40:33 +00:00
Kostya Serebryany 6cdb0b8051 [tsan] honour XFAIL in tsan/test_output.sh
llvm-svn: 212952
2014-07-14 16:03:13 +00:00
Kostya Serebryany 850a837cf2 [tsan] add a printf to a test
llvm-svn: 212951
2014-07-14 15:52:33 +00:00
Kostya Serebryany 94b6801839 [tsan] add a currently-failing test with a must-deadlock
llvm-svn: 212944
2014-07-14 14:27:21 +00:00
Diego Novillo 89360191c8 Fix expected column numbers in two tests.
This is a minor fix to two tsan tests that were expecting the wrong
column information. Now that clang emits column information by default
in its debugging output, the tests had started failing.

llvm-svn: 212779
2014-07-10 23:29:10 +00:00
Alexey Samsonov 3a2cb3ad41 [TSan] Fix a bug in libcxx-tsan build conditions spotted by Ryuta Suzuki
llvm-svn: 212749
2014-07-10 18:17:51 +00:00
Dmitry Vyukov 3f5ad1a98e tsan: allow memory overlap in __tsan_java_move
JVM actually moves memory between overlapping ranges.

llvm-svn: 212560
2014-07-08 20:01:12 +00:00
Kostya Serebryany 6136aae323 [tsan] Enable tsan's deadlock detector by default.
The tsan's deadlock detector has been used in Chromium for a while;
it found a few real bugs and reported no false positives.
So, it's time to give it a bit more exposure.

llvm-svn: 212533
2014-07-08 13:40:08 +00:00
Alexey Samsonov c1856835d1 [Sanitizer] Move test for malloc/free hooks under test/sanitizer_common
llvm-svn: 212474
2014-07-07 18:47:29 +00:00
Alexey Samsonov 91bb8e0e3a Generalize sanitizer allocator public interface.
Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).

Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.

llvm-svn: 212469
2014-07-07 17:39:31 +00:00
Dmitry Vyukov 9507af2d89 tsan: fix and re-enable a test
llvm-svn: 211966
2014-06-27 22:27:02 +00:00
Evgeniy Stepanov 63338af398 [tsan] Disable a failing test.
java_finalizer is failing on all sanitizer bots since it was added in r211829.

llvm-svn: 211882
2014-06-27 08:10:27 +00:00
Dmitry Vyukov fb251f51a9 tsan: add __tsan_java_finalize interface function
It is required to prevent false positives between object ctor and finalizer,
as otherwise they look completely unsynchronized.

llvm-svn: 211829
2014-06-27 00:47:38 +00:00
Alexey Samsonov f0d1fd6b32 [TSan] Exclude blacklist tests from manual test runner
llvm-svn: 210494
2014-06-09 22:02:14 +00:00
Alexey Samsonov 2c8dda4e53 [TSan] Make lit-tests more self-contained
llvm-svn: 210370
2014-06-06 21:04:55 +00:00
Alexey Samsonov 5c8ce21a6c [TSan] Add a test case for r209939
llvm-svn: 209940
2014-05-31 00:12:20 +00:00
Dmitry Vyukov dee68ba6e3 tsan: add a test from data-race-test suite:
https://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc

llvm-svn: 209900
2014-05-30 14:27:31 +00:00
Dmitry Vyukov 233f401c2b tsan: make positive tests more robust
Add a script that is used to deflake inherently flaky tsan tests.
It is invoked from lit tests as:
%deflake %run %t
The script runs the target program up to 10 times,
until it produces a tsan warning.

llvm-svn: 209898
2014-05-30 14:08:51 +00:00
Dmitry Vyukov bde4c9c773 tsan: refactor storage of meta information for heap blocks and sync objects
The new storage (MetaMap) is based on direct shadow (instead of a hashmap + per-block lists).
This solves a number of problems:
 - eliminates quadratic behaviour in SyncTab::GetAndLock (https://code.google.com/p/thread-sanitizer/issues/detail?id=26)
 - eliminates contention in SyncTab
 - eliminates contention in internal allocator during allocation of sync objects
 - removes a bunch of ad-hoc code in java interface
 - reduces java shadow from 2x to 1/2x
 - allows to memorize heap block meta info for Java and Go
 - allows to cleanup sync object meta info for Go
 - which in turn enabled deadlock detector for Go

llvm-svn: 209810
2014-05-29 13:50:54 +00:00
Evgeniy Stepanov 15d71b598e [sanitizer] Replace -lpthread with -pthread in tests.
-lpthread does not work on Android.

llvm-svn: 209735
2014-05-28 13:13:30 +00:00
Dmitry Vyukov 96ebc5d7db tsan: deflake test
llvm-svn: 209290
2014-05-21 12:02:08 +00:00
Alexey Samsonov 41c7302888 [TSan] Improve support for running TSan test suite with GCC-TSan.
Test results with GCC-4.9.0: 78 expected passes, 74 unexpected failures.

llvm-svn: 209014
2014-05-16 20:33:56 +00:00
Alexey Samsonov 36132035ca [CMake] Don't build libcxx_tsan with compilers other than Clang
llvm-svn: 209003
2014-05-16 18:22:04 +00:00
Alp Toker 1ee7fc7a1a Fix typos
llvm-svn: 208841
2014-05-15 02:22:34 +00:00
Alexey Samsonov 5716928ae2 [TSan] Build TSan-instrumented version of libcxx and use it in lit tests.
TSan can produce false positives in code that uses C++11 threading,
as it doesn't see synchronization inside standard library. See
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035408.html
for an example of such case.

We may build custom TSan-instrumented version libcxx to fight with that.
This change adds build rules for libcxx_tsan and integrates it into
testing infrastructure.

llvm-svn: 208737
2014-05-13 22:30:16 +00:00
Alexander Potapenko 4a6cac4382 [libsanitizer] Use internal_fork() to spawn the symbolizer process.
This should fix https://code.google.com/p/thread-sanitizer/issues/detail?id=61

llvm-svn: 208707
2014-05-13 16:17:54 +00:00
Greg Fitzgerald b8aae5405b Add %run to all lit tests
llvm-svn: 207709
2014-04-30 21:34:17 +00:00
Dmitry Vyukov 56a18f02ea tsan: better reports for "read lock of a write locked mutex"
llvm-svn: 207209
2014-04-25 08:58:23 +00:00
Dmitry Vyukov e296164f77 tsan: improve "read unlock of a write locked mutex" report
llvm-svn: 207208
2014-04-25 08:21:30 +00:00
Dmitry Vyukov 66dbbbc47b tsan: fix tests
failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-centos-6.5/builds/3747/steps/test/logs/stdio

llvm-svn: 207207
2014-04-25 08:13:45 +00:00
Dmitry Vyukov 2c87108a42 tsan: better report for bad mutex unlocks
+ fixes crashes due to races on symbolizer, see
https://code.google.com/p/thread-sanitizer/issues/detail?id=55

llvm-svn: 207206
2014-04-25 07:55:11 +00:00
Dmitry Vyukov ea014b787a tsan: add new test for commit 207204 (forget to add new file)
llvm-svn: 207205
2014-04-25 07:49:36 +00:00
Dmitry Vyukov ac81ee5533 tsan: fix atexit handling after fork
fixes issue http://code.google.com/p/thread-sanitizer/issues/detail?id=57

llvm-svn: 206980
2014-04-23 13:42:16 +00:00
Dmitry Vyukov b1edac069e tsan: more precise check for "app memory" in COMPAT mode
this fires when a user makes mmap with fixed address (see the test)

llvm-svn: 206952
2014-04-23 07:01:02 +00:00
Dmitry Vyukov 5e52f3a142 tsan: deflake test
ocasionally it fails with a slightly different report:

WARNING: ThreadSanitizer: signal handler spoils errno (pid=3674)
    #0 MyHandler(int, siginfo*, void*)
    ...
    #4 __tsan_free_hook
    #5 main signal_errno.cc:40
llvm-svn: 206754
2014-04-21 14:21:24 +00:00
Dmitry Vyukov 10d4b14a16 tsan: add benchmark that allows to investigate shadow memory consumption
llvm-svn: 206578
2014-04-18 10:37:39 +00:00
Evgeniy Stepanov 77d8793fa6 [tsan] Fix output tests.
llvm-svn: 206031
2014-04-11 13:01:20 +00:00
Evgeniy Stepanov 652cbd7c15 [tsan] Fix false positive on xdr*_create.
llvm-svn: 206030
2014-04-11 12:29:24 +00:00