Evgeniy Stepanov
b76b687628
[sanitizer] Intercept __xpg_strerror_r.
...
llvm-svn: 195839
2013-11-27 12:29:10 +00:00
Dmitry Vyukov
3238e1c913
tsan: better diagnostics if thread finishes with ignores enabled
...
print thread creation stack
and stacks where ignores were enabled.
llvm-svn: 195836
2013-11-27 11:30:28 +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
ee882ba4a1
tsan: support synchronization by means of linux aio
...
http://llvm-reviews.chandlerc.com/D2269
llvm-svn: 195830
2013-11-27 09:10:47 +00:00
Dmitry Vyukov
8cb7d46d98
tsan: filter out more bogus fd values
...
people do close(sysconf(_SC_OPEN_MAX)) after fork, where _SC_OPEN_MAX=1200000.
llvm-svn: 195645
2013-11-25 14:53:29 +00:00
Dmitry Vyukov
5f1a783914
tsan: deflake tests
...
the tests produce episodic flakes
the hypothesis is that it's due to our "racy" race detection algorithm
sleeps should remove the flakes
llvm-svn: 195351
2013-11-21 12:23:17 +00:00
Dmitry Vyukov
5fa72d4c3f
tsan: add -lm to output test build script
...
as common sanitizer interceptors now require it
llvm-svn: 195346
2013-11-21 11:49:08 +00:00
Dmitry Vyukov
4ca8ee692e
tsan: fix handling of setjmp
...
It's incorrect to take address of setjmp,
because it may not (ligally) present in libc.
Fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188
llvm-svn: 195345
2013-11-21 11:48:29 +00:00
Kostya Serebryany
53c51a1675
[tsan] use FileCheck in race_on_speculative_load.cc
...
llvm-svn: 195331
2013-11-21 09:09:47 +00:00
Kostya Serebryany
95f3e54066
[tsan] add a run-time-side regression test for https://code.google.com/p/thread-sanitizer/issues/detail?id=40 (tsan-hostile load speculation)
...
llvm-svn: 195325
2013-11-21 07:31:12 +00:00
Dmitry Vyukov
2918b67029
tsan: fix WTFAnnotateBenignRaceSized annotation
...
actually use the passed size
llvm-svn: 195133
2013-11-19 16:03:15 +00:00
Dmitry Vyukov
4bbe6dc8a9
tsan: add support for robust mutexes
...
llvm-svn: 194823
2013-11-15 16:58:12 +00:00
Dmitry Vyukov
0b76e408b4
tsan: add proper cfi directives to assembly code
...
this allows gdb to unwind through our hacky call
llvm-svn: 194803
2013-11-15 10:25:53 +00:00
Bob Wilson
a08e9ac927
Reapply asan coverage changes 194702-194704.
...
I still don't know what is causing our bootstrapped LTO buildbots to fail,
but llvm r194701 seems to be OK and I can't imagine that these changes could
cause the problem.
llvm-svn: 194790
2013-11-15 07:18:15 +00:00
Bob Wilson
abc91eacac
Speculatively revert asan coverage changes 194702-194704.
...
Apple's bootstrapped LTO builds have been failing, and these changes (along
with llvm 194701) are the only things on the blamelist. I will either reapply
these changes or help debug the problem, depending on whether this fixes the
buildbots.
llvm-svn: 194779
2013-11-15 03:26:28 +00:00
Kostya Serebryany
91c52d9552
[asan] Poor man's coverage that works with ASan (compiler-rt part)
...
llvm-svn: 194702
2013-11-14 13:28:17 +00:00
Alexey Samsonov
6345150992
[Sanitizer] Specify a default value for each common runtime flag
...
llvm-svn: 194479
2013-11-12 13:59:08 +00:00
Evgeniy Stepanov
90e12a6cb2
[sanitizer] Avoid needless use of stringification (#symver) in INTERCEPT_FUNCTION_VER.
...
This is a workaround for clang-format bug (PR17874).
llvm-svn: 194468
2013-11-12 10:21:52 +00:00
Evgeniy Stepanov
b69699eb58
[sanitizer] Warn if interception fails.
...
This includes a clang-format pass over common interceptors.
llvm-svn: 194372
2013-11-11 11:28:30 +00:00
Alexey Samsonov
b3d939902a
[Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.
...
llvm-svn: 194196
2013-11-07 07:28:33 +00:00
Evgeniy Stepanov
a6b5eec757
[sanitizer] Intercept strptime.
...
llvm-svn: 193903
2013-11-02 01:01:35 +00:00
Dmitry Vyukov
a131bff475
tsna: do not call user code from within runtime (from fflush)
...
llvm-svn: 193880
2013-11-01 19:15:32 +00:00
Alexey Samsonov
627e2c0dd7
[Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.
...
Summary:
TSan and MSan need to know if interceptor was called by the
user code or by the symbolizer and use pre- and post-symbolization hooks
for that. Make Symbolizer class responsible for calling these hooks instead.
This would ensure the hooks are only called when necessary (during
in-process symbolization, they are not needed for out-of-process) and
save specific sanitizers from tracing all places in the code where symbolization
will be performed.
Reviewers: eugenis, dvyukov
Reviewed By: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2067
llvm-svn: 193807
2013-10-31 21:44:07 +00:00
Evgeniy Stepanov
1cb37c4ee5
[sanitizer] Intercept getline, getdelim.
...
llvm-svn: 193730
2013-10-31 01:17:41 +00:00
Evgeniy Stepanov
0bd1f00ec6
[sanitizer] Intercept drand48_r, lrand48_r.
...
llvm-svn: 193655
2013-10-29 22:25:27 +00:00
Evgeniy Stepanov
bf60342d47
[sanitizer] Intercept sincos, remquo, lgamma, lgamma_r.
...
llvm-svn: 193645
2013-10-29 19:49:35 +00:00
Evgeniy Stepanov
596d108feb
[tsan] Fix unused variable warnings.
...
llvm-svn: 193639
2013-10-29 18:44:52 +00:00
Dmitry Vyukov
3e8432ee6c
tsan/asan: support pthread_setname_np to set thread names
...
llvm-svn: 193602
2013-10-29 10:30:39 +00:00
Dmitry Vyukov
33dd200ba9
tsan: start the background thread with signals blocked, otherwise it can steal users signals
...
llvm-svn: 193519
2013-10-28 12:29:32 +00:00
Peter Collingbourne
791e65dcfb
Overhaul the symbolizer interface.
...
This moves away from creating the symbolizer object and initializing the
external symbolizer as separate steps. Those steps now always take place
together.
Sanitizers with a legacy requirement to specify their own symbolizer path
should use InitSymbolizer to initialize the symbolizer with the desired
path, and GetSymbolizer to access the symbolizer. Sanitizers with no
such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for
initialization.
The symbolizer interface has been made thread-safe (as far as I can
tell) by protecting its member functions with mutexes.
Finally, the symbolizer interface no longer relies on weak externals, the
introduction of which was probably a mistake on my part.
Differential Revision: http://llvm-reviews.chandlerc.com/D1985
llvm-svn: 193448
2013-10-25 23:03:29 +00:00
Evgeniy Stepanov
94042e1ff2
[sanitizer] Intercept tmpnam, tmpnam_r, tempnam.
...
llvm-svn: 193415
2013-10-25 15:51:48 +00:00
Evgeniy Stepanov
2acb2470f9
[sanitizer] Remove pthread_attr_getstackaddr interceptor.
...
The function is deprecated.
llvm-svn: 193409
2013-10-25 14:27:00 +00:00
Evgeniy Stepanov
c2b6cb0747
[sanitizer] Intercept pthread_attr_get*.
...
llvm-svn: 193405
2013-10-25 13:01:31 +00:00
Dmitry Vyukov
53491113f0
tsan: do not crash when apparently bogus fd is passed to e.g. close
...
some tests test libc/filesystem error handling paths (e.g. close(INT_MAX)),
currently such tests fail
with this change they work as expected
llvm-svn: 193400
2013-10-25 09:45:44 +00:00
Evgeniy Stepanov
be9cdbb58c
[sanitizer] Intercept random_r.
...
llvm-svn: 193396
2013-10-25 08:58:13 +00:00
Evgeniy Stepanov
f312b480e2
[sanitizer] Intercept shmctl.
...
llvm-svn: 193348
2013-10-24 14:47:34 +00:00
Evgeniy Stepanov
3e6064f9d2
[sanitizer] Intercept ether_* functions.
...
llvm-svn: 193241
2013-10-23 13:57:47 +00:00
Evgeniy Stepanov
0229c09d43
[sanitizer] Intercept initgroups.
...
llvm-svn: 193158
2013-10-22 12:24:48 +00:00
Evgeniy Stepanov
3cb9df042e
[sanitizer] Move statfs/fstatfs to common interceptors and add statvfs/fstatvfs.
...
llvm-svn: 192965
2013-10-18 11:14:16 +00:00
Evgeniy Stepanov
70d5abfba2
[sanitizer] Intercept getmntent, getmntent_r.
...
llvm-svn: 192959
2013-10-18 09:41:43 +00:00
Alexey Samsonov
bc7c87a8cb
[Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common interceptors
...
llvm-svn: 192876
2013-10-17 09:24:03 +00:00
Dmitry Vyukov
333112a439
tsan: merge 2 similar tests into 1
...
llvm-svn: 192874
2013-10-17 08:27:24 +00:00
Dmitry Vyukov
e88dbe5774
tsan: add a test for __tsan_default_options()
...
llvm-svn: 192873
2013-10-17 08:13:38 +00:00
Dmitry Vyukov
cdc971c03c
tsan: revert variable name change in test
...
It works as is with new llvm-symbolizer.
llvm-svn: 192798
2013-10-16 15:57:23 +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
1fe87e031c
[TSan] Extend test for reporting globals with races on them
...
llvm-svn: 192782
2013-10-16 09:56:17 +00:00
Alexey Samsonov
edecc38395
Make some pthread_mutex_* and pthread_cond_* interceptors common.
...
Reviewers: eugenis, dvyukov
Reviewed By: dvyukov
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1937
llvm-svn: 192774
2013-10-16 08:20:31 +00:00
Dmitry Vyukov
81f76f6ff7
tsan: introduce __tsan_default_options() function
...
The function allows to statically setup default values for flags.
The interafece matches what asan/msan provide.
llvm-svn: 192715
2013-10-15 15:58:11 +00:00
Dmitry Vyukov
7502a3a90c
tsan: use verbosity flag in sanitizer_common code directly
...
now it's available from common_flags()
llvm-svn: 192705
2013-10-15 14:12:26 +00:00