Kostya Serebryany
bad01549b6
[asan] add some colors to asan output if printing to tty (following ubsan)
...
llvm-svn: 170418
2012-12-18 07:32:16 +00:00
Dmitry Vyukov
6d315cbcc3
tsan: describe "file descriptor" location
...
llvm-svn: 170417
2012-12-18 06:57:34 +00:00
Richard Smith
cf56ebd52a
ubsan: When diagnosing something wrong somewhere in memory, emit a note
...
pointing at the bad location and a snippet of nearby memory values. This is
strictly best-effort; reading these bytes to display the note could lead to a
seg fault, and that's explicitly OK.
llvm-svn: 170415
2012-12-18 06:30:32 +00:00
Richard Smith
54fc2370f9
Don't escape %s in printf usage message; it's not written by printf.
...
llvm-svn: 170413
2012-12-18 05:49:49 +00:00
Richard Smith
52987120f9
ubsan: if the frontend didn't provide us with a source location, try to work
...
one out from the return address. Currently, we can only resolve this address to
a file and line number if we have an external symbolizer.
llvm-svn: 170407
2012-12-18 04:23:18 +00:00
Richard Smith
37a913ae8f
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
...
to an object outside its lifetime does not have undefined behavior.
llvm-svn: 170388
2012-12-18 00:23:12 +00:00
Dmitry Vyukov
09b0dbfaf9
tsan: say what thread had created a thread in reports
...
llvm-svn: 170346
2012-12-17 16:28:15 +00:00
Kostya Serebryany
d6aec5a8e0
[asan] asan_allocator2: implement malloc_usable_size and fix 32-bit
...
llvm-svn: 170339
2012-12-17 14:57:25 +00:00
Kostya Serebryany
ec339f70d6
[asan] asan_allocator2: don't use TLS and fix calloc
...
llvm-svn: 170329
2012-12-17 13:43:47 +00:00
Kostya Serebryany
1aae0e67fa
[asan] asan_alocator2: implement quarantine and Reallocate
...
llvm-svn: 170315
2012-12-17 09:06:25 +00:00
Kostya Serebryany
41ffe3db59
[asan] implement AsanChunkFifoList via IntrusiveList<AsanChunk>
...
llvm-svn: 170313
2012-12-17 07:54:29 +00:00
Kostya Serebryany
c510015419
[asan] asan_alocator2: implement free() stacks and actually make malloc/free stacks work
...
llvm-svn: 170310
2012-12-17 06:31:53 +00:00
Kostya Serebryany
c8208c5258
[sanitizer] fix a bug that has crept into the sanitizer allocator and caused SEGV on allocations between 1Mb and 2Mb, improve the test
...
llvm-svn: 170274
2012-12-15 18:36:23 +00:00
Dmitry Vyukov
38d0b60fb9
tsan: synchronize connect->accept calls
...
llvm-svn: 170235
2012-12-14 20:01:58 +00:00
Alexey Samsonov
6a68a9117b
[Sanitizer] remove extra typename
...
llvm-svn: 170208
2012-12-14 15:37:35 +00:00
Dmitry Vyukov
5a3d15c126
tsan: add test for errno spoiling in signal handler
...
llvm-svn: 170207
2012-12-14 14:42:40 +00:00
Kostya Serebryany
673c052631
[sanitizer] add AllocatorLeakTest
...
llvm-svn: 170206
2012-12-14 14:20:29 +00:00
Dmitry Vyukov
be6005a0d5
tsan: add test for malloc/free in signal handler
...
llvm-svn: 170205
2012-12-14 13:56:27 +00:00
Evgeniy Stepanov
fb37510e96
Add MemorySanitizer.cpp to the lint script.
...
llvm-svn: 170204
2012-12-14 13:48:55 +00:00
Dmitry Vyukov
51b6e07deb
tsan: fix lint warning
...
llvm-svn: 170202
2012-12-14 13:46:03 +00:00
Kostya Serebryany
025d64a1b9
[asan] more asan_allocator2 code: record the allocation stack trace, implement calloc/etc
...
llvm-svn: 170193
2012-12-14 13:16:19 +00:00
Dmitry Vyukov
5b375d84c0
tsan: fix build
...
llvm-svn: 170191
2012-12-14 12:24:11 +00:00
Kostya Serebryany
7dfb168eb8
[asan] more asan_allocator2 code: actually un/poison shadow on malloc/free
...
llvm-svn: 170190
2012-12-14 12:15:09 +00:00
Alexey Samsonov
cd1e68ebb1
[Sanitizer] use INTERCEPT_FUNCTION(foo) instead of CHECK(INTERCEPT_FUNCTION(foo)) - this check may fail on Linux if user program defines its own version of library function foo
...
llvm-svn: 170189
2012-12-14 11:52:02 +00:00
Dmitry Vyukov
34aef74a4d
tsan: disable allocator tests in debug build
...
llvm-svn: 170187
2012-12-14 10:17:22 +00:00
Dmitry Vyukov
ed6d54368c
tsan: comment out debug output in test
...
llvm-svn: 170186
2012-12-14 10:12:14 +00:00
Dmitry Vyukov
714accd917
tsan: add sanity test for Go runtime into presubmit test
...
llvm-svn: 170185
2012-12-14 10:10:57 +00:00
Dmitry Vyukov
e0c37640f7
tsan: add socketpair() interceptor and test
...
llvm-svn: 170184
2012-12-14 09:57:42 +00:00
Dmitry Vyukov
12ae8897e6
tsan: fix compilation with -pedantic
...
llvm-svn: 170131
2012-12-13 15:26:04 +00:00
Kostya Serebryany
bb69879d09
[asan] pop the internal stack frames in SlowUnwindStack, extend the test to check this
...
llvm-svn: 170124
2012-12-13 12:31:55 +00:00
Alexey Samsonov
506b97d61e
[Sanitizer] disable lint check for line length in ASan output tests
...
llvm-svn: 170123
2012-12-13 12:09:47 +00:00
Kostya Serebryany
704c1cb23a
[asan] extend overflow-in-qsort.cc to check both unwind kinds. One more test for SlowUnwind. Move both to Linux dir (no slow unwind on Mac)
...
llvm-svn: 170122
2012-12-13 11:47:49 +00:00
Alexey Samsonov
78ba6c1b37
[ASan] Allow leading underscore in function name to please output tests on Mac
...
llvm-svn: 170121
2012-12-13 11:11:28 +00:00
Alexey Samsonov
340de607a3
[ASan] don't print memory stats on CheckFailed
...
llvm-svn: 170120
2012-12-13 11:09:26 +00:00
Kostya Serebryany
060bfab568
[asan] fix win build
...
llvm-svn: 170119
2012-12-13 10:03:50 +00:00
Kostya Serebryany
6852bce2f2
[asan] fix mac build
...
llvm-svn: 170118
2012-12-13 10:01:20 +00:00
Kostya Serebryany
baf583c443
[asan] add two asan flags: fast_unwind_on_fatal and fast_unwind_on_malloc to allow using the slow CFI-based unwinder
...
llvm-svn: 170117
2012-12-13 09:34:23 +00:00
Dmitry Vyukov
3533f76996
tsan: completely disable deadlock detector for Go
...
seems to cause some weird stack overflow
llvm-svn: 170116
2012-12-13 09:22:11 +00:00
Alexey Samsonov
5a26e1fbf2
[Sanitizer] Add new header - sanitizer_platform_interceptors.h, which should define whether or not given function should be intercepted on a given platform.
...
llvm-svn: 170115
2012-12-13 08:50:16 +00:00
Alexey Samsonov
447e2f2f19
[ASan] one more macro for 'read' interception
...
llvm-svn: 170114
2012-12-13 08:36:13 +00:00
Dmitry Vyukov
3e7ede230f
tsan: support MapThreadTrace() on all platforms
...
llvm-svn: 170113
2012-12-13 08:14:02 +00:00
Alexey Samsonov
65c14f5314
[ASan] more macro for conditional interception of pread functions
...
llvm-svn: 170112
2012-12-13 08:10:23 +00:00
Kostya Serebryany
ad81738822
[asan] add asan/lit_tests/overflow-in-qsort.cc (not fully working yet)
...
llvm-svn: 170111
2012-12-13 08:05:03 +00:00
Richard Smith
177f80376d
ubsan unit tests for -fsanitize=bool and -fsanitize=enum.
...
llvm-svn: 170109
2012-12-13 07:12:20 +00:00
Richard Smith
32952215b6
ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
...
bit-patterns which are not valid values for enumerated or boolean types.
These checks are the ubsan analogue of !range metadata.
llvm-svn: 170107
2012-12-13 07:00:14 +00:00
Kostya Serebryany
07bb3925b0
[sanitizer] replace size_t with SIZE_T in interceptors (same for ssize_t, off_t and off64_t). This is done to avoid confusion and to make the code work with compilers that define size_t w/o any includes (MSVC)
...
llvm-svn: 170103
2012-12-13 06:31:40 +00:00
Kostya Serebryany
a167087571
[asan] fix windows build
...
llvm-svn: 170101
2012-12-13 05:51:02 +00:00
Kostya Serebryany
9806628792
[sanitizer] introduce MmapFixedOrDie and use it in SizeClassAllocator64
...
llvm-svn: 170099
2012-12-13 05:36:00 +00:00
Kostya Serebryany
eec22a628b
[asan] fix the Android build (pread64 interceptor again)
...
llvm-svn: 170098
2012-12-13 05:27:08 +00:00
Kostya Serebryany
2ce42e0aef
[sanitizer] change the way SizeClassAllocator64 allocated memory from the system: instead of one huge mmap(NORESERVE) it does one huge mprotect and then does small on-demand mmaps. This allows us to call OnMap callbacks which are required to poison newly allocated memory in asan
...
llvm-svn: 170097
2012-12-13 05:05:11 +00:00