Kostya Serebryany
b1333fe831
[sanitizer] fix asan on the platforms where the page size is not a compile-time constant (or at least where EXEC_PAGESIZE may not be trustworthy), e.g. powerpc64.
...
llvm-svn: 182351
2013-05-21 06:15:50 +00:00
Peter Collingbourne
b69b8a4a8f
[nolibc] Move GetPageSize to the individual platforms.
...
GetPageSize wraps sysconf(_SC_PAGESIZE) on POSIX platforms, but
sysconf resides in libc. To make this libc-independent on Linux,
move the wrapper to sanitizer_mac.cc and return the Linux-specific
constant EXEC_PAGESIZE in the sanitizer_linux.cc implementation.
llvm-svn: 182303
2013-05-20 17:05:29 +00:00
Peter Collingbourne
0c8df4e1d8
[nolibc] Move libc-dependent sanitizer_linux.cc code to sanitizer_linux_libcdep.cc.
...
llvm-svn: 182292
2013-05-20 15:57:44 +00:00
Peter Collingbourne
d5169edc36
[nolibc] Make GetArgsAndEnv libc-independent.
...
__libc_stack_end is made into a weak symbol if possible. If libc is
not linked, read args and environment from /proc.
llvm-svn: 182276
2013-05-20 14:25:32 +00:00
Alexey Samsonov
cbbdfc50ee
Build LSan on x86_64 only if this target is supported
...
llvm-svn: 182272
2013-05-20 14:16:45 +00:00
Sergey Matveev
6dd91e475a
[lsan] Fix r182256.
...
Add missing call to GetUserBegin().
llvm-svn: 182267
2013-05-20 14:04:56 +00:00
Alexander Potapenko
a15d49cc1f
[libsanitizer] Introduce INTERCEPTOR_WITH_SUFFIX which is to be used for appending the __DARWIN_ALIAS() version suffixes to function names on Darwin.
...
This should fix asan/lit_tests/wait.cc under ASan.
llvm-svn: 182259
2013-05-20 13:32:35 +00:00
Sergey Matveev
bcfd838bcb
[lsan] GetUserBegin() in LSan.
...
Separate the notions of user-visible chunk and allocator chunk, to facilitate
ASan integration.
llvm-svn: 182256
2013-05-20 13:08:23 +00:00
Timur Iskhodzhanov
67c918a424
Fix realloc'ing freed/invalid pointers
...
See https://code.google.com/p/address-sanitizer/issues/detail?id=187 for the details
llvm-svn: 182255
2013-05-20 13:05:58 +00:00
Sergey Matveev
6a6c5b6dee
[asan] Modify ASan metadata atomically.
...
We need this to avoid races when ASan and LSan are used together.
llvm-svn: 182252
2013-05-20 11:25:18 +00:00
Sergey Matveev
3c20829559
[lsan] CMakeLists and lit test configs for LSan.
...
llvm-svn: 182251
2013-05-20 11:13:33 +00:00
Sergey Matveev
48c1d1acad
[lsan] Tests for LeakSanitizer.
...
llvm-svn: 182250
2013-05-20 11:09:27 +00:00
Sergey Matveev
b5483be858
[lsan] Common leak checking module.
...
Leak checking functionality which will be shared between
LSan/ASan/MSan.
llvm-svn: 182249
2013-05-20 11:06:50 +00:00
Sergey Matveev
3d97cdd140
[lsan] Standalone LSan initialization.
...
llvm-svn: 182248
2013-05-20 11:04:43 +00:00
Sergey Matveev
a5f9691dfb
[lsan] Interceptors for standalone LSan.
...
llvm-svn: 182247
2013-05-20 11:01:40 +00:00
Sergey Matveev
c7d003ec43
[lsan] Thread registry for standalone LSan.
...
llvm-svn: 182246
2013-05-20 10:57:53 +00:00
Sergey Matveev
866abfb3fe
[lsan] Allocator for standalone LSan.
...
This is the first in a series of CLs implementing LeakSanitizer.
http://clang.llvm.org/docs/LeakSanitizer.html
llvm-svn: 182245
2013-05-20 10:54:00 +00:00
Timur Iskhodzhanov
667cae7b69
[ASan] Remove an unused ChunkBase field
...
Also fix wrong alignment maths and an outdated comment
llvm-svn: 182238
2013-05-20 08:20:17 +00:00
Kostya Serebryany
3469375e4f
[sanitizer] factor out ByteMap from SizeClassAllocator32 so that it can be later replaced with a more memory-efficient implementation on 64-bit.
...
llvm-svn: 182234
2013-05-20 07:29:21 +00:00
Richard Smith
73241096f7
Avoid rebuilding the RTSanitizerCommon objects when building clang_rt.san.
...
llvm-svn: 182218
2013-05-19 19:53:01 +00:00
Timur Iskhodzhanov
836a4f3643
Replace CHECK(a == b); with CHECK_EQ(a, b); throughout asan_allocator2.cc
...
llvm-svn: 182198
2013-05-18 18:27:33 +00:00
David Blaikie
97c3018aac
Fix the UBSan CMake build broken in r182118
...
llvm-svn: 182177
2013-05-17 23:57:24 +00:00
Peter Collingbourne
ffaf2eac4d
[nolibc] Move all platforms to internal_getpid.
...
Before, we had an unused internal_getpid function for Linux, and a
platform-independent GetPid function. To make the naming conventions
consistent for syscall-like functions, the GetPid syscall wrapper
in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is
renamed to internal_getpid, bringing the Linux variant into use.
llvm-svn: 182132
2013-05-17 16:56:53 +00:00
Peter Collingbourne
6d4a7d3723
[nolibc] Begin moving sanitizer_common's libc-dependent code to a separate library
...
Introduce a new object library, RTSanitizerCommonLibc, which will contain
the subset of sanitizer_common with libc dependencies. RTSanitizerCommon
contains the remainder of sanitizer_common, and is intended to have no
libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting
with sanitizer_common.cc, whose libc-dependent portion is moved to
sanitizer_common_libcdep.cc, the first member of the new library.
This split affects the CMake build only. The makefile build continues
to produce the full sanitizer_common library.
llvm-svn: 182118
2013-05-17 16:17:19 +00:00
Evgeniy Stepanov
bec53faad0
[sanitizer] Fix build with Android NDK r8e.
...
llvm-svn: 182110
2013-05-17 15:22:32 +00:00
Alexander Potapenko
dd3c583211
[ASan] Make the regression test for time(NULL) Linux-specific, as it crashes on Darwin (and the problem used to occur on Linux).
...
Do not use zero-based shadow for the time() test.
llvm-svn: 182107
2013-05-17 15:11:26 +00:00
Evgeniy Stepanov
44ff0eb4b9
[sanitizer] Fix gcc build.
...
llvm-svn: 182094
2013-05-17 13:30:48 +00:00
Evgeniy Stepanov
ff6728f2f8
[msan] Unpoison dlpi_name in dl_iterate_phdr interceptor.
...
llvm-svn: 182093
2013-05-17 12:51:13 +00:00
Dmitry Vyukov
9ff1023816
tsan: remove "printing report from signal handler. Can crash or hang" output
...
it was added to debug mysterious hangs, but it does not seem to happen anymore
now it only clutter up output
llvm-svn: 182089
2013-05-17 12:05:44 +00:00
Dmitry Vyukov
c9af818515
tsan: introduce recursive mutex lock/unlock java interface
...
this is required to handle Object.Wait()
llvm-svn: 182088
2013-05-17 12:03:46 +00:00
Dmitry Vyukov
69c544d857
tsan: comment out debug output in test
...
llvm-svn: 182087
2013-05-17 11:54:37 +00:00
Alexander Potapenko
00b44ba778
[ASan] Fix allow_user_segv.cc on Darwin (32-bit build required a SIGBUS handler instead of the SIGSEGV one)
...
llvm-svn: 182080
2013-05-17 08:08:50 +00:00
Alexander Potapenko
12d09f3a3d
[ASan] Fix init-order-dlopen.cc to pass under Mac OS.
...
llvm-svn: 182010
2013-05-16 14:51:01 +00:00
Alexander Potapenko
3917fe0d94
[ASan] Fix interface_symbols_darwin to pass a correct flag to nm.
...
llvm-svn: 182008
2013-05-16 13:49:12 +00:00
Kostya Serebryany
21cbaee6a9
[sanitizer] fix gcc build
...
llvm-svn: 182006
2013-05-16 13:24:31 +00:00
Kostya Serebryany
aaf7275677
[asan] symbolize when possible, even if ASAN_SYMBOLIZER_PATH is not provided. On Linux this will use dl_iterate_phdr instead of /proc/self/maps, even if the symbolizer is not installed
...
llvm-svn: 182005
2013-05-16 13:04:29 +00:00
Evgeniy Stepanov
87c6ec7cfe
[msan] Intercept dl_iterate_phdr.
...
llvm-svn: 182004
2013-05-16 13:00:25 +00:00
Sergey Matveev
efb6172cb3
[sanitizer] Fix the region overflow condition in SanitizerAllocator64::PopulateFreeList().
...
llvm-svn: 182002
2013-05-16 12:58:34 +00:00
Kostya Serebryany
19eb46f4ca
[sanitizer] fix a gcc warning
...
llvm-svn: 181992
2013-05-16 08:03:26 +00:00
Kostya Serebryany
b7ca536888
[asan] fix ShadowGapTest on PowerPC64
...
llvm-svn: 181991
2013-05-16 07:54:28 +00:00
Kostya Serebryany
a551aaa944
[sanitizer] fix the GetBlockBegin overflow bug while preserving the performance optimization (use 32-bit division when possible). Improve the benchmarks that checks for performance of GetBlockBegin/GetMetaData
...
llvm-svn: 181989
2013-05-16 07:11:16 +00:00
Kostya Serebryany
ad9971d793
[sanitizer] added a test for a bug in allocator discovered by Sergey Matveev (uint32 overflow in GetBlockBegin)
...
llvm-svn: 181984
2013-05-16 05:22:50 +00:00
Bill Wendling
c054086630
Try to improve performance by using a read/write buffer instead of I/O.
...
The calls to fwrite/fread can be very expensive. GCC avoids this by using a
buffer to read and write from the file, thus limiting the number of fwrite/fread
calls.
<rdar://problem/13466086>
llvm-svn: 181924
2013-05-15 21:31:22 +00:00
Kostya Serebryany
2b824f3575
[asan] disable BuiltinLongJmpTest on PowerPC
...
llvm-svn: 181890
2013-05-15 15:01:14 +00:00
Kostya Serebryany
2b42716213
[asan] fix powerpc build and one test; fix lint
...
llvm-svn: 181881
2013-05-15 12:36:29 +00:00
Sergey Matveev
2387687788
[sanitizer] Fix Android build.
...
llvm-svn: 181796
2013-05-14 15:22:39 +00:00
Sergey Matveev
61101ba419
[sanitizer] Fixed a bug in GetListOfModules.
...
llvm-svn: 181793
2013-05-14 14:48:58 +00:00
Sergey Matveev
4b603e5c50
[sanitizer] Filtering in GetListOfModules.
...
llvm-svn: 181791
2013-05-14 14:04:06 +00:00
Evgeniy Stepanov
f1efb256f6
Add sanitizer syscall hooks to the tool's export lists.
...
llvm-svn: 181790
2013-05-14 13:55:21 +00:00
Sergey Matveev
af05543c86
[sanitizer] LibraryNameIs in sanitizer_linux
...
llvm-svn: 181787
2013-05-14 13:24:46 +00:00
Sergey Matveev
14b56186ab
[sanitizer] Minor fixes in sanitizer_common tests.
...
llvm-svn: 181786
2013-05-14 13:19:33 +00:00
Kostya Serebryany
9d987e34f7
[tsan] fix gcc build with -Wall
...
llvm-svn: 181763
2013-05-14 08:26:55 +00:00
Sergey Matveev
d9da20f56f
[sanitizer] Generic sorting in sanitizer_common.
...
llvm-svn: 181698
2013-05-13 11:58:48 +00:00
Sergey Matveev
37432e815e
[sanitizer] Fix StopTheWorld build on non-Android ARM.
...
Original patch by Abdoulaye Walsimou Gaye.
llvm-svn: 181697
2013-05-13 10:35:20 +00:00
Peter Collingbourne
53caf563a9
Try to fix Windows build too
...
llvm-svn: 181457
2013-05-08 18:15:01 +00:00
Peter Collingbourne
8e110ce57c
Try to fix the mac buildbots
...
llvm-svn: 181440
2013-05-08 15:07:12 +00:00
Peter Collingbourne
6f4be19b57
[nolibc] Change internal syscall API to remove reliance on libc's errno.
...
This change moves to a model where the error value of a system call is
potentially contained in the return value itself rather than being
implicit in errno. The helper function internal_iserror can be used
to extract the error value from a return value. On platforms other
than Linux/x86_64 this still uses errno, but other platforms are free
to port their error handling to this new model.
Differential Revision: http://llvm-reviews.chandlerc.com/D756
llvm-svn: 181436
2013-05-08 14:43:49 +00:00
Sergey Matveev
ffe38d267c
Quick fix for ASan test build on Android.
...
llvm-svn: 181429
2013-05-08 14:11:12 +00:00
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
6eff11e714
[msan] Common flags in MSan.
...
llvm-svn: 181194
2013-05-06 13:15:14 +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
Bill Wendling
e575be4c0e
I was wrong in my testing.
...
There isn't a speedup when using unbuffered I/O. It slows it down in fact.
llvm-svn: 181060
2013-05-03 22:06:41 +00:00
Bill Wendling
6ce98c49f4
Use unbuffered I/O. This reduces the runtime by about half. Our implementation is now only about 5 times slower than gcc's.
...
llvm-svn: 180980
2013-05-03 00:25:49 +00:00
Dmitry Vyukov
93b2cba03b
asan: fix windows build
...
llvm-svn: 180788
2013-04-30 13:30:29 +00:00
Dmitry Vyukov
db7d9e5db4
tsan: comment out debug output in test
...
llvm-svn: 180787
2013-04-30 13:09:31 +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
d0ac6c168b
tsan: fix deadlock detector table (OK to lock sync var mutex during reporting)
...
llvm-svn: 180782
2013-04-30 12:00:40 +00:00
Dmitry Vyukov
56cf378071
tsan: reverse stack trace for failed CHECK's, this is how we print traces in other places
...
llvm-svn: 180781
2013-04-30 11:57:32 +00:00
Dmitry Vyukov
3f7bf08b12
tsan: add interface functions for unaligned access, e.g. __sanitizer_unaligned_load16
...
llvm-svn: 180780
2013-04-30 11:56:56 +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
Alexey Samsonov
5c38383205
[ASan] Add allow_user_segv_handler to let users override SEGV handler installed by ASan
...
llvm-svn: 180255
2013-04-25 10:52:15 +00:00
Dmitry Vyukov
a05bbe1c9a
tsan: add a test that used to crash, fixed by r180180.
...
llvm-svn: 180251
2013-04-25 06:58:43 +00:00
Dmitry Vyukov
368d97e33c
tsan: fix stack traces for malloc and free
...
llvm-svn: 180184
2013-04-24 11:16:47 +00:00
Dmitry Vyukov
7a8535d2f2
tsan: run tests sequentially otherwise cmake says:
...
make[3]: make[3]: /bin/sh: ../../../../../bin/clang: Text file busy
llvm-svn: 180183
2013-04-24 11:07:25 +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
Dmitry Vyukov
54d9c81082
tsan: fix crash when data race happens on out-of-bounds accesses.
...
llvm-svn: 180180
2013-04-24 09:20:25 +00:00
Dmitry Vyukov
c63d73e59d
tsan: support heap starting at 0x04c0 (used in some custom deplyments)
...
llvm-svn: 180116
2013-04-23 15:59:56 +00:00
Dmitry Vyukov
43cf90f4d1
tsan: update Go memory mapping, Go now uses 0x00c0 heap base
...
llvm-svn: 180113
2013-04-23 15:24:26 +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
bcd32a9525
[ASan] Disable strict-init-order checker once we have more than one thread, as this mode is thread-hostile
...
llvm-svn: 180106
2013-04-23 13:57:35 +00:00
Alexey Samsonov
34093f0de8
[MSan] Make a few interface functions accept 'const void *' instead of 'void*'
...
llvm-svn: 180102
2013-04-23 13:34:19 +00:00
Evgeniy Stepanov
455abf4872
[msan] Unpoison the result of posix_memalign.
...
llvm-svn: 180101
2013-04-23 13:27:36 +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
Alexander Potapenko
262eb01bbf
[ASan] Make wait.cc more Darwin-compatible: fix the header name and the CHECK patterns.
...
llvm-svn: 180097
2013-04-23 12:36:37 +00:00
Alexander Potapenko
15aa1cd1ac
[ASan] Disable AddressSanitizer.AllocDeallocMismatch on Darwin.
...
See https://code.google.com/p/address-sanitizer/issues/detail?id=131 .
llvm-svn: 180093
2013-04-23 12:14:55 +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
Bill Wendling
9a9141aed5
Improve performance of file I/O.
...
The fread / fwrite calls were happening for each timer. However, that could be
pretty expensive for a large number of timers. Instead, read and write the
timers in one call.
This gives ~10% speedup in compilation time.
llvm-svn: 179990
2013-04-22 03:36:22 +00:00
Alexey Samsonov
e7ea8cfb49
Fixup for r179843: add missing header
...
llvm-svn: 179844
2013-04-19 08:49:05 +00:00
Alexey Samsonov
dcf0ade114
[ASan] Make init-order checker allow access to already initialized globals.
...
This change adds ASan runtime option "strict-init-order" (off by default)
that makes init-order checker bark if global initializer accesses any global from different
translation unit (even if the latter is already initialized). strict init-order checking
doesn't play well with, e.g. LLVM registration machineries, and causes issue
https://code.google.com/p/address-sanitizer/issues/detail?id=178 .
llvm-svn: 179843
2013-04-19 08:35:16 +00:00
Alexey Samsonov
6021e94774
[TSan] Allocate fd table in user heap instead of using internal allocator. We need this to catch races on fds.
...
llvm-svn: 179841
2013-04-19 08:04:46 +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
Sergey Matveev
0136943e03
[asan] Fix spelling in asan_rtl.cc Test commit.
...
Reviewers: kcc, glider, samsonov
Reviewed By: glider
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D676
llvm-svn: 179595
2013-04-16 14:58:45 +00:00
Evgeniy Stepanov
d1dae90bf2
[msan] Fix gcc build of msan_test.
...
llvm-svn: 179594
2013-04-16 14:09:47 +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
b0d786798c
[msan] Fix sigaction test.
...
Restore SIGPROF handler to the original state after the test.
llvm-svn: 179524
2013-04-15 13:35:05 +00:00
Evgeniy Stepanov
7332acac4c
[msan] Really disable replacement new and delete.
...
llvm-svn: 179522
2013-04-15 12:41:52 +00:00
Evgeniy Stepanov
755eb32a39
[sanitizer] Add syscall handlers to ASan and TSan runtimes.
...
ASan checks addressability of syscall arguments. TSan does nothing for now.
llvm-svn: 179380
2013-04-12 14:57:03 +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
Alexey Samsonov
e48866969e
[MSan] Demangle function name in description of stack origin
...
llvm-svn: 179368
2013-04-12 07:27:30 +00:00
Alexey Samsonov
1a345ad502
[MSan] don't build tests with -fPIE/-pie, as these flags are implied by -fsanitize=memory now
...
llvm-svn: 179366
2013-04-12 07:14:04 +00:00
Alexey Samsonov
0d725b1408
[TSan] remove -fPIE -pie from TSan lit tests to check that -fsanitize=thread implies them now
...
llvm-svn: 179365
2013-04-12 07:11:00 +00:00
Kostya Serebryany
fd27b83ef2
[asan] inline flags(), up to 1% perf gain on malloc-intensive code
...
llvm-svn: 179307
2013-04-11 18:36:04 +00:00
Kostya Serebryany
bb68f2cd65
[asan] make heavy_uar_test even heavier
...
llvm-svn: 179306
2013-04-11 18:27:02 +00:00
Alexey Samsonov
9f3938e271
Explicitly list all sanitizer headers in CMake build rules. Make sure sanitizer lit_tests depend on fresh headers.
...
llvm-svn: 179293
2013-04-11 15:49:52 +00:00
Kostya Serebryany
1c77de3aeb
[asan] improve the UAR reporting (try harder to find the correct frame), try to make the test more stable
...
llvm-svn: 179292
2013-04-11 15:35:40 +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
Kostya Serebryany
18f0820552
[asan] make heavy_uar_test a bit more heavy and fix he fake stack to pass this test
...
llvm-svn: 179286
2013-04-11 14:07:02 +00:00
Alexey Samsonov
a672ba6e8f
[ASan] test source-based init-order blacklisting added in r179280
...
llvm-svn: 179281
2013-04-11 13:21:41 +00:00
Kostya Serebryany
3fec2f534a
[asan] fix use-after-return functionality (PR15672) and enable the corresponding test. We still don't guarantee anything with regard to use-after-return checking
...
llvm-svn: 179278
2013-04-11 12:49:38 +00:00
Alexey Samsonov
46cc45a291
[ASan] Symbolize correct address when printint error summary
...
llvm-svn: 179274
2013-04-11 11:45:04 +00:00
Kostya Serebryany
4e0a33c8be
[asan] move fake stack into a separate .h file; actually disable a failing test
...
llvm-svn: 179273
2013-04-11 11:39:19 +00:00
Kostya Serebryany
fd7f924016
[asan] add heavy_uar_test (disabled); fix lint
...
llvm-svn: 179271
2013-04-11 11:29:07 +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
Kostya Serebryany
92684efb1d
[asan] implement callbacks for unaligned loads/stores
...
Reviewers: samsonov
Reviewed By: samsonov
CC: samsonov, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D652
llvm-svn: 179175
2013-04-10 13:59:32 +00:00
Alexey Samsonov
c0443c5d25
[ASan] fix a typo in legend in error report
...
llvm-svn: 179161
2013-04-10 07:00:25 +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
b4eac2f810
[msan] Interceptors for pipe2 and socketpair.
...
llvm-svn: 179022
2013-04-08 13:45:12 +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
228ecf46ab
[asan] make huge_negative_hea_oob more meaningful
...
llvm-svn: 178876
2013-04-05 15:16:48 +00:00
Kostya Serebryany
f5407e8d8f
[asan] add a test for huge left oob
...
llvm-svn: 178874
2013-04-05 15:13:23 +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
Evgeniy Stepanov
e7a7a9b972
[msan] Fix sigaction interceptor.
...
llvm-svn: 178868
2013-04-05 12:58:07 +00:00
Evgeniy Stepanov
c7af878a01
[msan] Conditionally disable new() and delete() wrappers.
...
To be used with static libstdc++.
llvm-svn: 178866
2013-04-05 12:03:47 +00:00
Evgeniy Stepanov
7948c648bf
[msan] A runtime option to disable wrapping of signal handlers.
...
llvm-svn: 178865
2013-04-05 11:59:16 +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
5afe6aa141
[ASan] init-order checker tests: move constexpr test that requires -std=c++11 to a separate test case. Check that structs with no ctor but non-trivial dtor are ignored.
...
llvm-svn: 178857
2013-04-05 07:51:49 +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
Alexey Samsonov
70a9c263d4
[TSan] Make path to FileCheck configurable
...
llvm-svn: 178760
2013-04-04 12:18:12 +00:00