Alexey Samsonov
826b324cb0
[ASan] explicitly link with dynamic ASan runtime when building unittests on Android
...
llvm-svn: 170552
2012-12-19 15:52:30 +00:00
Alexey Samsonov
85bd73d259
[ASan] Support building both 32- and 64-bit unit tests if we can target both architectures
...
llvm-svn: 170549
2012-12-19 15:17:23 +00:00
Kostya Serebryany
dcdeecb257
[asan] asan_allocator2: add mmap/munmap stats
...
llvm-svn: 170548
2012-12-19 14:56:38 +00:00
Alexey Samsonov
b29d37bea5
[ASan] make sure Android unittests depend on ASan runtime
...
llvm-svn: 170543
2012-12-19 13:46:58 +00:00
Alexey Samsonov
ca7fcf2354
Significantly change the way we build ASan unittests in CMake
...
build tree. Now just-built Clang is used to:
1) compile instrumented sources (as before);
2) compile non-instrumented sources;
3) compile our own instrumented version of googletest;
4) link it all together using -fsanitize=address flag
(instead of trying to copy linker behavior in
CMake build rules).
This makes ASan unittests pretty much self-consistent
and independent of other LLVM libraries.
llvm-svn: 170541
2012-12-19 12:33:39 +00:00
Alexander Potapenko
7e1fcb8136
[ASan] Change the boilerplate check in the libdispatch tests to fix them.
...
llvm-svn: 170531
2012-12-19 11:26:41 +00:00
Kostya Serebryany
d5c46cb2f7
[asan] print the shadow bytes in different colors and also output the shadow byte legend
...
llvm-svn: 170520
2012-12-19 09:53:32 +00:00
Alexey Samsonov
d12943e028
[TSan] build only gtest-all.o when building TSan unit tests
...
llvm-svn: 170519
2012-12-19 09:19:57 +00:00
Dmitry Vyukov
1ed72076b4
tsan: add lint check back into presubmit script
...
llvm-svn: 170515
2012-12-19 08:53:31 +00:00
Alexey Samsonov
35ed02ebf1
[Sanitizer] add missing header on Windows
...
llvm-svn: 170514
2012-12-19 08:51:39 +00:00
Kostya Serebryany
479f05b276
[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the left of a given address. Almost all tests pass with the new allocator now, only 6 are left to fix.
...
llvm-svn: 170511
2012-12-19 08:32:50 +00:00
Alexey Samsonov
b6219c060b
[Sanitizer] implement internal_isatty on Windows
...
llvm-svn: 170507
2012-12-19 07:57:42 +00:00
Dmitry Vyukov
c467933dc7
tsan: fix -Wgnu warnings
...
llvm-svn: 170499
2012-12-19 06:59:45 +00:00
Kostya Serebryany
2abbce6701
[sanitizer] one more stability fix in 64-bit allocator
...
llvm-svn: 170498
2012-12-19 06:51:45 +00:00
Kostya Serebryany
12676268fa
[sanitizer] fix LargeMmapAllocator::GetBlockBegin
...
llvm-svn: 170434
2012-12-18 14:56:38 +00:00
Dmitry Vyukov
44e1beaee6
tsan: intercept fork() to prevent false race reports on fd's
...
llvm-svn: 170433
2012-12-18 14:44:44 +00:00
Dmitry Vyukov
a2ce1e0055
tsan: warn about reports from signal handlers
...
llvm-svn: 170430
2012-12-18 14:19:24 +00:00
Dmitry Vyukov
d509179a0b
tsan: add signalfd() and inotify_init() interceptors
...
llvm-svn: 170429
2012-12-18 12:35:31 +00:00
Dmitry Vyukov
42230ae216
tsan: add io_sync flag that controls amount of IO synchronization
...
llvm-svn: 170427
2012-12-18 12:20:55 +00:00
Dmitry Vyukov
9c7bcfea6f
tsan: remove TSAN_OPTIONS from the script
...
The runtime skips atexit sleep if there are no threads now,
so it must be fast w/o it.
Allows to specify own TSAN_OPTIONS for the tests.
llvm-svn: 170426
2012-12-18 12:19:50 +00:00
Alexey Samsonov
f37c45c20d
[Sanitizer] Expose StackTrace::GetPreviousInstructionPc() to get PC of call instruction from return address
...
llvm-svn: 170424
2012-12-18 09:57:34 +00:00
Richard Smith
7e45562ad0
ubsan: Demangle class names, and be more informative when a reinterpret_cast
...
has got us to the wrong offset within an object.
llvm-svn: 170423
2012-12-18 09:30:21 +00:00
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