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
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
Alexander Potapenko
d27e4861bf
[ASan] Fix test expectations for strcat/strncat.
...
llvm-svn: 169987
2012-12-12 16:10:46 +00:00
Kostya Serebryany
e29883c10a
[sanitizer] add OnMap/OnUmap callbacks to the allocator interface
...
llvm-svn: 169985
2012-12-12 14:32:18 +00:00
Kostya Serebryany
c219f6c777
[tsan] fix cmake build
...
llvm-svn: 169982
2012-12-12 14:26:06 +00:00
Dmitry Vyukov
7d95323047
tsan: explain why pthread_cond_init() interceptor is commented out
...
llvm-svn: 169975
2012-12-12 13:11:44 +00:00
Alexander Potapenko
dab1a61011
[ASan] Enhance OOB tests to check for access type (read or write).
...
llvm-svn: 169974
2012-12-12 12:59:47 +00:00
Dmitry Vyukov
9ba0f3d51c
tsan: add comment to tsan_fd.h file
...
llvm-svn: 169973
2012-12-12 12:45:07 +00:00
Alexander Potapenko
602a09fa52
[ASan] Fixed a compiler warning.
...
llvm-svn: 169972
2012-12-12 12:32:57 +00:00
Dmitry Vyukov
9190a036d7
tsan: add missing files
...
llvm-svn: 169971
2012-12-12 12:27:00 +00:00
Dmitry Vyukov
60c14ce625
tsan: more precise handling of IO synchronization
...
llvm-svn: 169970
2012-12-12 11:59:30 +00:00
Alexander Potapenko
ada2fbd2d4
[ASan] fix compilation on Mac.
...
llvm-svn: 169969
2012-12-12 11:52:26 +00:00
Kostya Serebryany
28a32c89e9
[asan] fix android build and lint
...
llvm-svn: 169968
2012-12-12 11:37:23 +00:00
Evgeniy Stepanov
4e772db66a
[msan] Remove an extra semicolon.
...
llvm-svn: 169967
2012-12-12 10:50:48 +00:00
Kostya Serebryany
9a58d399c7
[asan] add sanitizer_common/sanitizer_common_interceptors.h with pread/pread64/read interceptors. Use it in asan. Add asan tests for pread/etc. Add FIXME to tsan/msan interceptors
...
llvm-svn: 169966
2012-12-12 09:54:35 +00:00
Kostya Serebryany
90a59fafc0
[asan] more code for asan_allocator2: basic Allocate/Deallocate code
...
llvm-svn: 169864
2012-12-11 14:41:31 +00:00
Evgeniy Stepanov
83f05bf960
Add MemorySanitizer runtime to check_lint.sh.
...
llvm-svn: 169861
2012-12-11 12:52:38 +00:00
Evgeniy Stepanov
c5033786ba
[msan] MemorySanitizer runtime.
...
Initial commit of the MemorySanitizer runtime library.
llvm-svn: 169858
2012-12-11 12:27:27 +00:00
Timur Iskhodzhanov
4c97604415
ASan: fix lint problems introduced
...
llvm-svn: 169857
2012-12-11 12:24:41 +00:00
Timur Iskhodzhanov
9b1d42a2a9
Hopefully fix the Windows build (2)
...
llvm-svn: 169856
2012-12-11 12:23:00 +00:00
Timur Iskhodzhanov
aacd3d79b1
Hopefully fix the Windows build by not including intrin.h
...
llvm-svn: 169855
2012-12-11 12:03:06 +00:00
Kostya Serebryany
5e2a7acdbe
[asan] more sceleton code for asan_allocator2
...
llvm-svn: 169836
2012-12-11 09:02:36 +00:00
Kostya Serebryany
54af660d2c
[asan] fix the Windows build
...
llvm-svn: 169828
2012-12-11 07:27:59 +00:00
Kostya Serebryany
3ba26fe553
[asan] make ThreadNamesTest more flexible
...
llvm-svn: 169822
2012-12-11 06:23:10 +00:00
Alexander Potapenko
af5a108ea8
[ASan] Typo fix in memcpy() and memmove() interceptors: ASAN_WRITE_RANGE and ASAN_READ_RANGE were swapped.
...
This has been spotted by Anna Zaks (ganna@apple.com )
llvm-svn: 169736
2012-12-10 16:02:13 +00:00
Kostya Serebryany
13bdbe698e
[asan] move FakeStack into a separate file
...
llvm-svn: 169734
2012-12-10 14:19:15 +00:00
Kostya Serebryany
14282a91d5
[asan] introduce asan_allocator2.cc, which will have the replacement for asan allocator (now, just a bit of boilerplate)
...
llvm-svn: 169733
2012-12-10 13:52:55 +00:00
Alexander Potapenko
1746f555ee
Add a libsanitizer API __sanitizer_sandbox_on_notify(void* reserved), which should be used by
...
the client programs to notify the tools that sandboxing is about to be turned on.
llvm-svn: 169732
2012-12-10 13:10:40 +00:00
Dmitry Vyukov
1046031e1a
tsan: exclude flaky test
...
llvm-svn: 169729
2012-12-10 09:16:17 +00:00
Alexey Samsonov
f0e638c6df
ASan: fix interface-symbols test on Mac by explicitly listing all weak functions
...
llvm-svn: 169660
2012-12-08 01:12:12 +00:00
Alexey Samsonov
5aa36def74
ASan: use new option -fsanitize-blacklist in output tests
...
llvm-svn: 169646
2012-12-07 22:21:21 +00:00
Alexey Samsonov
a0e4706fe6
ASan: change the strategy we use for installing malloc/free/symbolization hooks on Linux: don't provide a default no-op implementations for hooks in runtime, and optionally call hooks if they are provided by the user. Don't force weak interface functions into runtime.
...
llvm-svn: 169641
2012-12-07 22:01:28 +00:00
David Blaikie
a00d9caa8f
Unbreak the C++98 build.
...
llvm-svn: 169636
2012-12-07 21:39:54 +00:00
Dmitry Vyukov
54b87409b4
tsan: even more fd interceptors + fixes
...
llvm-svn: 169628
2012-12-07 19:23:59 +00:00
Dmitry Vyukov
04580518ce
tsan: more fd interceptors + bug fixes + tests
...
llvm-svn: 169621
2012-12-07 18:30:40 +00:00
Kostya Serebryany
40bac5b01f
[asan] fix lint, remove debug prints
...
llvm-svn: 169620
2012-12-07 18:07:52 +00:00
Alexey Samsonov
fa94fa52ad
ASan: intercept prctl on Linux only
...
llvm-svn: 169616
2012-12-07 17:54:38 +00:00
Dmitry Vyukov
0ef99e2a48
tsan: fix pipe interceptors and add 2 tests
...
llvm-svn: 169607
2012-12-07 16:22:54 +00:00
Dmitry Vyukov
3a2046b3a6
tsan: fix lint warnings
...
llvm-svn: 169606
2012-12-07 16:20:06 +00:00
Dmitry Vyukov
4e7c0f95fb
tsan: add pipe interceptors
...
llvm-svn: 169602
2012-12-07 15:32:56 +00:00
Kostya Serebryany
e7108227ca
[asan] intercept prctl(PR_SET_NAME) and set the thread name. Output the thread names (if non-empty) in asan reports
...
llvm-svn: 169601
2012-12-07 15:15:01 +00:00
Dmitry Vyukov
5f4ab30be0
tsan: refactoring is preparation to more precise fd synchronization handling
...
llvm-svn: 169600
2012-12-07 14:40:10 +00:00
Kostya Serebryany
35f9e5e87b
[sanitizer] implement SanitizerSetThreadName/SanitizerGetThreadName. Just for linux so far (using prctl(PR_GET_NAME))
...
llvm-svn: 169598
2012-12-07 11:27:24 +00:00
Evgeniy Stepanov
5d2d761ad6
Switch to r83 of cpplint.
...
Ubuntu Precise compatibility.
llvm-svn: 169597
2012-12-07 11:00:14 +00:00
Kostya Serebryany
52a3b92abd
[sanitizer] try not to use libc mem* functions in sanitizer_common tests (conflicts with our own interceptors)
...
llvm-svn: 169595
2012-12-07 10:13:10 +00:00
Kostya Serebryany
378f93e804
[sanitizer] fix the build on ancient gcc which has stricter rules about what can be put on TLS. Long term, we absolutely must build the run-times with the fresh target clang
...
llvm-svn: 169593
2012-12-07 09:40:17 +00:00
Dmitry Vyukov
5e700abc1c
tsan: deflake output tests (by increasing sleeps)
...
llvm-svn: 169592
2012-12-07 09:24:57 +00:00
Kostya Serebryany
6986550c7d
[sanitizer] POD-ify the allocator cache
...
llvm-svn: 169514
2012-12-06 16:22:04 +00:00
Dmitry Vyukov
e3e0557f19
tsan: fix lint warning and make output tests more robust
...
llvm-svn: 169511
2012-12-06 15:42:54 +00:00
Kostya Serebryany
6d2d30f61d
[asan/msan] one more test for 32-bit allocator + minor code simplification
...
llvm-svn: 169507
2012-12-06 14:39:41 +00:00
Kostya Serebryany
c14ae88b08
[asan/msan] add BulkAllocate to the 32-bit allocator (and a test)
...
llvm-svn: 169506
2012-12-06 14:27:32 +00:00
Kostya Serebryany
0f67d01031
[asan/msan] refactor allocator's BulkAllocate (move to AllocatorFreeList)
...
llvm-svn: 169503
2012-12-06 13:34:11 +00:00
Dmitry Vyukov
6ee2cde066
tsan: add new file to cmake
...
llvm-svn: 169502
2012-12-06 13:32:49 +00:00
Dmitry Vyukov
72064188bc
tsan: add some more functions for java filtering
...
llvm-svn: 169501
2012-12-06 13:20:37 +00:00
Kostya Serebryany
9f84eecc9e
[asan/msan] add GetBlockBegin to the 32-bit allocator (+test)
...
llvm-svn: 169499
2012-12-06 13:13:58 +00:00
Kostya Serebryany
2731cb23b1
[asan/msan] one more test for 32-bit allocator
...
llvm-svn: 169497
2012-12-06 13:00:11 +00:00
Kostya Serebryany
2044135dca
[asan/msan] new 32-bit allocator, basic functionality so far
...
llvm-svn: 169496
2012-12-06 12:49:28 +00:00
Dmitry Vyukov
fd1ba2af7d
tsan: add 'free' to java nonsense reports
...
llvm-svn: 169494
2012-12-06 12:42:53 +00:00
Dmitry Vyukov
fd5ebcd1b0
tsan: add mutexsets to reports
...
With this change reports say what mutexes the threads hold around the racy memory accesses.
llvm-svn: 169493
2012-12-06 12:16:15 +00:00
Bill Wendling
f9528843d2
Remove unused variable.
...
llvm-svn: 169485
2012-12-06 07:43:17 +00:00
Kostya Serebryany
1e3d387459
[tsan] add MmapAlignedOrDie
...
llvm-svn: 169474
2012-12-06 06:10:31 +00:00
Kostya Serebryany
86975ce3fb
[asan] drop the extension from asan tests (as the extension may be different)
...
llvm-svn: 169392
2012-12-05 17:56:54 +00:00
Kostya Serebryany
1a6f4d4ba6
[asan] undo the debug printf
...
llvm-svn: 169381
2012-12-05 13:39:29 +00:00
Dmitry Vyukov
d413d8cfa9
tsan: fix memory barriers in atomics
...
llvm-svn: 169379
2012-12-05 13:14:55 +00:00
Dmitry Vyukov
c446aa039a
tsan: provide own implementation of __cxa_guard_xxx functions
...
that way we allow static linking of libstdc++
llvm-svn: 169376
2012-12-05 12:10:22 +00:00
Dmitry Vyukov
6411bd9877
tsan: remove unnecesary include file
...
llvm-svn: 169370
2012-12-05 10:16:17 +00:00
Dmitry Vyukov
dd95cd148b
tsan: fix lint warnings
...
llvm-svn: 169369
2012-12-05 10:16:02 +00:00
Kostya Serebryany
571232b8cf
[tsan] get rid of *allocator64* files, moving everything to *allocator* files. This will help with the 32-bit allocator implementation and testing
...
llvm-svn: 169368
2012-12-05 10:09:15 +00:00
Kostya Serebryany
0afbb325b6
[tsan] make the 64-bit allocator build (but not work) in 32-bit mode to simplify the code and test structure and allow further refactoring
...
llvm-svn: 169361
2012-12-05 07:11:47 +00:00
Alexander Potapenko
0a4e0f6d35
Fix a use-after-unmap bug in /proc/self/maps caching. The cached buffer was occasionally deleted in the MemoryMappingLayout destructor.
...
llvm-svn: 169335
2012-12-04 23:30:00 +00:00
Dmitry Vyukov
1b46993598
tsan: output thread names
...
llvm-svn: 169279
2012-12-04 15:46:05 +00:00
Kostya Serebryany
242b6305f0
[tsan] add a compile-time error for 64-bit-only support
...
llvm-svn: 169275
2012-12-04 15:13:30 +00:00
Dmitry Vyukov
4b82b2bb6e
tsan: make atomic operations atomic again
...
llvm-svn: 169273
2012-12-04 14:50:10 +00:00
Kostya Serebryany
7436d95c9c
[tsan] test the allocator with CompactSizeClassMap
...
llvm-svn: 169270
2012-12-04 14:39:51 +00:00
Kostya Serebryany
f299288f55
[tsan] minor interface refactoring
...
llvm-svn: 169267
2012-12-04 14:15:17 +00:00
Dmitry Vyukov
4ef6b2bd03
tsan: fix nand operation
...
llvm-svn: 169266
2012-12-04 14:08:39 +00:00
Dmitry Vyukov
01ea653166
tsan: add __attribute__((visibility("default"))) to interface functions
...
llvm-svn: 169265
2012-12-04 14:01:21 +00:00
Kostya Serebryany
5e6f833bdd
[tsan] refactor the allocator tests to allow testing other flavours of the allocator (add templates)
...
llvm-svn: 169264
2012-12-04 13:59:22 +00:00
Dmitry Vyukov
55b47cad33
tsan: fix trace handling when trace is reused between threads
...
llvm-svn: 169259
2012-12-04 12:19:53 +00:00
Kostya Serebryany
077f88045e
[tsan] refactoring and comment changes in sanitizer_common/sanitizer_allocator{,64}.h. No functionality change
...
llvm-svn: 169234
2012-12-04 07:54:41 +00:00
Dmitry Vyukov
0d677279f6
tsan: better error message if we fail to intercept some function
...
currently the message is SIGSEGV
llvm-svn: 169231
2012-12-04 07:28:25 +00:00
Dmitry Vyukov
d229abe49a
tsan: check if PWD env var is absent
...
On some programs I see:
failed to open suppressions file '<null>/testing/tsan/v2/tsan.supp'
llvm-svn: 169230
2012-12-04 07:27:32 +00:00
Alexander Potapenko
0dcd6d9468
[ASan] Do not build the interceptors that use ObjC blocks if the compiler does not support blocks.
...
Need to define MISSING_BLOCKS_SUPPORT in this case at buildtime.
Patch by Jack Howarth <howarth@bromo.med.uc.edu>
llvm-svn: 169206
2012-12-04 02:41:47 +00:00
Alexey Samsonov
45b6edbd1d
ASan: add new interface functions - __asan_(un)poison_stack_memory. Calls to these functions are inserted by the instrumentation pass in use-after-scope mode
...
llvm-svn: 169201
2012-12-04 01:38:15 +00:00
Alexander Potapenko
e2b6d08459
Use a struct to hold the /proc/self/maps buffer on Linux.
...
llvm-svn: 169155
2012-12-03 21:21:22 +00:00
Kostya Serebryany
214b715061
[asan] two more bits for __sparc__
...
llvm-svn: 169141
2012-12-03 18:39:21 +00:00
Kostya Serebryany
485f7b4a70
[tsan] add CompactSizeClassMap as an alternative (more compact) size class map. Not used yet.
...
llvm-svn: 169128
2012-12-03 15:00:33 +00:00
Kostya Serebryany
dab61684ef
[tsan] remove unused InternalAllocBlock as part of larger refactoring
...
llvm-svn: 169123
2012-12-03 11:57:01 +00:00
Dmitry Vyukov
e982a1d368
tsan: describe global vars (module+offset for now)
...
llvm-svn: 169122
2012-12-03 11:45:34 +00:00
Kostya Serebryany
a960b2c6da
[asan] EXPECT_EQ => ASSERT_EQ around pthread_create/pthread_join calls
...
llvm-svn: 169121
2012-12-03 11:37:03 +00:00
Kostya Serebryany
d5aafcf618
[asan] in asan tests, check all return values of pthread_create/pthread_join. Also add the ASAN_AVOID_EXPENSIVE_TESTS macro to guard the test that creates too many threads
...
llvm-svn: 169118
2012-12-03 09:43:56 +00:00
Will Dietz
2c36c71f5b
[ubsan] Refactor handlers to have separate entry points for aborting.
...
If user specifies aborting after a recoverable failed check is
appropriate, frontend should emit call to the _abort variant.
Test this behavior with newly added -fsanitize-recover flag.
llvm-svn: 169113
2012-12-02 19:47:29 +00:00
Will Dietz
b28179be10
[ubsan] Replace "fatal error" with "runtime error".
...
llvm-svn: 169112
2012-12-02 18:43:33 +00:00
Alexander Potapenko
7811425843
Add caching to the MemoryMappingLayout class on Linux. This is necessary for the cases when a sandbox prevents ASan from reading the mappings
...
from /proc/self/maps.
The mappings are currently being cached on each access to /proc/self/maps. In the future we'll need to add an API that allows the client to notify ASan about the sandbox.
llvm-svn: 169076
2012-12-01 02:39:45 +00:00
Dmitry Vyukov
e993dac233
tsan: fix int overflow and several instances where tid is used with ignore
...
llvm-svn: 169029
2012-11-30 20:02:11 +00:00
Dmitry Vyukov
d05418eac6
tsan: suppress weird race reports when JVM is embed into the process
...
llvm-svn: 169019
2012-11-30 17:45:53 +00:00
Dmitry Vyukov
1450ac6406
tsan: add __libc_memalign interceptor (used by dynamic loader to allocate tls for dlopen'ed modules)
...
llvm-svn: 169017
2012-11-30 17:27:58 +00:00
Dmitry Vyukov
ad9c530f7c
tsan: add sanity checks into memory allocator
...
llvm-svn: 169015
2012-11-30 17:26:50 +00:00
Kostya Serebryany
436462046a
[asan] make asan_test.cc more gcc-friendly
...
llvm-svn: 168992
2012-11-30 10:41:42 +00:00
Kostya Serebryany
6a786e66cf
[asan] simplify break_optimization in tests (Jakub Jelinek)
...
llvm-svn: 168990
2012-11-30 09:52:44 +00:00
Dmitry Vyukov
71d759d392
tsan: intercept mlock() because of the kernel bug
...
llvm-svn: 168987
2012-11-30 06:50:15 +00:00
Dmitry Vyukov
0a4d875c48
tsan: fix bug that leads to spurious use-after-free reports
...
llvm-svn: 168985
2012-11-30 06:39:01 +00:00
Richard Smith
57000c38fc
ubsan: Disable __int128 tests if the host Clang does not support it. These
...
tests will still fail if compiler-rt was built with a compiler without __int128
support, but the host compiler has __int128 support.
llvm-svn: 168955
2012-11-29 23:03:58 +00:00
Alexey Samsonov
b90501d7da
[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output tests
...
llvm-svn: 168951
2012-11-29 22:56:01 +00:00
Kostya Serebryany
dde9dcc24b
[asan] disable BuiltinLongJmpTest on Android
...
llvm-svn: 168872
2012-11-29 12:18:48 +00:00
Kostya Serebryany
e73a480970
[asan] enable BuiltinLongJmpTest
...
llvm-svn: 168863
2012-11-29 09:02:14 +00:00
Richard Smith
99507e6c10
ubsan: Don't assume that Clang provides __int128 unless it advertises that it does.
...
llvm-svn: 168857
2012-11-29 05:59:30 +00:00
Kostya Serebryany
df5f3028e2
[asan] add DISABLED_BuiltinLongJmpTest
...
llvm-svn: 168793
2012-11-28 15:01:23 +00:00
Dmitry Vyukov
4a48553869
tsan: explicitly say that failed to restore the stack
...
llvm-svn: 168790
2012-11-28 13:30:06 +00:00
Dmitry Vyukov
eb3d36e649
tsan: address several review comments
...
llvm-svn: 168789
2012-11-28 13:01:32 +00:00
Dmitry Vyukov
3374e3f874
tsan: add log_path parameter (similar to asan)
...
remove old log_fileno
llvm-svn: 168788
2012-11-28 12:56:52 +00:00
Dmitry Vyukov
e1a7f338a3
tsan: dynamic history size
...
introduces history_size parameter that can be used to control trace size at startup
llvm-svn: 168786
2012-11-28 12:19:50 +00:00
Dmitry Vyukov
00e4604d6b
tsan: change fast state layout in preparation to dynamic traces
...
llvm-svn: 168784
2012-11-28 10:49:27 +00:00
Dmitry Vyukov
2429b02770
tsan: move traces from tls into dedicated storage at fixed address
...
helps to reduce tls size (it's weird to have multi-MB tls)
will help with dynamically adjustable trace size
llvm-svn: 168783
2012-11-28 10:35:31 +00:00
Dmitry Vyukov
05d7ade34d
tsan: add description of memory layouts in different configs
...
llvm-svn: 168777
2012-11-28 07:44:26 +00:00
Will Dietz
2631aaf939
ubsan: Support unsigned overflows, and divide-by-zero int/float split.
...
llvm-svn: 168700
2012-11-27 15:01:43 +00:00
Dmitry Vyukov
ec8da99846
tsan: fix macro mess
...
llvm-svn: 168697
2012-11-27 12:51:16 +00:00
Dmitry Vyukov
69a071d5a6
tsan: fix compilation for dead old compilers (why we are supporting them at all?..)
...
llvm-svn: 168693
2012-11-27 09:35:44 +00:00
Dmitry Vyukov
210c21129e
tsan: add memory range access functions to public iface
...
llvm-svn: 168692
2012-11-27 08:41:39 +00:00
Dmitry Vyukov
59d58665ee
tsan: add 128-bit atomic operations
...
llvm-svn: 168683
2012-11-27 07:41:27 +00:00
Dmitry Vyukov
10362c46f1
tsan: refactor atomic operations implementation
...
do the atomic operation under the sync object mutex
make acquire/release sync atomic with the operation itself
combine acquire and release into a single acq_rel operation
llvm-svn: 168682
2012-11-27 07:25:50 +00:00
Dmitry Vyukov
20678e2b68
tsan: explicitly mark symbols referenced from assembly as hidden
...
this allows to build tsan runtime as dynamic library
llvm-svn: 168589
2012-11-26 14:20:26 +00:00
Kostya Serebryany
19e34c23c5
[asan] fix Android build by not calling GetPageSizeCached in a test (no need for the page size anyway)
...
llvm-svn: 168585
2012-11-26 11:23:30 +00:00
Dmitry Vyukov
3b4501254f
tsan: add atomic nand operation
...
llvm-svn: 168584
2012-11-26 09:42:56 +00:00
Dmitry Vyukov
ce7a1ba196
tsan: faster memory reset for Go
...
llvm-svn: 168567
2012-11-25 16:05:42 +00:00
Kostya Serebryany
df198db1aa
[asan/tsan] get rid of kPageSize completely in favor of GetPageSizeCached(). This makes the code friendly to more platforms
...
llvm-svn: 168537
2012-11-24 05:03:11 +00:00
Dmitry Vyukov
195eda9922
tsan: add failure memory order to atomic compare exchange functions
...
llvm-svn: 168518
2012-11-23 15:51:45 +00:00
Kostya Serebryany
f22c697f58
[asan] get rid of some of the uses of kPageSize. The intent is to get rid of it completely to support platforms with multiple possible page sizes.
...
llvm-svn: 168517
2012-11-23 15:38:49 +00:00
Alexey Samsonov
1a05424ee0
[ASan] move swapcontext_test to Linux-specific tests
...
llvm-svn: 168513
2012-11-23 11:20:54 +00:00
Alexey Samsonov
aac36b345a
[ASan] intercept swapcontext on Linux only
...
llvm-svn: 168509
2012-11-23 10:14:44 +00:00
Alexey Samsonov
0d7755ccb5
[ASan] Add interceptor for swapcontext to fight with false positives in some of its use cases.
...
llvm-svn: 168508
2012-11-23 09:46:34 +00:00
Dmitry Vyukov
db584aded7
tsan: ensure than func entry/exit are inlined
...
llvm-svn: 168506
2012-11-23 07:14:11 +00:00
Dmitry Vyukov
6971414f3e
tsan: fix more bugs in signal handling
...
llvm-svn: 168497
2012-11-22 13:53:54 +00:00
Dmitry Vyukov
3048e1a399
tsan: add missing \n in report
...
llvm-svn: 168496
2012-11-22 13:38:28 +00:00
Dmitry Vyukov
35437032be
tsan: better error message for OOM
...
llvm-svn: 168491
2012-11-22 08:42:01 +00:00
Kostya Serebryany
8bc5421ba0
[asan] get rid of kPageSizeBits
...
llvm-svn: 168426
2012-11-21 13:31:07 +00:00
Evgeniy Stepanov
979a1e7352
Allow PopStackFrames leave the stack empty.
...
llvm-svn: 168425
2012-11-21 13:00:04 +00:00
Kostya Serebryany
734f1eb5f4
[asan/tsan] do not use __WORDSIZE macro, as it is glibc-private thing. Instead, define our own SANITIZER_WORDSIZE
...
llvm-svn: 168424
2012-11-21 12:38:58 +00:00
Dmitry Vyukov
aeed45cde0
tsan: explictly say when we fail to restore a stack trace
...
llvm-svn: 168423
2012-11-21 11:44:20 +00:00
Alexey Samsonov
3a3488e4e1
[Sanitizer] replace while with internal_memset to make sure compiler won't replace it with library memset
...
llvm-svn: 168422
2012-11-21 11:12:57 +00:00
Dmitry Vyukov
9ca2afd3a1
tsan: fix handling of signals
...
(do not execute synchronous signals in recursive interceptors)
llvm-svn: 168421
2012-11-21 11:12:33 +00:00
Kostya Serebryany
6db8ad43df
[asan] pop the two internal functions from the stack trace produced by _Unwind_Backtrace (Peter Bergner)
...
llvm-svn: 168369
2012-11-20 15:15:44 +00:00
Kostya Serebryany
87e0464bfb
[asan] better support for powerpc and sparc targets (thanks to H.J. Liu and David Miller)
...
llvm-svn: 168358
2012-11-20 08:57:26 +00:00
Kostya Serebryany
46de580003
[asan] more support for powerpc, patch by Peter Bergner
...
llvm-svn: 168356
2012-11-20 07:00:42 +00:00
Alexey Samsonov
27a22688b9
[ASan] use raw Exit() to kill the program in case ASan finds an error while reporting the error in the same thread
...
llvm-svn: 168308
2012-11-19 11:22:22 +00:00
Kostya Serebryany
386e2d853b
[asan] support x32 mode in the fast stack unwinder. Patch by H.J. Lu
...
llvm-svn: 168306
2012-11-19 10:31:00 +00:00
Alexey Samsonov
06b22c1513
[ASan] change interface of GetAccumulatedStats() function to prevent Clang from inserting memcpy() call into runtime.
...
llvm-svn: 168305
2012-11-19 10:25:17 +00:00
Kostya Serebryany
cb9f62189b
[asan] support PowerPC and SPARC in sanitizer_linux.cc
...
llvm-svn: 168301
2012-11-19 07:53:36 +00:00
Alexey Samsonov
56f1ef7d3b
ubsan: fix broken test case by using brand new [[ @LINE ]] FileCheck feature
...
llvm-svn: 168170
2012-11-16 13:38:03 +00:00
Alexey Samsonov
be9a293dda
UBSan: enable CMake build on Darwin. Fix two failing tests and disable the test which produces linker errors on Darwin.
...
llvm-svn: 168169
2012-11-16 12:57:07 +00:00
Dmitry Vyukov
4ee90c231a
asan: sync with gcc r193553
...
llvm-svn: 168151
2012-11-16 11:26:05 +00:00
Alexey Samsonov
4ac66c49da
[TSan] use explicit ctor for BlockingCall
...
llvm-svn: 168150
2012-11-16 11:21:07 +00:00
Alexey Samsonov
038e3489d9
[TSan] use llvm-symbolizer to run tsan tests
...
llvm-svn: 168146
2012-11-16 10:16:14 +00:00
Dmitry Vyukov
933c9889aa
tsan: remove unused parameter
...
llvm-svn: 168060
2012-11-15 18:49:08 +00:00
Dmitry Vyukov
f34db58c20
tsan: switch to 4 shadow cells by default (since that's what we use everywhere now)
...
llvm-svn: 168059
2012-11-15 18:44:22 +00:00
Dmitry Vyukov
262465c126
tsan: eevn better handling of signals
...
add interceptor for poll()
in addition process signals in every atomic op
in addition process signals in blocking libc functions
llvm-svn: 168050
2012-11-15 17:40:49 +00:00
Alexander Potapenko
bcc00a4174
[ASan] Revert r168040 and r168043 and take a cleaner solution suggested by Kostya: return the known frame name for fake stack instead of looking it up.
...
llvm-svn: 168046
2012-11-15 15:24:42 +00:00
Alexander Potapenko
93dcc8d2bd
[ASan] Minor fix: return to the last byte of the fake stack if we've raced by.
...
llvm-svn: 168043
2012-11-15 14:59:19 +00:00
Alexander Potapenko
b34db9e883
[ASan] Poison the leftmost shadow byte with a special value so that we can find
...
the beginning of the fake frame when reporting an use-after-return error.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=126
llvm-svn: 168040
2012-11-15 13:40:44 +00:00
Alexander Potapenko
4d533d243d
[ASan] Add the "lea $imm(%rip),%rax" instruction to mach_override.c
...
The need for this has been reported by Jack Howarth (howarth@bromo.med.uc.edu ) who's porting ASan-Darwin to GCC
llvm-svn: 168032
2012-11-15 08:32:16 +00:00
Richard Smith
2674c6e39b
Fix typo from code review (thanks to Alexey Samsonov). This is also caught by the existing tests when building for i386.
...
llvm-svn: 167890
2012-11-13 23:58:20 +00:00
Richard Smith
6122d0692b
Support for building the ubsan runtime when using the autoconf build system on
...
Darwin. Patch by Jean-Daniel Dupas, tweaked by Jonathan Sauer, simplified
somewhat by me.
llvm-svn: 167889
2012-11-13 23:55:06 +00:00
Richard Smith
05dce7e644
-fsanitize=undefined: Switch to using sanitizer_common for output. This gets us much closer to not depending on any system headers.
...
llvm-svn: 167888
2012-11-13 23:42:05 +00:00
Kostya Serebryany
1f8922cf71
[asan] use #if defined __x86_64__ instead of #if __WORDSIZE == 64 in sanitizer_linux.cc
...
llvm-svn: 167883
2012-11-13 23:13:17 +00:00
Dmitry Vyukov
6d67d3b0ee
tsan: remove unused const
...
llvm-svn: 167835
2012-11-13 14:13:21 +00:00
Dmitry Vyukov
041eaf976c
tsan: better function names
...
llvm-svn: 167834
2012-11-13 14:05:58 +00:00
Alexey Samsonov
b8a5f99bee
[TSan] Add output test for write under reader lock
...
llvm-svn: 167833
2012-11-13 14:05:02 +00:00
Dmitry Vyukov
dcba4d1288
tsan: fix stats collection
...
llvm-svn: 167832
2012-11-13 13:53:43 +00:00
Alexey Samsonov
2906117857
[ASan] now we don't need llvm_obj_root to access llvm-symbolizer tool
...
llvm-svn: 167823
2012-11-13 07:55:16 +00:00
Alexey Samsonov
c835b9e4a3
[ASan] test blacklist functionality for global-init-order checker (r167725)
...
llvm-svn: 167727
2012-11-12 14:03:00 +00:00
Alexander Potapenko
9448581d9e
[ASan] Remove llvm-symbolizer from compiler-rt/utils/
...
This is the first (1/2) part of a change that moves llvm-symbolizer to llvm/tools/, which will allow to build it
with both cmake and configure+make.
llvm-svn: 167722
2012-11-12 11:32:42 +00:00
Alexander Potapenko
5066c5d9b7
[ASan] Fix the golden stack for use-after-free.cc.
...
The change has been caused by the switch to llvm-symbolizer, that prints inlined stack frames.
This should fix PR 14251
llvm-svn: 167721
2012-11-12 11:27:24 +00:00
Dmitry Vyukov
317f39290d
tsan: intercept gettimeofday()
...
llvm-svn: 167630
2012-11-09 19:55:06 +00:00
Alexey Samsonov
ae9b18b607
[Sanitizer] add sanity checks for communication with external symbolizer
...
llvm-svn: 167617
2012-11-09 14:45:30 +00:00
Dmitry Vyukov
805006b0ab
tsan: switch to new memory_order constants (ABI compatible)
...
llvm-svn: 167614
2012-11-09 14:11:51 +00:00
Dmitry Vyukov
4e5f72d380
tsan: add __tsan_atomicX_compare_exchange_val() function
...
It's easier to call from compiler module.
llvm-svn: 167611
2012-11-09 12:54:37 +00:00
Alexander Potapenko
4b8e32de12
Add a possible underscore before the wrappers to the output expectations for Darwin
...
llvm-svn: 167610
2012-11-09 11:55:33 +00:00
Dmitry Vyukov
26216e4ae3
tsan: add range access functions for Go
...
llvm-svn: 167580
2012-11-08 13:38:45 +00:00
Alexey Samsonov
37119db20a
[ASan] avoid including <new> header in ASan runtime
...
llvm-svn: 167579
2012-11-08 13:31:19 +00:00
Dmitry Vyukov
e829b6231a
tsan: change TSAN_OPTIONS->GORACE in build script as well
...
llvm-svn: 167578
2012-11-08 13:23:13 +00:00
Alexey Samsonov
c463f3077e
[Sanitizer] try to fix Windows bot - include stdlib.h for abort/_exit functions
...
llvm-svn: 167577
2012-11-08 13:08:41 +00:00
Dmitry Vyukov
9952b674ca
tsan: use GORACE env for options for Go
...
llvm-svn: 167575
2012-11-08 11:32:40 +00:00
Dmitry Vyukov
67dc5702f8
tsan: do not sleep at exit if there are no other threads
...
llvm-svn: 167533
2012-11-07 16:41:57 +00:00
Dmitry Vyukov
ea4f1990e1
tsan: add flag to suppress all reports (useful for benchmarking)
...
llvm-svn: 167532
2012-11-07 16:14:12 +00:00
Dmitry Vyukov
e11f2920c9
tsan: more precise handling of finalizers
...
llvm-svn: 167530
2012-11-07 15:08:20 +00:00
Dmitry Vyukov
da78be74f3
tsan: slightly relax requirements for lazy shadow memory (can overlap and may not be properly aligned)
...
it's problematic on windows where allocation granularity is much larger than page size
llvm-svn: 167466
2012-11-06 16:48:46 +00:00
Dmitry Vyukov
c015712992
tsan: lazily allocate shadow for Go
...
llvm-svn: 167464
2012-11-06 16:00:16 +00:00