Commit Graph

3182 Commits

Author SHA1 Message Date
Sergey Matveev 7bc300c8fc [sanitizer] Fix log_path behavior with StopTheWorld.
Summary:
Fix race on report_fd/report_fd_pid between the parent process and the
tracer task.

Reviewers: samsonov

Reviewed By: samsonov

CC: llvm-commits, kcc, dvyukov

Differential Revision: http://llvm-reviews.chandlerc.com/D2306

llvm-svn: 196385
2013-12-04 14:37:01 +00:00
Timur Iskhodzhanov b8c367b49d [ASan] Use 'extern "C"' rather than 'extern' for global variables exposed in the interface
llvm-svn: 196379
2013-12-04 12:51:42 +00:00
Kostya Serebryany 5b66bad259 [asan] require __i686__ for the SSE test; also make weaker claims about stack buffer overflows in another test
llvm-svn: 196375
2013-12-04 10:48:16 +00:00
Kostya Serebryany 32b0b21790 [asan] revert 196373: committed to many files by mistake
llvm-svn: 196374
2013-12-04 10:47:14 +00:00
Kostya Serebryany 0060391a63 [asan] require __i686__ for the SSE test; also make weaker claims about stack buffer overflows in another test
llvm-svn: 196373
2013-12-04 10:44:13 +00:00
Alexey Samsonov e958f9e480 [ASan] Return interface attribute to __sanitizer_print_stack_trace
llvm-svn: 196364
2013-12-04 08:17:45 +00:00
Yuchen Wu a5de343c79 compiler-rt: Added support for function checksums.
llvm-svn: 196357
2013-12-04 06:00:04 +00:00
Sergey Matveev 12d2143dbc [asan] Fix build error.
llvm-svn: 196303
2013-12-03 18:44:50 +00:00
Sergey Matveev d8fb4d8f91 [sanitizer] Expose __sanitizer_print_stack_trace().
Expose a new interface function for debugging code built with sanitizer tools.
Add an ASan implementation.

llvm-svn: 196302
2013-12-03 18:24:28 +00:00
Joerg Sonnenberger 24f4a7dbec For libkern and libsa on NetBSD, the normal system headers can't be
used. Adjust.

llvm-svn: 196292
2013-12-03 16:19:14 +00:00
Alexey Samsonov 907eb5b630 [Sanitizer] Use more appropriate InternalScopedString in GetCodeRangeForFile
llvm-svn: 196264
2013-12-03 09:29:23 +00:00
Alexey Samsonov 8dd33a27c3 [Sanitizer] Fix a bug introduced in r196112. Add a test.
llvm-svn: 196263
2013-12-03 09:21:08 +00:00
Sergey Matveev b748d46019 [sanitizer] Allow InternalMmapVector construction with zero capacity.
llvm-svn: 196112
2013-12-02 15:41:04 +00:00
Evgeniy Stepanov c0378e72d1 [sanitizer] Intercept textdomain.
Patch by Alexander Taran.

llvm-svn: 196098
2013-12-02 13:43:26 +00:00
Kostya Serebryany 5236c79932 [asan] disable AddressSanitizer.HugeMallocTest if ASAN_AVOID_EXPENSIVE_TESTS is set
llvm-svn: 196097
2013-12-02 13:22:27 +00:00
Kostya Serebryany dc58090213 [asan] dump coverage even if asan has reported an error
llvm-svn: 195959
2013-11-29 14:49:32 +00:00
Kostya Serebryany 5774faf5b0 [sanitizer] disable shmctl intercetor in 32-bit -- it is rotten (bug filed)
llvm-svn: 195958
2013-11-29 14:09:13 +00:00
Timur Iskhodzhanov 5ca41e3800 Increase the LocatePcInTrace PC threshold now that GET_STACK_TRACE_WITH_PC_AND_BP has grown
llvm-svn: 195957
2013-11-29 13:15:25 +00:00
Timur Iskhodzhanov a10c46f2ae Fix current stack unwinding when using DRASan
llvm-svn: 195956
2013-11-29 12:53:30 +00:00
Timur Iskhodzhanov bbf2ff8193 [ASan] Also print <empty stack> when size==0
llvm-svn: 195955
2013-11-29 12:08:59 +00:00
Evgeniy Stepanov f2cddc3e64 [sanitizer] Disable iconv interceptor in OSX.
iconv is defined in an optional DSO, and our interception logic on OSX does not
support that.

llvm-svn: 195919
2013-11-28 14:42:59 +00:00
Evgeniy Stepanov b56c5cd95e [sanitizer] Intercept times.
llvm-svn: 195918
2013-11-28 14:41:22 +00:00
Evgeniy Stepanov 9c1f8323ae [sanitizer] Intercept iconv.
llvm-svn: 195917
2013-11-28 14:14:48 +00:00
Dmitry Vyukov 25ecfcf00c tsan: deflake more tests
llvm-svn: 195916
2013-11-28 10:12:16 +00:00
Dmitry Vyukov 8d1eb705c7 tsan: add support for passing file descriptors over UNIX domain sockets
tsan was missing new fd's arrived from recvmsg(),
and thus was reporting false positives due to missed synchronization on the fd's

llvm-svn: 195914
2013-11-28 09:09:42 +00:00
Dmitry Vyukov 0fea3ad0c7 tsan: deflake more tests
llvm-svn: 195913
2013-11-28 09:06:55 +00:00
Dmitry Vyukov c03868615b tsan: clarify "thread ended with ignores enabled" message
llvm-svn: 195858
2013-11-27 18:23:52 +00:00
Timur Iskhodzhanov c085e99385 Add a DLL thunk for __asan_handle_no_return
llvm-svn: 195845
2013-11-27 14:36:44 +00:00
Alexey Samsonov e0e31c4a30 [ASan] Clarify that AsanThread objects are allocated only via mmap(). No functionality change.
llvm-svn: 195840
2013-11-27 13:22:21 +00:00
Evgeniy Stepanov b76b687628 [sanitizer] Intercept __xpg_strerror_r.
llvm-svn: 195839
2013-11-27 12:29:10 +00:00
Lorenzo Martignoni 085bf66e60 Added missing lib/dfsan/scripts/check_custom_wrappers.sh
llvm-svn: 195838
2013-11-27 11:50:44 +00:00
Alexey Samsonov 1c256cbcc4 [Sanitizer] Add rudimentary support for using libbacktrace in symbolizer.
More steps are needed to actually make it usable:
* sanitizer runtimes should be compiled with -DSANITIZER_LIBBACKTRACE.
* libbacktrace headers should be installed.
* user has to manually link in libbacktrace.a into the executable.

We can easily solve the first two problems in the build system, but
detecting/linking libbacktrace to all the tests we have and end-user programs
is more challenging (and will unlikely work w/o Driver support).

Based on the patch by Jakub Jelinek!

llvm-svn: 195837
2013-11-27 11:46:58 +00:00
Dmitry Vyukov 3238e1c913 tsan: better diagnostics if thread finishes with ignores enabled
print thread creation stack
and stacks where ignores were enabled.

llvm-svn: 195836
2013-11-27 11:30:28 +00:00
Dmitry Vyukov 44be414d69 asan: fix android build
android does not seem to have IOCB_CMD_PREADV

llvm-svn: 195835
2013-11-27 11:20:55 +00:00
Dmitry Vyukov 89117e1fcc tsan: do not leave verbosity>0 in tests
llvm-svn: 195833
2013-11-27 10:05:22 +00:00
Dmitry Vyukov 51b35901fd tsan: minor refactoring
use common helper macro

llvm-svn: 195832
2013-11-27 09:59:11 +00:00
Dmitry Vyukov 7bd319cc08 tsan: fix flags parsing
- running_on_valgrind was not parsed in some contexts
- refactor code a bit
- add comprehensive tests for flags parsing

llvm-svn: 195831
2013-11-27 09:54:10 +00:00
Dmitry Vyukov ee882ba4a1 tsan: support synchronization by means of linux aio
http://llvm-reviews.chandlerc.com/D2269

llvm-svn: 195830
2013-11-27 09:10:47 +00:00
Alexey Samsonov d5144879f9 [Sanitizer] Improve external symbolizer behavior.
1) Don't start external symbolizer subprocess until we actually try to
   symbolize anything.
2) Allow to turn off external symbolizer by providing empty ?SAN_SYMBOLIZER_PATH
   environment variable.

llvm-svn: 195771
2013-11-26 16:24:53 +00:00
Lorenzo Martignoni 895454e1e4 Implement a bunch of custom glibc wrappers & corresponding tests
llvm-svn: 195749
2013-11-26 11:45:58 +00:00
Timur Iskhodzhanov 895392d03f [ASan] Use ExitProcess rather than _exit on Windows to avoid calling global dtors etc
llvm-svn: 195723
2013-11-26 09:40:39 +00:00
Peter Collingbourne 4184a471f2 build-libc-list.py: Replace --{,usr,gcc}lib with flags for specific libraries.
This should allow us to cope with newer versions of GCC (and more esoteric
directory layouts).

llvm-svn: 195695
2013-11-25 23:50:05 +00:00
Sergey Matveev 5170bca73c [lsan] Unbreak lsan_testlib.cc.
Also, add missing logging output.

llvm-svn: 195652
2013-11-25 15:54:31 +00:00
Alexey Samsonov c700e76278 [UBSan] Fix warning by specifying __extension__ before __int128
llvm-svn: 195648
2013-11-25 15:12:40 +00:00
Dmitry Vyukov 8cb7d46d98 tsan: filter out more bogus fd values
people do close(sysconf(_SC_OPEN_MAX)) after fork, where _SC_OPEN_MAX=1200000.

llvm-svn: 195645
2013-11-25 14:53:29 +00:00
Sergey Matveev 6b0f6af374 [lsan] Add a missing file.
llvm-svn: 195643
2013-11-25 14:30:37 +00:00
Sergey Matveev 2d3f8d7840 [lsan] Unbreak standalone LSan's initialization by making it more like ASan's.
No longer allow interceptors to be called during initialization, use the preinit
array (instead of initializing at the first call to an intercepted function) and
adopt the calloc() hack from ASan.

llvm-svn: 195642
2013-11-25 14:25:36 +00:00
Kostya Serebryany ccfc0481f1 [sanitizer] Implement TwoLevelByteMap and use it for the internal allocator on 64-bit.
Summary:
Implement TwoLevelByteMap and use it for the internal allocator on 64-bit.
This reduces bss on 64-bit by ~8Mb because we don't use FlatByteMap on 64-bits any more.

Dmitry, please check my understanding of atomics.

Reviewers: dvyukov

Reviewed By: dvyukov

CC: samsonov, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2259

llvm-svn: 195637
2013-11-25 11:33:41 +00:00
Timur Iskhodzhanov 0d419293e2 [ASan] Follow-up fix: use #if SANITIZER_WINDOWS, not #ifdef
llvm-svn: 195625
2013-11-25 07:56:05 +00:00
Timur Iskhodzhanov 25cc3c55cc [ASan] Un-break the Windows build
llvm-svn: 195624
2013-11-25 07:54:55 +00:00