Commit Graph

3596 Commits

Author SHA1 Message Date
Kostya Serebryany 01be296dbb [sanitizer] support pthread_rwlock_rd* in deadlock detector
llvm-svn: 202132
2014-02-25 10:33:37 +00:00
Kostya Serebryany fd88edfddb [sanitizer] partially support pthread_rwlock_* (no rd* form yet)
llvm-svn: 202128
2014-02-25 09:33:10 +00:00
Kostya Serebryany a1a6391d19 [asan] Fix for size_t in Asan's new and delete operators on x64 FreeBSD in 32-bit mode, only for FreeBSD <= 9.2; patch by Viktor Kutuzov
llvm-svn: 202124
2014-02-25 08:45:59 +00:00
Kostya Serebryany 8f240ec03f [tsan] add deadlock detector tests for pthread_spin_lock
llvm-svn: 202123
2014-02-25 08:42:34 +00:00
Alexey Samsonov 97c22f79e1 Enable UBSan on FreeBSD. Patch by Viktor Kutuzov.
llvm-svn: 202122
2014-02-25 08:29:36 +00:00
Kostya Serebryany 11f4f30fa7 [sanitizer] add support for try_lock in deadlock detector
llvm-svn: 202120
2014-02-25 08:24:15 +00:00
Kostya Serebryany 6d54611fd4 [sanitizer] fix epoch handling in deadlock detector (before the fix, we could have had edges from locks in the previous epoch to locks in the current epoch)
llvm-svn: 202118
2014-02-25 07:34:41 +00:00
Evgeniy Stepanov 4bf7a268e0 [asan] Add a test for interceptors in shared libraries.
llvm-svn: 202037
2014-02-24 14:31:28 +00:00
Kostya Serebryany cc92c79531 [asan] simplify the code that compute the shadow offset; get rid of two internal flags that allowed to override it. The tests pass, but still this change might break asan on some platform not covered by tests. If you see this, please submit a fix with a test.
llvm-svn: 202033
2014-02-24 13:40:24 +00:00
Kostya Serebryany d77dfcb384 [tsan] one more test for deadlock detector
llvm-svn: 202026
2014-02-24 11:45:47 +00:00
Evgeniy Stepanov c0ae3dfc3a [asan] A test was reverted, but not "svn rm"-ed in r202016.
llvm-svn: 202025
2014-02-24 11:43:47 +00:00
Alexey Samsonov a2fee5d907 [CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt libraries are build by 'make all' command
llvm-svn: 202023
2014-02-24 11:32:49 +00:00
Dmitry Vyukov a661a13c0f tsan: fix SIGRTMAX handling
llvm-svn: 202022
2014-02-24 11:28:59 +00:00
Alexey Samsonov 2f27f0b0ee [CMake] Introduce COMPILER_RT_ENABLE_WERROR option
llvm-svn: 202021
2014-02-24 11:22:39 +00:00
Evgeniy Stepanov 4c32d16c76 Revert r202014.
Failing on the bots for an unknown reason.

llvm-svn: 202016
2014-02-24 10:21:44 +00:00
Evgeniy Stepanov 567e0eef4c [asan] Add a test for interceptors in shared libraries.
llvm-svn: 202014
2014-02-24 10:04:42 +00:00
Evgeniy Stepanov d512234d7e [asan] Avoid hardcoding library path in test binary.
llvm-svn: 202013
2014-02-24 10:03:33 +00:00
Kostya Serebryany cf5d8e4f29 AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific code so it seems it should have more generic name and moved to a common scope.
Renamed to AdjustStackSize.
Patch by Viktor Kutuzov.

llvm-svn: 202011
2014-02-24 08:53:26 +00:00
Kostya Serebryany 04f2bf0f07 [sanitizer] Interception macros for sanitizers on FreeBSD; patch by Viktor Kutuzov
llvm-svn: 202009
2014-02-24 08:37:41 +00:00
Dmitry Vyukov 249cd9af9c tsan: fix compiler warning
error: address of array 'tctx->name' will always evaluate to 'true'

llvm-svn: 202008
2014-02-24 08:19:53 +00:00
Reid Kleckner 324eee45a7 Revert "Replace __FUNCTION__ with __func__, the latter being standard C99/C++11."
This reverts commit r201910.

While __func__ may be standard in C++11, it was only recently added to
MSVC in 2013 CTP, and LLVM supports MSVC 2012.  __FUNCTION__ may not be
standard, but it's *very* portable.

llvm-svn: 201916
2014-02-22 00:37:45 +00:00
Joerg Sonnenberger b15779f307 Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.
llvm-svn: 201910
2014-02-21 23:55:15 +00:00
Joerg Sonnenberger 938b0df72d Introduce CRT_HAS_128BIT, currently for all __LP64__ platforms.
Use it to enable the various functions for TI mode.

llvm-svn: 201909
2014-02-21 23:53:03 +00:00
Joerg Sonnenberger e245715fca Add Matt Thomas and myself.
llvm-svn: 201908
2014-02-21 23:51:38 +00:00
Kostya Serebryany 0548c79859 [tsan] add coarse-grained lock around the DeadlockDetector. We can do better than that, but that's a start.
llvm-svn: 201861
2014-02-21 15:07:18 +00:00
Tim Northover 23a2fb59b6 Darwin: use the compiler-provided linker
When actually compiling we use clang for the final .dylib creation stage, so we
should ask it what linker it'll use when detecting support for our
architectures.

llvm-svn: 201845
2014-02-21 10:19:22 +00:00
Bob Wilson 96e99556ad Add an environment variable to override the default profile output file.
Also rename the default output file from "pgo-data" to "default.profdata".
The ".profdata" suffix is consistent with the name of the new llvm-profdata
tool.

llvm-svn: 201808
2014-02-20 19:52:32 +00:00
Alexey Samsonov b106f2c0ac [FreeBSD] Enable building a few runtime libraries on FreeBSD.
Patch by Viktor Kutuzov!

llvm-svn: 201783
2014-02-20 13:14:05 +00:00
Alexey Samsonov 04e7ad29ea [CMake] Introduce check-all command for standalone compiler-rt build
llvm-svn: 201780
2014-02-20 12:36:26 +00:00
Alexey Samsonov 35a66d15d4 Move config for sanitizer_common tests under test/ for consistency
llvm-svn: 201779
2014-02-20 12:18:08 +00:00
Alexey Samsonov 11705b2f10 [CMake] break dependency between unit tests and runtimes in standalone build
llvm-svn: 201778
2014-02-20 12:03:56 +00:00
Evgeniy Stepanov e0e980c748 [msan] Remove stubs for non-instrumented code from msan interface header.
llvm-svn: 201777
2014-02-20 11:43:00 +00:00
Alexey Samsonov 5e6d83258e [CMake] lit tests shouldn't depend on runtimes in standalone build
llvm-svn: 201771
2014-02-20 09:47:18 +00:00
Evgeniy Stepanov 0f56a71859 [asan] Changes to asm instrumentation must be done through the generator script.
llvm-svn: 201766
2014-02-20 07:56:58 +00:00
Evgeniy Stepanov 8126e76a8a [asan] Do all calls to __asan_report_* through PLT.
This matters when runtime is built as a shared library. Even though calling
code is itself part of the same library, these symbols are public and can
(theoretically) be interposed.

It might be better to declare hidden aliases for asan_report_* and call them
directly, but
  (a) they are (noreturn), so performance does not matter, and
  (b) it may be potentially less portable.

llvm-svn: 201764
2014-02-20 07:54:29 +00:00
Alexey Samsonov 31043152d3 Add rudimentary support for running compiler-rt lit tests with GCC
llvm-svn: 201680
2014-02-19 15:13:14 +00:00
Kostya Serebryany 699b975014 [tsan] improve the test that checks for lock inversion with 3 locks
llvm-svn: 201676
2014-02-19 14:24:31 +00:00
Kostya Serebryany b51f8d4990 [tsan] when printing a mutex, also print its address. Properly print the deadlock report.
llvm-svn: 201675
2014-02-19 14:17:25 +00:00
Alexey Samsonov 8067448dfe [CMake] Use host compiler to run lit tests in standalone mode
llvm-svn: 201674
2014-02-19 13:45:49 +00:00
Evgeniy Stepanov cba008e9c5 [asan] A different way of detectinb stack overflow.
Instead of checking stack limits that are not well defined for the main thread,
we rely on siginfo::si_code and distance from SP.

llvm-svn: 201673
2014-02-19 13:40:41 +00:00
Alexey Samsonov 150d62aa2a [CMake] Use host compiler to build unittests in standalone mode
llvm-svn: 201672
2014-02-19 13:01:03 +00:00
Evgeniy Stepanov cc8e58bc46 [asan] Ensure that stack is limited before attempting to overflow it.
Very bad things happen otherwise.

llvm-svn: 201670
2014-02-19 12:43:27 +00:00
Alexey Samsonov cd8535a96d [CMake] Introduce COMPILER_RT_INCLUDE_TESTS option
llvm-svn: 201666
2014-02-19 11:18:47 +00:00
Evgeniy Stepanov 2274ba7716 [asan] Improve stack overflow detection.
There are more cases when those manifest as an access below SP.

llvm-svn: 201664
2014-02-19 11:02:46 +00:00
Alexey Samsonov aa980c760b [CMake] Add the way to run tests in standalone build.
1) Depend on llvm-config (configured in LLVM_CONFIG_PATH) to
get necessary LLVM source/binary directories.
2) Add basic support for running lit tests (check-xsan commands).
For now this "support" is far from what we want:
  * unit tests are not built currently.
  * lit tests use Clang/compiler-rt from LLVM build directory,
    not the host compiler or just-built compiler-rt libraries.

We should make a choice on the way we intend ti run compiler-rt lit testsuite:
a) use either Clang from LLVM build tree, or the host compiler.
b) use either just-built runtimes, or the runtimes shipped with the
host compiler.

Using just-built runtimes is tricky - we have to know where to put them, so that
Clang/GCC driver would pick them up (and not overwrite the existing runtimes).
Using a host compiler instead of Clang from LLVM build tree will give us a chance to
run lit tests under GCC (which already has support for several sanitizers).

That is, I tend to make the following choice: if we're in a standalone compiler-rt
build, use host compiler with its set of runtime libraries to run lit tests.
This will effectively decouple "make compiler-rt" and "make check-compiler-rt" in
a standalone build - the latter wouldn't invoke the former. Note that if we decide
to fix LLVM/Clang/compiler-rt build system so that it would configure/build
compiler-rt with just-built Clang (as we do in Makefile-based build), this will not
be a problem - we can add a dependency to ensure that clang/compiler-rt are rebuilt
before running compiler-rt tests.

llvm-svn: 201656
2014-02-19 10:04:29 +00:00
Evgeniy Stepanov caaaac8c30 [asan] Disable asm instrumentation and tests on Mac.
Move asm tests to their own file.

llvm-svn: 201653
2014-02-19 09:14:39 +00:00
Evgeniy Stepanov 182319f7ba [asan] Fix build on ARM.
llvm-svn: 201652
2014-02-19 09:01:14 +00:00
Evgeniy Stepanov 2169c6bba4 [asan] Added assembly functions for x86/amd64 asan.
These are runtime support functions for inline assembly instrumentation.
This is a re-submit of r201402.

Patch by Yuri Gorshenin.

llvm-svn: 201650
2014-02-19 08:30:39 +00:00
Alexey Samsonov de4ef2a066 [CMake] Rudimentary support for standalone CompilerRT build system.
This change allows to build compiler-rt libraries separately from
LLVM/Clang (path to LLVM build directory should be specified at
configure time). Running tests is not yet supported.

llvm-svn: 201647
2014-02-19 07:49:16 +00:00
Timur Iskhodzhanov cb9dc67a5e [ASan/Win] Add a couple more DLL thunks
llvm-svn: 201580
2014-02-18 15:31:29 +00:00