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
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
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
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
Kostya Serebryany
b7ca536888
[asan] fix ShadowGapTest on PowerPC64
...
llvm-svn: 181991
2013-05-16 07:54:28 +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
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
ffe38d267c
Quick fix for ASan test build on Android.
...
llvm-svn: 181429
2013-05-08 14:11:12 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
Kostya Serebryany
eef8bd4355
[asan] nuke the old unused allocator code
...
llvm-svn: 178758
2013-04-04 11:32:49 +00:00
Kostya Serebryany
13b07733b1
[asan] fill first 4K of malloc-ed memory with garbage, implement flags max_malloc_fill_size and malloc_fill_byte
...
llvm-svn: 178757
2013-04-04 11:17:14 +00:00
Alexey Samsonov
21cb74318c
[ASan] Kill the remainders of platform defines in favor of SANITIZER_ defines
...
llvm-svn: 178629
2013-04-03 07:29:53 +00:00
Alexey Samsonov
e624795558
[ASan] More careful reports for globals that are ASCII strings
...
llvm-svn: 178458
2013-04-01 08:57:38 +00:00
Timur Iskhodzhanov
07d06d7cf5
Remove all 'static' before ALWAYS_INLINE
...
llvm-svn: 178290
2013-03-28 21:16:09 +00:00
Timur Iskhodzhanov
a6788325cf
Make all the ALWAYS_INLINE users Windows-friendly; also, avoid ALWAYS_INLINE INLINE combinations
...
llvm-svn: 178266
2013-03-28 18:52:40 +00:00
Alexey Samsonov
a88c60b085
[ASan] Speed-up initialization-order checking: create and use fast versions of PoisonShadow functions, store copies of __asan_global descriptors in a vector instead of list of pointers. This gives 3x speedup on both benchmarks and real binaries with lots of globals.
...
llvm-svn: 178239
2013-03-28 15:42:43 +00:00
Alexey Samsonov
e586170e86
Fix unmatching ASan runtime flag for init-order checking exposed by r178158. Add a test for r178158.
...
llvm-svn: 178229
2013-03-28 09:11:20 +00:00