Commit Graph

579 Commits

Author SHA1 Message Date
Sergey Matveev 0d8cc4a2d2 [sanitizer] Fix build breakage in Go TSan.
llvm-svn: 181428
2013-05-08 13:59:30 +00:00
Sergey Matveev af179b8d63 [sanitizer] Move GetStackTrace from ASan to sanitizer_common.
llvm-svn: 181424
2013-05-08 12:45:55 +00:00
Sergey Matveev 3704453368 [sanitizer] Fixed InitTlsSize for Android.
llvm-svn: 181330
2013-05-07 16:29:26 +00:00
Sergey Matveev 88d0c664ef [sanitizer] Fixed includes in sanitizer_linux.cc for Android.
llvm-svn: 181327
2013-05-07 15:38:53 +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
Evgeniy Stepanov 517118e6b4 [sanitizer] Sanitizer __internal_*stat interface.
With this change, __internal_*stat always expect a "struct stat *" argument.
This avoids stat/stat64 caller-side confusion (sanitizer_common tests already
made this mistake), and allows the use of __internal_fstat() as a drop-in
replacement for libc's fstat().

llvm-svn: 181311
2013-05-07 12:47:04 +00:00
Sergey Matveev 0c8ed9ce44 [asan] Common flags in ASan.
Some flags that are common to ASan/MSan/TSan/LSan have been moved to
sanitizer_common.

llvm-svn: 181193
2013-05-06 11:27:58 +00:00
Dmitry Vyukov 93b2cba03b asan: fix windows build
llvm-svn: 180788
2013-04-30 13:30:29 +00:00
Dmitry Vyukov e8fa45a02c asan/tsan: fix printf(), on the second pass it prints garbage and crashes on random pointer dereference
llvm-svn: 180784
2013-04-30 12:27:48 +00:00
Dmitry Vyukov 639ba01fc3 asna/tsan/msan: fix wait() interceptors to allow NULL arguments
llvm-svn: 180703
2013-04-29 09:04:24 +00:00
Sergey Matveev b2151b8200 Revert r180599 "[sanitizer] Clear LD_PRELOAD when forking an external symbolizer."
llvm-svn: 180602
2013-04-26 13:01:40 +00:00
Sergey Matveev 3c8fbe1013 [sanitizer] Clear LD_PRELOAD when forking an external symbolizer.
llvm-svn: 180599
2013-04-26 11:35:05 +00:00
Dmitry Vyukov beaf786151 tsan: disable getpwuid_r() and glob64() interceptors under tsan, because they cause interceptor recursion if user intercepts fopen()
llvm-svn: 180182
2013-04-24 11:06:05 +00:00
Evgeniy Stepanov 44b75efab4 [sanitizer] Intercept inet_pton and inet_ntop.
llvm-svn: 180107
2013-04-23 14:05:15 +00:00
Alexey Samsonov f36c5a8431 Revert r180082 and add a test for SetEnv function
llvm-svn: 180098
2013-04-23 12:49:12 +00:00
Evgeniy Stepanov 3076ba0a08 [sanitizer] Intercept getgrnam{_r}, getgrgid{_r}.
llvm-svn: 180091
2013-04-23 12:01:20 +00:00
Evgeniy Stepanov 0cd7cf8217 [msan] Allow clock_getres(, 0).
llvm-svn: 180090
2013-04-23 11:48:31 +00:00
Alexey Samsonov e7540e3561 [Sanitizer] Delete unused function
llvm-svn: 180082
2013-04-23 08:18:09 +00:00
Evgeniy Stepanov 1a2262e1c9 [sanitizer] Fix lint.
llvm-svn: 180012
2013-04-22 13:28:26 +00:00
Alexey Samsonov 1a6cfb46e5 [Sanitizer] Rework r176802: share code between Printf and Report and simplify it a bit
llvm-svn: 179755
2013-04-18 13:18:23 +00:00
Alexey Samsonov d1efa5ef96 [Sanitizer] Don't die in symbolizer if it can't read /proc/self/exe link
llvm-svn: 179754
2013-04-18 12:46:33 +00:00
Andy Gibbs f6edda8c30 Wrap macro invocations in braces to supress 'suggest braces around empty body in an ‘if’ statement' warning.
llvm-svn: 179597
2013-04-16 15:18:55 +00:00
Evgeniy Stepanov 9b59a39f42 [sanitizer] Implement wait4 and waitpid syscall hooks.
llvm-svn: 179592
2013-04-16 13:06:20 +00:00
Evgeniy Stepanov 9fb82357dc [sanitizer] More syscall handler placeholders.
This time it's the full list scavenged from syscalls.h
Fixed return value type.

llvm-svn: 179378
2013-04-12 14:06:40 +00:00
Timur Iskhodzhanov 664ec5d7a8 Finally drop the 'static' from INLINE and ALWAYS_INLINE
The ALWAYS_INLINE doesn't have static on POSIX anyways since r178341; the INLINE is only used in .h files, so shouldn't have been 'static' in the first place

llvm-svn: 179371
2013-04-12 09:37:20 +00:00
Evgeniy Stepanov f5523116e9 [sanitizer] Syscall hooks.
Pre- and post- hooks for linux syscalls. Not wired into anything, but exposed
through public interface.

llvm-svn: 179288
2013-04-11 14:37:04 +00:00
Alexander Potapenko 227e22de5a [ASan] Do not check the shadow of NULL argument in the time() interceptor.
Add a test for time().

llvm-svn: 179177
2013-04-10 15:13:00 +00:00
Evgeniy Stepanov 460067823b [sanitizer] Interceptors for wait*.
llvm-svn: 179096
2013-04-09 14:34:59 +00:00
Evgeniy Stepanov 69967c2835 [msan] Intercept glob() with tests.
llvm-svn: 179091
2013-04-09 11:35:13 +00:00
Alexey Samsonov 7ad129277e [Sanitizer] fix TSan tests: remove global ctor from sanitizer_common, run load_shared_lib test only in lit
llvm-svn: 179090
2013-04-09 07:46:20 +00:00
Kostya Serebryany 9d28efc1ad [asan] relax Linux/zero-base-shadow.cc to make it pass on newer Ubuntu; fix lint
llvm-svn: 179088
2013-04-09 07:08:05 +00:00
Chandler Carruth 2b3c00eec7 Revert r179012: "[msan] Intercept glob()."
This was committed without tests and contains obvious bugs. That's not
acceptable. It broke address sanitizer for most programs using glob(3).

llvm-svn: 179054
2013-04-08 20:59:44 +00:00
Alexander Potapenko 32efd25b93 [libsymbolized] If we can't find an address in the list of shared libraries, try to reload it.
Add a regression test for the case where such behavior helps TSan:
  1. race is reported in the main module
  2. new shared library is loaded
  3. race is reported in the shared library

llvm-svn: 179032
2013-04-08 17:46:34 +00:00
Evgeniy Stepanov 8cd707a1a6 [msan] Intercept glob().
llvm-svn: 179012
2013-04-08 09:03:00 +00:00
Evgeniy Stepanov e20c780aaf [tsan] Fix build.
llvm-svn: 179008
2013-04-08 08:46:25 +00:00
Kostya Serebryany e6459977b8 [sanitizer] Fix boundary condition in LargeMmapAllocator::GetBlockBegin. Patch by Sergey Matveev
llvm-svn: 179007
2013-04-08 08:43:22 +00:00
Evgeniy Stepanov 7ba7207f1d [msan] Intercept time().
llvm-svn: 179002
2013-04-08 08:25:22 +00:00
Kostya Serebryany 5b4267f7e7 [sanitizer] found a bug by code inspection: CHECK(a=b) instead of CHECK(a==b). Was puzzled why lint did not catch it. Turns out this check was disabled for asan source. fix all cases and enable the check
llvm-svn: 178872
2013-04-05 14:40:25 +00:00
Alexey Samsonov 2a4668557f [Sanitizer] enquote the module name when passing it to external symbolizer
llvm-svn: 178864
2013-04-05 11:54:23 +00:00
Alexey Samsonov 46b8665ea4 Remove InternalAlloc/InternalFree calls from StopTheWorld. Patch by Sergey Matveev.
llvm-svn: 178855
2013-04-05 07:41:21 +00:00
Alexey Samsonov 734aab4066 [Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
llvm-svn: 178853
2013-04-05 07:30:29 +00:00
Evgeniy Stepanov 24b2169e07 [sanitizer] Android lacks ucontext_t definition.
llvm-svn: 178756
2013-04-04 09:21:48 +00:00
Evgeniy Stepanov 7b0e132551 [sanitizer] Use ucontext_t instead of "struct ucontext".
Fixes Mac build.

llvm-svn: 178755
2013-04-04 09:03:56 +00:00
Evgeniy Stepanov 1f8b3538b4 [msan] Unpoison siginfo_t and ucontext_t in signal handlers.
Add wrappers for all user signal handlers to unpoison the handler's arguments.

llvm-svn: 178754
2013-04-04 08:22:52 +00:00
Kostya Serebryany c3525ce6ac [sanitizer] while doing fast unwinding make sure that the frame pointer is aligned; fix lint
llvm-svn: 178747
2013-04-04 06:52:40 +00:00
Alexey Samsonov 87c2a87b50 [Sanitizer] Fix OnPrint weak hook. Disable weak hooks for gotsan.
llvm-svn: 178640
2013-04-03 13:22:54 +00:00
Alexey Samsonov 60adc1781e [Sanitizer] Be more careful with arch-specific defines in StopTheWorld code
llvm-svn: 178630
2013-04-03 08:26:03 +00:00
Alexey Samsonov a0e28a7aaa [Sanitizer] Kill the remainders of platform defines in favor of SANITIZER_ defines
llvm-svn: 178627
2013-04-03 07:24:35 +00:00
Alexey Samsonov 8d18cc3096 [Sanitizer] Fix StopTheWorld includes on Android. Patch by Sergey Matveev.
llvm-svn: 178625
2013-04-03 07:06:10 +00:00
Evgeniy Stepanov f8213b4eb3 [sanitizer] More interceptors.
getpwnam, getpwuid, getpwnam_r, getpwuid_r, clock_getres, clock_gettime,
clock_settime, getitimer, setitimer, sigaction (MSan).

llvm-svn: 178465
2013-04-01 14:47:21 +00:00