Commit Graph

664 Commits

Author SHA1 Message Date
Alexey Samsonov 716aa7e2f2 [ASan] fixup for r159652
llvm-svn: 159655
2012-07-03 09:06:39 +00:00
Alexey Samsonov 961276af26 [Sanitizer] Extend a symbolizer code. Implemented for Linux only. Use dl_iterate_phdr to get virtual addresses of mapped module sections. To symbolize an address from a module, map this module to memory and obtain pointers to debug info sections. Later these pointers can be passed to constructor of DWARF context-in-memory from LLVM DebugInfo lib.
llvm-svn: 159652
2012-07-03 08:24:14 +00:00
Alexey Samsonov 6f510f8eb5 [TSan] use threadsafe death tests in TSan unit tests
llvm-svn: 159533
2012-07-02 14:35:25 +00:00
Dmitry Vyukov b13099c26e asan/tsan: improve SpinMutex
llvm-svn: 159518
2012-07-02 07:09:21 +00:00
Dmitry Vyukov b462dfcaeb tsan/asan: add mutex to 64-bit allocator
llvm-svn: 159516
2012-07-02 06:54:24 +00:00
Alexey Samsonov 4618508ea4 [ASan] cmake cleanup: make tab/space padding in CMakeLists consistent, silence/fix some pedantic warnings
llvm-svn: 159514
2012-07-02 06:48:10 +00:00
Dmitry Vyukov 3c5c9e7774 tsan/asan: third try on msvc atomics
llvm-svn: 159449
2012-06-29 18:37:45 +00:00
Dmitry Vyukov b379fe51b4 tsan/asan: second attemp on msvc atomics
llvm-svn: 159447
2012-06-29 18:28:02 +00:00
Dmitry Vyukov e8cee12ce2 tsan/asan: first try on msvc atomics
llvm-svn: 159443
2012-06-29 18:00:38 +00:00
Dmitry Vyukov 513f0238d8 tsan/asan: add SpinMutex to sanitizer_common
llvm-svn: 159439
2012-06-29 17:32:18 +00:00
Dmitry Vyukov 7a9fa7dbc5 tsan/asan: unify ScopedLock
llvm-svn: 159438
2012-06-29 17:10:08 +00:00
Dmitry Vyukov 6fa46f7003 tsan/asan: unify atomics (move atomics from tsan to sanitizer_common)
llvm-svn: 159437
2012-06-29 16:58:33 +00:00
Dmitry Vyukov 6967083071 tsan: use -Wno-unused-private-field only for clang (gcc does not understand it)
llvm-svn: 159435
2012-06-29 16:37:49 +00:00
Kostya Serebryany 92afdb6c31 [tsan] added CombinedAllocator for tsan
llvm-svn: 159432
2012-06-29 15:35:18 +00:00
Dmitry Vyukov ef5a5a5650 tsan: replace struct copies where clang inserts memcpy() calls with explicit internal_memcpy() calls
llvm-svn: 159431
2012-06-29 15:26:55 +00:00
Dmitry Vyukov 5bb47a6e0e tsan: remove own memset/memcpy/memcmp (too messy)
llvm-svn: 159430
2012-06-29 15:19:14 +00:00
Kostya Serebryany 5766a9e015 [asan] fix lint
llvm-svn: 159429
2012-06-29 14:14:32 +00:00
Kostya Serebryany d32d537d63 [asan] get rid of libc's sscanf as it causes infinite recursion on Fedora.
llvm-svn: 159424
2012-06-29 13:05:36 +00:00
Alexey Samsonov c37ac17629 [ASan] cmake unit tests: explicitly add necessary linker flags when linking unit tests with asan runtime
llvm-svn: 159420
2012-06-29 11:29:39 +00:00
Alexey Samsonov 548b7b5b0e [ASan] cmake-based unit tests: merge instrumented and non-instrumented files into one test binary
llvm-svn: 159419
2012-06-29 10:23:31 +00:00
Dmitry Vyukov a932bdfc1e tsan: clear shadow for ucontext, because it's visible to user
llvm-svn: 159365
2012-06-28 18:20:50 +00:00
Dmitry Vyukov fa985a02ef tsan: fix crashes if signal is caught during thread bootstrap or shutdown
llvm-svn: 159361
2012-06-28 18:07:46 +00:00
Alexey Samsonov 6b03aa1bf7 [ASan] fix the build - erase second main as we link all test sources together
llvm-svn: 159348
2012-06-28 13:44:27 +00:00
Alexey Samsonov 3fe0d4d9aa [ASan] silence various warnings in cmake build of asan unit tests
llvm-svn: 159347
2012-06-28 13:12:07 +00:00
Alexey Samsonov b4edab5a6b [ASan] cmake support for running asan unit tests on Mac
llvm-svn: 159345
2012-06-28 12:19:52 +00:00
Alexey Samsonov ecf5436e9c [ASan] update cmake rules so that ASan unit tests can include googletest (and, hence, llvm) headers when they are built by fresh Clang
llvm-svn: 159343
2012-06-28 09:32:19 +00:00
Dmitry Vyukov e4df904770 tsan: add missing file (forgot to svn add in r159294)
llvm-svn: 159341
2012-06-28 09:04:45 +00:00
Alexey Samsonov 70386aaffa [ASan] cleanup: trailing semicolons, trailing colons in enums
llvm-svn: 159338
2012-06-28 08:27:24 +00:00
Alexey Samsonov fa42dd7ac4 [Sanitizer] fight more semicolons in macro definitions (to please mac cmake build)
llvm-svn: 159337
2012-06-28 08:07:19 +00:00
Dmitry Vyukov 090f345522 tsan: prevent insertion of unwanted memset/memcpy/memcmp into runtime
llvm-svn: 159294
2012-06-27 21:00:23 +00:00
Dmitry Vyukov b94a8f0c39 tsan: remember and pass original ucontext to signal handlers (instead of a fabricated one)
llvm-svn: 159278
2012-06-27 17:35:35 +00:00
Dmitry Vyukov 97c26bdaea tsan: refactor signal handling code (move some definitions out of common header)
llvm-svn: 159266
2012-06-27 16:05:06 +00:00
Dmitry Vyukov d326a6cf93 tsan: check that signal handlers do not spoil errno.
llvm-svn: 159264
2012-06-27 13:54:46 +00:00
Dmitry Vyukov f8b7a8dc08 tsan: close all file descriptors after fork()
llvm-svn: 159263
2012-06-27 12:48:46 +00:00
Chandler Carruth 9aaf156f30 Add support for building the ASan instrumentation unit tests with the
just-built Clang binary, and linking them against the just-built ASan
runtime.

This is *very* brittle. I expect it will require tweaking, and I've
pro-actively disabled it on non-Unix builds and on cross-builds.

It is also currently missing dependency edges on GoogleTest header files
and a few other corner cases, but those can be fixed. This is the major
milestone of a mini-bootstrap-like build of the unittest.

llvm-svn: 159255
2012-06-27 09:01:24 +00:00
Kostya Serebryany 4196046714 [tsan] added LargeMmapAllocator, a part of the new tsan allocator
llvm-svn: 159204
2012-06-26 14:23:32 +00:00
Alexey Samsonov e2109388a4 [TSan] fix warnings suppression: internal-linkage-in-inline was renamed to static-in-inline
llvm-svn: 159198
2012-06-26 11:33:51 +00:00
Kostya Serebryany c639b3943a [asan] update the cmake file for asan
llvm-svn: 159143
2012-06-25 15:38:37 +00:00
Dmitry Vyukov c598de93bd tsan: remove internal allocator, switch to sanitizer_common one.
llvm-svn: 159142
2012-06-25 15:09:24 +00:00
Dmitry Vyukov ec64f3e738 tsan: remove internal allocator, switch to sanitizer_common one.
llvm-svn: 159141
2012-06-25 15:03:15 +00:00
Kostya Serebryany aad697eb8a [tsan] lint
llvm-svn: 159140
2012-06-25 14:58:17 +00:00
Kostya Serebryany 100590f756 [tsan] minor changes in tsan allocator
llvm-svn: 159139
2012-06-25 14:53:49 +00:00
Kostya Serebryany 6bbb5140cc [tsan] fix the build
llvm-svn: 159137
2012-06-25 14:31:59 +00:00
Kostya Serebryany 9ed4f506bb [asan] move tests from asan_interface_test.cc to asan_noinst_test.cc. Now all these tests do not require instrumentation and work directly with asan rt
llvm-svn: 159135
2012-06-25 14:23:07 +00:00
Chandler Carruth 9359efa986 Cleanup the handling of CFLAGS even more in the cmake build for ASan.
Add the initial support for building ASan tests.

The first change here is to try to get the CFLAGS to more closely match
those used by the old Makefile. There are probably still goofs here,
ASan folks, your review would be appreciated.

The second big change is to add support for building both
instrumentation based an non-instrumentation based unittests for ASan.
They are built a bit differently from how the old makefiles managed
things. Specifically, there are two binaries, one for the
non-instrumented case, and one for the instrumented case.

Also, the instrumented unit tests rely on the host compiler supporting
AddressSanitizer's intrumentation pass. This is kind-of gross, but
I don't know of a better way yet. I've mailed llvmdev to discuss this
issue.

One big caveat is that the detection logic currently doesn't work. I've
commented it out temporarily as I'd like to get feedback from the ASan
developers, etc.

llvm-svn: 159134
2012-06-25 12:57:43 +00:00
Kostya Serebryany 0e0832bfdb [asan] get rid of '#include <malloc.h>' in the implementation of malloc interceptors
llvm-svn: 159132
2012-06-25 09:58:29 +00:00
Chandler Carruth c78ad00c07 Another big step toward a viable CMake build system for CompilerRT,
ASan, and friends.

This explicitly switches the CompilerRT CMake build to require CMake
version 2.8.8 or newer which provides first-class support for "object"
libraries which consist of a pile of '.o' files -- exactly what is
desired for composing runtime libraries. I've gone ahead and switched to
using this.

I've also added the interception library which I missed initially. And
I've added proper dependencies between the various libraries. With this,
I'm able to build archives for asan that appear to contain all of the
necessary .o files.

The final tweak here is to start setting up the compile flags and macro
defines expected by ASan and its helper libraries. These may not be
entirely correct currently, they're based loosely on my reading of the
old Makefiles. However, they can be tweaked more easily now that they're
wired up properly.

llvm-svn: 159129
2012-06-25 08:40:10 +00:00
Chandler Carruth bbff278c9c Lots of trivial changes to remove extraneous semicolons throughout ASan.
llvm-svn: 159128
2012-06-25 06:53:10 +00:00
Kostya Serebryany f299f7013a [tsan] a better CHECK for OOM in the new allocator
llvm-svn: 159122
2012-06-25 04:12:49 +00:00
Kostya Serebryany 875f99a6bf [asan] fix -Wsign-compare
llvm-svn: 159083
2012-06-23 16:30:48 +00:00