Commit Graph

3696 Commits

Author SHA1 Message Date
Dmitry Vyukov dd419aee00 tsan: update Go windows build script
llvm-svn: 203121
2014-03-06 14:49:21 +00:00
Evgeniy Stepanov 72a9d25060 [sanitizer] Simplify interceptors with user callbacks.
Get rid of the context argument in UNPOISON_PARAM and INITIALIZE_RANGE.
Get rid of all the thread-local contexts in interceptors.

llvm-svn: 203119
2014-03-06 13:26:09 +00:00
Dmitry Vyukov 350e7ddd34 tsan: update interface for Go
this is required to fix:
https://code.google.com/p/go/issues/detail?id=7460

llvm-svn: 203116
2014-03-06 13:17:28 +00:00
Alexey Samsonov 4a7e96e642 [CMake] Build compiler-rt libraries with -Wall
llvm-svn: 203113
2014-03-06 12:25:02 +00:00
Dmitry Vyukov 2516974e83 tsan: weaken concurrency guarantees in deadlock detector mutex hashmap
read locking on every access is too expensive

llvm-svn: 203112
2014-03-06 12:04:26 +00:00
Dmitry Vyukov 119aa0ea7c tsan: add -ftls-model=initial-exec to deadlock detector flags
one way or another it must present in the process from the beginning

llvm-svn: 203111
2014-03-06 12:03:39 +00:00
Dmitry Vyukov 69bd9ca91c tsan: better error message wording in deadlock reports
llvm-svn: 203109
2014-03-06 12:02:17 +00:00
Alexey Samsonov 5ec35b75ef [FreeBSD] Provide FreeBSD-specific things for ASan.
Patch by Viktor Kutuzov!

llvm-svn: 203100
2014-03-06 09:05:52 +00:00
Alexey Samsonov d52b9ba38d [FreeBSD] Enable procmaps on FreeBSD.
This is not the final patch for procmaps, but it's enough for building
sanitizers and tests on FreeBSD.

Patch by Viktor Kutuzov!

llvm-svn: 203099
2014-03-06 08:58:24 +00:00
Alexey Samsonov 921f5a529e asan_symbolize.py: use llvm-symbolizer results even if it returned function name w/o file/line info
llvm-svn: 202983
2014-03-05 15:18:50 +00:00
Alexey Samsonov 8ad7a05bb4 Improve llvm-symbolizer discovery in asan_symbolize.py
llvm-svn: 202982
2014-03-05 15:00:36 +00:00
Alexey Samsonov e062e4c7eb Enable memrchr interceptor only on Linux
llvm-svn: 202981
2014-03-05 14:07:19 +00:00
Dmitry Vyukov 792d4b1559 tsan: add missing header file to sanitizer_common cmake file
llvm-svn: 202979
2014-03-05 13:55:32 +00:00
Dmitry Vyukov e73e0a04d7 tsan: fix deadlock detector build for SANITIZER_DEADLOCK_DETECTOR_VERSION=2
llvm-svn: 202977
2014-03-05 13:53:29 +00:00
Dmitry Vyukov 9b410fb627 tsan: implement new version of standalong deadlock detector
intercept pthread_cond (it is required to properly track state of mutexes)
detect cycles in mutex graph

llvm-svn: 202975
2014-03-05 13:41:21 +00:00
Dmitry Vyukov cd3583a4c7 tsan: include what you use
VPrintf uses common_flags()

llvm-svn: 202974
2014-03-05 13:40:05 +00:00
Alexey Samsonov 6dece3c99f Add common interceptors for memchr/memrchr
llvm-svn: 202972
2014-03-05 13:25:32 +00:00
Alexey Samsonov 1464b5966d [CMake] Minor fix to llvm-config discovery
llvm-svn: 202954
2014-03-05 09:21:49 +00:00
Alexey Samsonov c8c38dbb18 Increase threshold in StackTrace::LocatePcInTrace
llvm-svn: 202950
2014-03-05 08:29:56 +00:00
Dmitry Vyukov 19126f9075 tsan: add interceptors for pthread_spinlock_t and ptread_rwlock_t for deadlock detector
llvm-svn: 202947
2014-03-05 08:10:27 +00:00
Dmitry Vyukov 30076b0244 tsan: add another missing windows atomic operation
llvm-svn: 202852
2014-03-04 14:21:42 +00:00
Dmitry Vyukov 0a650fe711 tsan: attempt to fix darwin build
everything except linux does not need this hackery with pthread_cond

llvm-svn: 202850
2014-03-04 14:16:28 +00:00
Alexey Samsonov 359c105c92 Fix StackTrace::LocatePcInTrace, add more unit tests for generic StackTrace
llvm-svn: 202849
2014-03-04 14:06:11 +00:00
Alexey Samsonov d964e7cd81 [CMake] Test for libdl and libpthread presence
llvm-svn: 202847
2014-03-04 13:28:21 +00:00
Sergey Matveev 8bf42919e6 [msan] Make up for missing interceptor in getxattr() test.
llvm-svn: 202846
2014-03-04 13:13:34 +00:00
Alexey Samsonov 3d9adc0a73 [ASan] Speed up stack trace unwinding for stacks of size 2.
Summary:
We don't need to do any work in this case - just take
the current PC and caller PC.

Reviewers: eugenis, ygribov

Reviewed By: eugenis

CC: llvm-commits

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

llvm-svn: 202845
2014-03-04 13:12:25 +00:00
Dmitry Vyukov d1d8653742 tsan: add dynamic library target for standalone deadlock detector
it's LD_PRELOAD-able

llvm-svn: 202843
2014-03-04 12:52:20 +00:00
Sergey Matveev e7b3e4c2ae [msan] Add missing line to getxattr() test.
llvm-svn: 202841
2014-03-04 12:41:18 +00:00
Alexey Samsonov 3e8467b8b9 Avoid doing any work when unwinding stack traces with 0 or 1 frame
llvm-svn: 202837
2014-03-04 12:21:28 +00:00
Dmitry Vyukov 9e3a217adb tsan: fix windows build
llvm-svn: 202831
2014-03-04 11:57:25 +00:00
Dmitry Vyukov 54a0303fa8 tsan: add concurrent hashmap for standalone deadlock detector
llvm-svn: 202826
2014-03-04 11:39:56 +00:00
Dmitry Vyukov e69df1f928 tsan: fix pthread_cond interceptors
currently tsan hangs when linked with a shared library linked against an old version of pthread
this change is another attempt to fix pthread_cond interceptors in different scenarios
see the comment for implementation details

llvm-svn: 202820
2014-03-04 11:11:40 +00:00
Tim Northover d3405cbb5d ARM: fix built-bots trying to use Thumb2 code on armv6m
llvm-svn: 202819
2014-03-04 11:10:58 +00:00
Dmitry Vyukov 975b02ad71 tsan: move all pthread_cond interceptors into sanitizer_common
llvm-svn: 202813
2014-03-04 10:17:40 +00:00
Tim Northover 1683caab3a ARM: implement __sync_fetch_and_* operations
Since these are primarily useful for deeply embedded targets where code size is
very important, they are each in a separate file making use of infrastructure
in sync-ops.h. This allows a linker to include just the functions that are
actually used.

rdar://problem/14736665

llvm-svn: 202812
2014-03-04 10:10:17 +00:00
Alexey Samsonov a7c602ac29 A set of trivial changes to support sanitizers on FreeBSD.
Patch by Viktor Kutuzov!

llvm-svn: 202801
2014-03-04 08:55:41 +00:00
Alexey Samsonov a79696d9bf [CMake] Port add_sanitizer_rt_symbols to CMake 3.0
Patch by Brad King.

Our add_sanitizer_rt_symbols macro reads the LOCATION property of a
library to compute the location of the "lib<name>.a.syms" file to
generate next to the corresponding "lib<name>.a" library file.  CMake
3.0 introduces policy CMP0026 to disallow reading of the LOCATION target
property from non-imported targets in favor of the more powerful
$<TARGET_FILE> generator expression.

Teach add_sanitizer_rt_symbols to use the $<TARGET_FILE> generator
expression to compute the location of the symbols file to generate
with a custom command.  CMake 3.0 also adds support for generator
expressions to install(FILES) so use it when available to simplify
installation of the symbols file of the proper configuration.

llvm-svn: 202797
2014-03-04 08:32:43 +00:00
Alexey Samsonov 72f17afd48 [CMake] Fix add_sanitizer_rt_symbols on multi-config CMake generators.
Patch by Brad King.

When using a multi-config generator with CMake, such as for VS or Xcode,
the LOCATION target property value contains a placeholder such as
"$(Configuration)" that is meant for substitution by the native build
tool. The install(FILES) command does not understand this name and will
not install the symbols file correctly when using these generators.

Teach add_sanitizer_rt_symbols to read the more-specific target property
LOCATION_<CONFIG> that has a per-configuration value and no placeholder.
On single-configuration generators (Makefile, Ninja), CMAKE_BUILD_TYPE
contains the name of the one configuration to be built.  On multi-config
generators (VS, Xcode), CMAKE_CONFIGURATION_TYPES contains the list of
possible configurations.  In the latter case, loop over the configs and
add a configuration-specific install(FILES) rule for each one.

Place the code block inside an if(TRUE) block so it can be made
conditional in a following change without updating indentation.

llvm-svn: 202796
2014-03-04 08:28:43 +00:00
Evgeniy Stepanov 2821fb7d18 [asan] Fix Android configure/make build.
Mirror recent cmake changes in the configure/make build system.

llvm-svn: 202793
2014-03-04 07:17:38 +00:00
Evgeniy Stepanov f7abc8dff6 [msan] Tests for X86 SIMD bitshift intrinsic support.
llvm-svn: 202713
2014-03-03 13:52:36 +00:00
Dmitry Vyukov 530fb9414b tsan: replace deadlock detector custom build script with cmake file
llvm-svn: 202708
2014-03-03 13:15:12 +00:00
Dmitry Vyukov 0df3a5688c tsan: remove autogenerated file
llvm-svn: 202704
2014-03-03 12:46:02 +00:00
Joerg Sonnenberger 7e6a314d7c Move __clzti2 into 128bit fragment.
llvm-svn: 202593
2014-03-01 15:57:30 +00:00
Joerg Sonnenberger 31a6db3eab Avoid type pruning.
llvm-svn: 202592
2014-03-01 15:32:05 +00:00
Joerg Sonnenberger 6e99daab4c Consistently use COMPILER_RT_ABI for all public symbols.
Move prototypes into headers and fix a few inconsistencies.

llvm-svn: 202591
2014-03-01 15:30:50 +00:00
Dmitry Vyukov 512a18e518 tsan: add standalone deadlock detector
llvm-svn: 202505
2014-02-28 14:52:20 +00:00
Dmitry Vyukov 9cffc9550b tsan: allow to force use of __libc_malloc in sanitizer_common
llvm-svn: 202504
2014-02-28 14:46:53 +00:00
Dmitry Vyukov 7210cdd473 tsan: add include guards
llvm-svn: 202503
2014-02-28 14:46:05 +00:00
Dmitry Vyukov 811d16c953 tsan: prevent actual deadlock in deadlock detector test
llvm-svn: 202502
2014-02-28 14:34:25 +00:00
Kostya Serebryany eae464f911 [sanitizer] speedup deadlock detector for the case when we acquire the first lock in a thread
llvm-svn: 202492
2014-02-28 11:56:14 +00:00