Commit Graph

4221 Commits

Author SHA1 Message Date
Evgeniy Stepanov ce98452516 [sancov] Delay opening dump file until the first module constructor.
llvm-svn: 210109
2014-06-03 15:27:15 +00:00
Evgeniy Stepanov 937afa1fbb [sancov] Handle spaces in module name.
llvm-svn: 210108
2014-06-03 15:25:43 +00:00
Kostya Serebryany 7d4fc2c6a7 [asan] enable detect_odr_violation=2; https://code.google.com/p/address-sanitizer/wiki/OneDefinitionRuleViolation . This feature has been working quite well so far, found a few bugs and zero false positives. The main problem is that there could be lots of true positives and users will have to disable this checking until the bugs are fixed.
llvm-svn: 210106
2014-06-03 15:06:13 +00:00
Evgeniy Stepanov bb2fc7e4bb [sancov] Fix map update logic on Android.
dlopen()/dlclose() are not interceptable on Android,
so we update .sancov.map in module constructor callbacks.

llvm-svn: 210098
2014-06-03 12:15:43 +00:00
Greg Fitzgerald 796fba4cd9 Fix Android build after r210053
llvm-svn: 210069
2014-06-03 04:29:46 +00:00
Greg Fitzgerald 0f7f731966 Cleanup Android build and provide better diagnostics
No longer need to set ANDROID if COMPILER_RT_TEST_TARGET_TRIPLE is
arm-linux-androideabi.

No need to set ANDROID_COMMON_FLAGS.  These flags are already in
CMAKE_CXX_FLAGS which are used in try_compile().

llvm-svn: 210053
2014-06-02 23:11:24 +00:00
Timur Iskhodzhanov b1415c46fb [ASan Win] Manually call __asan_init early in the DLL initialization process to avoid a null function call in cout/cerr constructors
llvm-svn: 210030
2014-06-02 14:40:07 +00:00
Timur Iskhodzhanov cbee13e04c [Sanitizer/interception Win] Break into the debugger on unknown instructions
llvm-svn: 210028
2014-06-02 13:40:41 +00:00
Timur Iskhodzhanov 51fadc387a [ASan Win] Fix memset interception in DLLs
llvm-svn: 210027
2014-06-02 13:23:42 +00:00
Evgeniy Stepanov 96f8edc720 [asan] Default to memory-mapped coverage on Android.
The alternative (writing coverage at process exit) is nearly useless there.

llvm-svn: 210024
2014-06-02 13:06:33 +00:00
Evgeniy Stepanov d425a2b169 [msan] Handle x86 vector pack intrinsics.
llvm-svn: 210020
2014-06-02 12:31:44 +00:00
Kostya Serebryany 5181dd3a56 [asan] Improve vDSO check in AsanCheckDynamicRTPrereqs; patch by Yuri Gribov
llvm-svn: 210012
2014-06-02 10:39:40 +00:00
Evgeniy Stepanov 2fcc427741 [sancov] Remove debug leftovers and update usage text.
llvm-svn: 210009
2014-06-02 09:04:45 +00:00
Saleem Abdulrasool 2fd910dc72 compiler-rt: prefer .rodata for non MachO targets
Place constants into .rdata if targeting ELF or COFF/PE.  This should be
functionally identical, however, the data would be placed into a different
section.  This is purely a cleanup change.

llvm-svn: 209986
2014-06-01 04:07:07 +00:00
Saleem Abdulrasool 57aa97f53a compiler-rt: whitespace and uniformity for arm
Make the whitespace a bit more uniform in the various assembly routines.  This
also makes the assembly files a bit more uniform on the ARM side by explicitly
stating that it is using the unified syntax and that the contents of the code is
in the text section (or segment).  No functional change.

llvm-svn: 209985
2014-06-01 04:07:03 +00:00
Alexey Samsonov 5c8ce21a6c [TSan] Add a test case for r209939
llvm-svn: 209940
2014-05-31 00:12:20 +00:00
Greg Fitzgerald 52f61086ab Disable stack-overflow test on ARM
llvm-svn: 209925
2014-05-30 22:44:35 +00:00
Dmitry Vyukov dee68ba6e3 tsan: add a test from data-race-test suite:
https://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc

llvm-svn: 209900
2014-05-30 14:27:31 +00:00
Dmitry Vyukov 233f401c2b tsan: make positive tests more robust
Add a script that is used to deflake inherently flaky tsan tests.
It is invoked from lit tests as:
%deflake %run %t
The script runs the target program up to 10 times,
until it produces a tsan warning.

llvm-svn: 209898
2014-05-30 14:08:51 +00:00
Dmitry Vyukov afdcc96d9f tsan: optimize memory access functions
The optimization is two-fold:
First, the algorithm now uses SSE instructions to
handle all 4 shadow slots at once. This makes processing
faster.
Second, if shadow contains the same access, we do not
store the event into trace. This increases effective
trace size, that is, tsan can remember up to 10x more
previous memory accesses.

Perofrmance impact:
Before:
[       OK ] DISABLED_BENCH.Mop8Read (2461 ms)
[       OK ] DISABLED_BENCH.Mop8Write (1836 ms)
After:
[       OK ] DISABLED_BENCH.Mop8Read (1204 ms)
[       OK ] DISABLED_BENCH.Mop8Write (976 ms)
But this measures only fast-path.
On large real applications the speedup is ~20%.

Trace size impact:
On app1:
Memory accesses                   :       1163265870
  Including same                  :        791312905 (68%)
on app2:
Memory accesses                   :        166875345
  Including same                  :        150449689 (90%)
90% of filtered events means that trace size is effectively 10x larger.

llvm-svn: 209897
2014-05-30 13:36:29 +00:00
Timur Iskhodzhanov 1b42b81549 [Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake variable
Reviewed at http://reviews.llvm.org/D3952

llvm-svn: 209889
2014-05-30 12:42:57 +00:00
Timur Iskhodzhanov 8f655fc0fb [ASan Win] Fix a couple of warnings in tests and enable -WX
llvm-svn: 209887
2014-05-30 11:58:32 +00:00
Joerg Sonnenberger 9ed1beb20a Implement __divtf3 for IEEE quad precision.
Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D2800

llvm-svn: 209886
2014-05-30 11:08:18 +00:00
Evgeniy Stepanov 3a0486b1e9 [sanitizer] Fix build on ARM.
llvm-svn: 209884
2014-05-30 10:50:17 +00:00
Timur Iskhodzhanov 5bed4206c8 [ASan Win] DLL thunk: make each INTERFACE_FUNCTION unique to prevent ICF linker optimizations
llvm-svn: 209881
2014-05-30 09:01:17 +00:00
Evgeniy Stepanov dd7cb28572 [asan] Enable ASan on PowerPC.
Patch by Peter Bergner.

llvm-svn: 209879
2014-05-30 08:52:03 +00:00
Greg Fitzgerald 1316a0e0e0 Mark currently failing ARM tests with XFAIL.
Differential Revision: http://reviews.llvm.org/D3857

llvm-svn: 209862
2014-05-29 23:34:47 +00:00
Greg Fitzgerald c5fd7305cb Mark unstable tests as Unsupported on ARM
This is half the patch from: http://reviews.llvm.org/D3857

It lets us get deterministic results from the rest of the test suite.

llvm-svn: 209861
2014-05-29 23:34:39 +00:00
Greg Fitzgerald 11b49c3818 light up sanitizers for ARM, take 2
Differential Revision: http://reviews.llvm.org/D3794

llvm-svn: 209856
2014-05-29 22:38:13 +00:00
Greg Fitzgerald c1146ec5ba Revert "light up sanitizers for ARM"
This commit broke the Windows build, where CMAKE_C_COMPILER can
compile and link with -march=armv7-a but the just-built-clang
cannot.

llvm-svn: 209851
2014-05-29 21:33:36 +00:00
Greg Fitzgerald 32685ec5fd light up sanitizers for ARM
You can expect the sanitizers to be built under any of the following conditions:

1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM
2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target)
3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot

Differential Revision: http://reviews.llvm.org/D3794

llvm-svn: 209835
2014-05-29 19:01:32 +00:00
Evgeniy Stepanov 50c1532a1a [sanitizer] Update flags test.
llvm-svn: 209818
2014-05-29 14:55:12 +00:00
Evgeniy Stepanov fa5c0750f0 [sanitizer] Add coverage_dir flag.
llvm-svn: 209815
2014-05-29 14:33:16 +00:00
Evgeniy Stepanov a0aa0f41d1 [sanitizer] Require that options end with '='.
llvm-svn: 209814
2014-05-29 14:32:32 +00:00
Dmitry Vyukov 65dce1e4f7 tsan: write memory profile in one line (which is much more readable)
e.g.:
RSS 420 MB: shadow:35 meta:231 file:2 mmap:129 trace:19 heap:0 other:0 nthr=1/31
RSS 365 MB: shadow:3 meta:231 file:2 mmap:106 trace:19 heap:0 other:0 nthr=1/31
RSS 429 MB: shadow:23 meta:234 file:2 mmap:143 trace:19 heap:6 other:0 nthr=1/31
RSS 509 MB: shadow:78 meta:241 file:2 mmap:147 trace:19 heap:19 other:0 nthr=1/31

llvm-svn: 209813
2014-05-29 14:11:38 +00:00
Dmitry Vyukov ef5f26bf19 tsan: allow to write memory profile to stdout/stderr
llvm-svn: 209811
2014-05-29 14:02:06 +00:00
Dmitry Vyukov bde4c9c773 tsan: refactor storage of meta information for heap blocks and sync objects
The new storage (MetaMap) is based on direct shadow (instead of a hashmap + per-block lists).
This solves a number of problems:
 - eliminates quadratic behaviour in SyncTab::GetAndLock (https://code.google.com/p/thread-sanitizer/issues/detail?id=26)
 - eliminates contention in SyncTab
 - eliminates contention in internal allocator during allocation of sync objects
 - removes a bunch of ad-hoc code in java interface
 - reduces java shadow from 2x to 1/2x
 - allows to memorize heap block meta info for Java and Go
 - allows to cleanup sync object meta info for Go
 - which in turn enabled deadlock detector for Go

llvm-svn: 209810
2014-05-29 13:50:54 +00:00
Timur Iskhodzhanov 9e44e590d5 [ASan Win tests] Add a couple more memcpy/memset tests
llvm-svn: 209806
2014-05-29 12:15:17 +00:00
Viktor Kutuzov 9cd9b4ce0c Support getting executable's name for sanitizers needs on FreeBSD
llvm-svn: 209805
2014-05-29 12:12:42 +00:00
Viktor Kutuzov 76d35f47d3 Fix building 32-bit common sanitizer tests on FreeBSD 9.2
llvm-svn: 209804
2014-05-29 11:35:05 +00:00
Joerg Sonnenberger fee19280b8 Add __extenddftf2 and __extendsftf2 for IEEE quad precision.
Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D2802

llvm-svn: 209783
2014-05-29 01:00:39 +00:00
Joerg Sonnenberger 5038cb2963 Implement __trunctfdf2 and __trunctfsf2 for IEEE quad precision.
Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D2803

llvm-svn: 209782
2014-05-29 00:58:27 +00:00
Joerg Sonnenberger 7610e8c822 Refactor extendsfdf2.
Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D3887

llvm-svn: 209781
2014-05-29 00:54:26 +00:00
Joerg Sonnenberger 304a36b5fc Refactor truncdfsf2.
Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D3888

llvm-svn: 209779
2014-05-29 00:49:57 +00:00
Greg Fitzgerald cd1a131c61 Moved the builtins documentation to lib/builtins/
And fixed typos in the ASan readme.

Differential Revision: http://reviews.llvm.org/D3927

llvm-svn: 209778
2014-05-28 23:09:45 +00:00
Alexey Samsonov 5bcd1d8a8f [Sanitizer] Always prefer cached contents of /proc/self/exe if it's available
llvm-svn: 209773
2014-05-28 21:23:53 +00:00
Dmitry Vyukov a43e98cc74 tsan: refactor suppressions machinery
The refactoring makes suppressions more flexible
and allow to suppress based on arbitrary number of stacks.
In particular it fixes:
https://code.google.com/p/thread-sanitizer/issues/detail?id=64
"Make it possible to suppress deadlock reports by any stack (not just first)"

llvm-svn: 209757
2014-05-28 18:03:32 +00:00
Dmitry Vyukov 5864ac39ee tsan: do not use 64-bit atomics in allocator code
64-bit atomics make porting of asan to 32-bits platforms problematic.

llvm-svn: 209744
2014-05-28 15:22:12 +00:00
Joerg Sonnenberger 6269913bdd Refactor muldf3 and mulsf3.
Patch from: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D3886

llvm-svn: 209741
2014-05-28 15:08:05 +00:00
Joerg Sonnenberger d21cd147d0 Refactor addsf3.c and adddf3.c.
Differential Revision: http://reviews.llvm.org/D3885

llvm-svn: 209740
2014-05-28 15:06:25 +00:00