Alexey Samsonov
047ea1717b
[TSan] Revert r212531 and r212532.
...
They cause "check-tsan" command to hang. Details in r212532 review thread.
llvm-svn: 212562
2014-07-08 20:17:19 +00:00
Dmitry Vyukov
3f5ad1a98e
tsan: allow memory overlap in __tsan_java_move
...
JVM actually moves memory between overlapping ranges.
llvm-svn: 212560
2014-07-08 20:01:12 +00:00
Evgeniy Stepanov
eb893a1fd6
[msan] Fix out of bounds access in origin copying.
...
llvm-svn: 212534
2014-07-08 14:15:23 +00:00
Kostya Serebryany
6136aae323
[tsan] Enable tsan's deadlock detector by default.
...
The tsan's deadlock detector has been used in Chromium for a while;
it found a few real bugs and reported no false positives.
So, it's time to give it a bit more exposure.
llvm-svn: 212533
2014-07-08 13:40:08 +00:00
Dmitry Vyukov
edbb54d60c
tsan: fix a potential hang
...
idx0 is not updated in the branch,
so if we take that branch idx0 will stay updated forever
llvm-svn: 212532
2014-07-08 13:36:59 +00:00
Dmitry Vyukov
a480d3013a
tsan: fix a bug in metamap
...
The bug happens in the following case:
Mutex is located at heap block beginning,
when we call MutexDestroy, s->next is set to 0,
so free can't find the MBlock related to the block.
llvm-svn: 212531
2014-07-08 13:28:01 +00:00
Kostya Serebryany
3d570b960e
[tsan] fix deadlock detector's interoperation with java locks ( https://code.google.com/p/thread-sanitizer/issues/detail?id=67 )
...
llvm-svn: 212529
2014-07-08 13:16:03 +00:00
Dmitry Vyukov
b0250948c6
tsan: remove unnecessary line split
...
llvm-svn: 212527
2014-07-08 13:07:23 +00:00
Kostya Serebryany
7e49b06446
[tsan] fix pthread_rwlock_tryrdlock interceptor, don't try to detect deadlocks when reporting bad unlock
...
llvm-svn: 212526
2014-07-08 12:46:30 +00:00
Viktor Kutuzov
cc02abbb20
Support building floating-point facilities on FreeBSD 9.2 in 32-bit mode
...
Differential Revision: http://reviews.llvm.org/D3909
llvm-svn: 212518
2014-07-08 08:52:57 +00:00
Alexey Samsonov
58a046fe56
[ASan] Clean up leftovers from assembly instrumentation helpers
...
llvm-svn: 212471
2014-07-07 18:11:24 +00:00
Alexey Samsonov
91bb8e0e3a
Generalize sanitizer allocator public interface.
...
Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).
Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.
llvm-svn: 212469
2014-07-07 17:39:31 +00:00
Timur Iskhodzhanov
575180dbd2
[ASan/Win] Unbreak the build after r211216
...
llvm-svn: 212465
2014-07-07 16:22:04 +00:00
Evgeniy Stepanov
86c077b3a2
[asan] Remove runtime assembly helpers.
...
Remove helper functions that were used in assembly instrumentation.
Patch by Yuri Gorshenin.
llvm-svn: 212456
2014-07-07 13:59:12 +00:00
Evgeniy Stepanov
f0831ee8d2
[msan] Increase hash table size for chained origins.
...
llvm-svn: 212448
2014-07-07 10:45:15 +00:00
Evgeniy Stepanov
037f77092e
[msan] Better hash function for chained origins.
...
llvm-svn: 212440
2014-07-07 08:31:55 +00:00
Evgeniy Stepanov
50498e114f
[msan] Reformat one source file.
...
llvm-svn: 212329
2014-07-04 10:07:39 +00:00
Kostya Serebryany
7c163a44aa
[sanitizer] support c11 aligned_alloc, Linux only for now
...
llvm-svn: 212322
2014-07-04 07:30:34 +00:00
Evgeniy Stepanov
4af9c0ea80
[asan] i686-linux-android support.
...
Large part of this change is required due to
https://code.google.com/p/android/issues/detail?id=61799
dlsym() crashes when symbol resolution fails, which means
we have to limit the interceptor list instead of relying on
runtime detection.
There are minor differencies in system headers, too.
llvm-svn: 212273
2014-07-03 14:20:56 +00:00
Evgeniy Stepanov
7c2d32bf87
[asan] Fix unused variable warning.
...
llvm-svn: 212272
2014-07-03 14:14:59 +00:00
Alexey Samsonov
4f319cca42
[ASan] Print exact source location of global variables in error reports.
...
See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.
Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
1) source location (file/line/column info);
2) whether it is dynamically initialized;
3) whether it is blacklisted (shouldn't be instrumented).
Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:
0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40
These source locations are printed even if the binary doesn't have any
debug info.
This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.
llvm-svn: 212188
2014-07-02 16:54:41 +00:00
Alexey Samsonov
e3a401a12b
[MSan] Fixup r212082: enable tests for _mm_ intrinsics if and only if the
...
unit test source file is compiled with Clang.
llvm-svn: 212121
2014-07-01 19:58:41 +00:00
Alexey Samsonov
06ff6cbf4d
[TSan] Equalize the behavior of __tsan_get_allocated_size and user_alloc_usable_size.
...
The former used to crash with a null deref if it was given a not owned pointer,
while the latter returned 0. Now they both return 0. This is still not the best possible
behavior: it is better to print an error report with a stack trace, pointing
to the error in user code, as we do in ASan.
llvm-svn: 212112
2014-07-01 18:01:20 +00:00
Alexey Samsonov
c0fda339e2
Add the way to disable MSan unit tests for _mm_* intrinsics
...
llvm-svn: 212082
2014-07-01 01:38:52 +00:00
Alexey Samsonov
cffaa1c298
Fix apparent thinko in r209744: allocator stats can be zero
...
llvm-svn: 212071
2014-06-30 22:40:58 +00:00
Evgeniy Stepanov
4e2d5edb0c
[msan] Limit stack origin chain length.
...
Stack origins were created with unlimited length by mistake.
llvm-svn: 212036
2014-06-30 11:22:42 +00:00
Evgeniy Stepanov
c935ca8c3c
[msan] Add store_context_size= flag.
...
A new flag to control stack trace size for store event (in
track-origins=2 mode) independently of malloc_context_size.
llvm-svn: 211896
2014-06-27 12:48:01 +00:00
Evgeniy Stepanov
7d3c68a9cf
[msan] Fix truncated stack trace in chained origin reports.
...
This is a leftover from the times when the next (chained) origin id
was stored as the last frame of a stack trace.
llvm-svn: 211878
2014-06-27 07:32:08 +00:00
Dmitry Vyukov
fb251f51a9
tsan: add __tsan_java_finalize interface function
...
It is required to prevent false positives between object ctor and finalizer,
as otherwise they look completely unsynchronized.
llvm-svn: 211829
2014-06-27 00:47:38 +00:00
Alexander Potapenko
b1b8231c8b
[ASan] When iterating over segments on OSX, treat the segments' initial
...
protection level as their current protection level.
This fixes the UNIMPLEMENTED check that started to fire on OSX after r210649.
llvm-svn: 211713
2014-06-25 15:43:19 +00:00
Evgeniy Stepanov
b163f0276f
[msan] Fix bad interaction between with-calls mode and chained origin tracking.
...
Origin history should only be recorded for uninitialized values, because it is
meaningless otherwise. This change moves __msan_chain_origin to the runtime
library side and makes it conditional on the corresponding shadow value.
Previous code was correct, but _very_ inefficient.
llvm-svn: 211700
2014-06-25 14:41:57 +00:00
Evgeniy Stepanov
0b2d93c4f0
[sanitizer] Fix build on platforms where dtls support is disabled.
...
llvm-svn: 211684
2014-06-25 11:43:46 +00:00
Evgeniy Stepanov
7ad0bde843
[msan] Fix false positive on dynamic tls.
...
Use existing DTLS code in sanitizer_tls_get_addr.{h,cc} to unpoison DTLS
blocks both on allocation and deallocation.
https://code.google.com/p/memory-sanitizer/issues/detail?id=44
llvm-svn: 211683
2014-06-25 11:30:35 +00:00
Daniel Sanders
4dc8a78b04
[asan] adding support of 32-bit address sanitizer for MIPS
...
Summary: The patch supports both the clang cross-compiler and native compiler
Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com>
Test Plan:
Kumar had the following asan test results when compiled on a MIPS board:
Expected Passes : 96
Expected Failures : 2
Unsupported Tests : 84
Unexpected Passes : 4
Unexpected Failures: 19
The list of unexpected failures can be found in the review.
Reviewers: kcc, petarj, dsanders
Reviewed By: kcc
Subscribers: farazs, kcc, llvm-commits
Differential Revision: http://reviews.llvm.org/D4208
llvm-svn: 211587
2014-06-24 12:08:18 +00:00
Evgeniy Stepanov
8717fec9af
[msan] Fix origin copying.
...
Conditions for the first and the last origin value in range were wrong.
llvm-svn: 211585
2014-06-24 11:50:26 +00:00
Evgeniy Stepanov
ad8065f01a
[msan] Print stats even on successful run with atexit=1.
...
llvm-svn: 211574
2014-06-24 09:04:06 +00:00
Dmitry Vyukov
9eaae3d8f6
tsan: fix code formatting
...
llvm-svn: 211429
2014-06-21 02:10:17 +00:00
Saleem Abdulrasool
d0d1638f96
builtins: assembly routines are not static
...
Storage Class 3 is static storage. These symbols need to be marked as external
(storage class 2) so that they can be referenced. Note that this external is
not the same as ELF "external" visibility, which is indicated by DLL Storage
Class (i.e. __declspec(dllexport) or __declspec(dllimport)).
llvm-svn: 211428
2014-06-21 01:41:21 +00:00
Dmitry Vyukov
0eb1c6f2fb
tsan: fix windows build script
...
llvm-svn: 211422
2014-06-20 23:22:31 +00:00
Dmitry Vyukov
73e1804c21
tsan: add Go build script for freebsd
...
llvm-svn: 211419
2014-06-20 22:53:43 +00:00
Dmitry Vyukov
b820599a3a
tsan: port to freebsd
...
llvm-svn: 211418
2014-06-20 22:51:18 +00:00
Dmitry Vyukov
f9c22916d5
tsan: fix freebsd build
...
freebsd does not have /proc/self/environ
llvm-svn: 211417
2014-06-20 22:49:41 +00:00
Dmitry Vyukov
d84ce00f75
tsan: remove unused header include
...
llvm-svn: 211389
2014-06-20 18:56:11 +00:00
Dmitry Vyukov
5c4a3d3118
tsan: remove unused header include
...
llvm-svn: 211386
2014-06-20 18:30:06 +00:00
Dmitry Vyukov
3fc095e031
tsan: remove unused header include
...
llvm-svn: 211385
2014-06-20 18:28:34 +00:00
Kostya Serebryany
cd60ed53f6
[asan] when reporting an ODR violation, also print the stack traces where the globals have been registered (thus show the name of shared library or exe to which the global belongs). The reports become a bit too verbose but I do not see any *simple* way to make them more compact. This should be especially helpful when the ODR happens because the same .cc file is used twice in the project in differend DSOs
...
llvm-svn: 211343
2014-06-20 08:24:12 +00:00
Joerg Sonnenberger
61d5d38e80
Provide mul for IEEE quad. From GuanHong Liu.
...
Differential Revision: http://reviews.llvm.org/D2799
llvm-svn: 211313
2014-06-19 20:34:03 +00:00
Joerg Sonnenberger
361519f409
Provide add and sub for IEEE quad. From GuanHong Liu.
...
Differential Revision: http://reviews.llvm.org/D2798
llvm-svn: 211312
2014-06-19 20:24:49 +00:00
Evgeniy Stepanov
a2327c3a65
[sanitizer] Intercept pthread_*attr_get*.
...
This is a resubmit of r211166 reverted due to osx breakage.
llvm-svn: 211264
2014-06-19 10:19:57 +00:00
Arnold Schwaighofer
868050a667
Revert "[sanitizer] Intercept pthread_*attr_get*."
...
This reverts commit r211166. It broke public mac os x bots.
llvm-svn: 211206
2014-06-18 19:04:47 +00:00
Evgeniy Stepanov
b87f1efc5f
[sanitizer] Intercept pthread_*attr_get*.
...
llvm-svn: 211166
2014-06-18 14:16:41 +00:00
Evgeniy Stepanov
2c27df9a33
[msan] Intercept __getdelim.
...
llvm-svn: 211162
2014-06-18 13:35:13 +00:00
Evgeniy Stepanov
4ea1647e8b
[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
...
llvm-svn: 211156
2014-06-18 12:02:29 +00:00
Alexander Potapenko
853a232e66
[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=321 for time() and frexp()
...
Add a test for the frexp() interceptor.
Annotate the interceptors that may potentially corrupt stack IDs of freed buffers with FIXME comments.
llvm-svn: 211153
2014-06-18 09:27:40 +00:00
Saleem Abdulrasool
8f2efc3a91
builtins: add it blocks for Thumb-2
...
Add the missing IT-blocks for Thumb-2 compilation for code paths exercised by
older ARM CPUs. This should fix the buildbots.
llvm-svn: 211035
2014-06-16 16:36:25 +00:00
Saleem Abdulrasool
1b8f1a4430
compiler-rt: prefer thumb over ARM
...
When possible, use Thumb or Thumb-2 over ARM instructions. This is particularly
important for pure-Thumb environments (e.g. Windows on ARM). Although, it is
possible to conditionalise this for that target specifically, this is available
on most newer ARM CPUs, and the code remains compatible with older CPUs with no
adverse effects. It therefore feels better to always prefer Thumb when
possible.
llvm-svn: 211032
2014-06-16 16:05:24 +00:00
Dan Albert
1236ac388d
Swap getdtablesize() for sysconf(_SC_OPEN_MAX).
...
Bionic is no removing this as it was removed from POSIX 2004.
llvm-svn: 211027
2014-06-16 14:51:11 +00:00
Sergey Matveev
998d991b2d
[sanitizer] Support PTRACE_GETEVENTMSG in the ptrace() interceptor.
...
llvm-svn: 211022
2014-06-16 13:49:13 +00:00
Kostya Serebryany
9f5d48c0a0
[asan] initialze varaibles to avoid a (false positive) report from gcc's -Wmaybe-uninitialized
...
llvm-svn: 211008
2014-06-16 08:32:02 +00:00
Viktor Kutuzov
9101af0612
Fix building InstrProfilingFile.c on FreeBSD
...
llvm-svn: 210989
2014-06-15 14:01:18 +00:00
Viktor Kutuzov
1f386f0f36
Fix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode
...
llvm-svn: 210988
2014-06-15 13:56:28 +00:00
Dan Albert
1c71fde161
Exclude Android from the tests for valloc/pvalloc.
...
These functions are being removed from Android because they were removed
from POSIX 2004.
llvm-svn: 210962
2014-06-14 00:50:03 +00:00
Alexey Samsonov
e287ef847a
[Sanitizer] Merge AnsiColorDecorator and SanitizerCommonDecorator, use the latter in UBSan
...
llvm-svn: 210959
2014-06-13 23:46:37 +00:00
Alexey Samsonov
3e61c52352
[UBSan] Respect runtime flag for colorizing reports
...
llvm-svn: 210950
2014-06-13 22:48:40 +00:00
Evgeniy Stepanov
dfa5439652
[asan] Fix mmap-ed coverage with coverage=0.
...
llvm-svn: 210655
2014-06-11 15:11:26 +00:00
Evgeniy Stepanov
b2b4c3ab32
[asan] Exclude non-executable mappings from coverage.
...
llvm-svn: 210649
2014-06-11 10:11:51 +00:00
Evgeniy Stepanov
9cc3ebdd3b
[sanitizer] Relax sanity checks in ioctl decoding.
...
Standard KVM ioctls don't pass currect ioctl_decode().
llvm-svn: 210533
2014-06-10 13:54:15 +00:00
Evgeniy Stepanov
9959915890
[msan] Intercept __strto*_internal.
...
This should fix strtoimax/strtoumax on newer glibc.
https://code.google.com/p/memory-sanitizer/issues/detail?id=36
llvm-svn: 210463
2014-06-09 10:41:22 +00:00
Evgeniy Stepanov
66c6a18d39
[msan] Add a test for mmx.packuswb.
...
llvm-svn: 210458
2014-06-09 08:58:41 +00:00
Evgeniy Stepanov
aaaf74f9fb
[msan] Simplify tests.
...
llvm-svn: 210457
2014-06-09 08:57:40 +00:00
Evgeniy Stepanov
63ece03c57
[asan] Add malloc_usable_size to android malloc dispatch.
...
llvm-svn: 210452
2014-06-09 08:36:14 +00:00
Dmitry Vyukov
9ff85e9674
tsan: fix argument passing in Go interface
...
Go calling convention does not support bools (it probably works, but uptrs are safer)
llvm-svn: 210365
2014-06-06 18:53:52 +00:00
Dmitry Vyukov
13793e5121
tsan: fix CurrentStackId
...
FuncEnter adds FuncEnter entry to trace that nobody removes later
llvm-svn: 210359
2014-06-06 18:05:12 +00:00
Dmitry Vyukov
d858fa77d6
tsan: fix mutex in Go mode
...
In Go it's legal to unlock from a different goroutine.
llvm-svn: 210358
2014-06-06 18:04:05 +00:00
Dmitry Vyukov
fc9b5d67a6
tsan: disable reporting of mutex misuses in Go
...
llvm-svn: 210353
2014-06-06 17:23:27 +00:00
Dmitry Vyukov
9546afec62
tsan: minor optimizations for Go runtime
...
llvm-svn: 210351
2014-06-06 16:06:19 +00:00
Dmitry Vyukov
75f5cf657e
tsan: fix out-of-bounds access in Go runtime
...
FuncEntry can resize the shadow stack, while "thr->shadow_stack_pos[0] = pc" writes out-of-bounds.
llvm-svn: 210349
2014-06-06 15:56:08 +00:00
Dmitry Vyukov
32336152af
tsan: fix mapping of meta shadow for Go
...
Go maps heap and data+bss, these regions are not adjacent.
data+bss is mapped first.
llvm-svn: 210348
2014-06-06 15:54:49 +00:00
Dmitry Vyukov
ff194daead
tsan: flush metamap per-thread cache when thread finishes
...
llvm-svn: 210347
2014-06-06 15:52:10 +00:00
Dmitry Vyukov
feb4ede8ac
tsan: fix clang warning:
...
comparison of unsigned expression >= 0 is always true
llvm-svn: 210346
2014-06-06 15:51:20 +00:00
Dmitry Vyukov
4f6de1d684
tsan: fix Go build with TSAN_COLLECT_STATS
...
Go does not have cur_thread function.
llvm-svn: 210345
2014-06-06 15:50:29 +00:00
Dmitry Vyukov
8744b1c1e3
tsan: allow to build Go runtime with clang + enable SSE3
...
llvm-svn: 210344
2014-06-06 15:49:49 +00:00
Evgeniy Stepanov
ee98fb197b
[msan] Fix wrong endianness when printing shadow.
...
llvm-svn: 210335
2014-06-06 14:06:14 +00:00
Evgeniy Stepanov
3e810b01c3
[msan] Partial revert of r210331.
...
Bots did not like it.
llvm-svn: 210332
2014-06-06 13:35:25 +00:00
Evgeniy Stepanov
9438bf1f62
[msan] Better diagnostic for invalid origin id.
...
llvm-svn: 210331
2014-06-06 12:58:44 +00:00
Dmitry Vyukov
909b7490a3
sanitizer: document missing macro
...
llvm-svn: 210329
2014-06-06 12:16:26 +00:00
Evgeniy Stepanov
e5c34ace7f
[asan] Make ReplaceSystemMalloc optional on Android.
...
Don't fail if __libc_malloc_dispatch is missing; continue running
with normal linux interceptors instead.
llvm-svn: 210322
2014-06-06 10:57:21 +00:00
Kostya Serebryany
558b3363a7
[asan] initialize fake_stack_ to 0 before we call SetThreadStackAndTls, because that may actually try to use fake_stack_ (still don't know how). Yet another case where we desperately want https://sourceware.org/glibc/wiki/ThreadPropertiesAPI
...
llvm-svn: 210315
2014-06-06 07:35:35 +00:00
Alexey Samsonov
f251e0051c
[TSan] Reduce the stack frame size of ReportDeadlock
...
llvm-svn: 210301
2014-06-05 23:24:46 +00:00
Evgeniy Stepanov
38c228a842
[asancov] Faster coverage in memory-mapped mode.
...
Use caller pc of __sanitizer_cov_module_init to figure out
when 2 sequential calls are from the same module; skip
.sancov.map file update in this case.
llvm-svn: 210267
2014-06-05 14:38:53 +00:00
Evgeniy Stepanov
57eba53a01
[asan] asan_device_setup: extend search path
...
In standalone build asan-rt is stored in yet another path.
llvm-svn: 210259
2014-06-05 12:49:35 +00:00
Evgeniy Stepanov
3641cd43b2
[asan] Use -pthread instead of -lpthread in tests.
...
llvm-svn: 210255
2014-06-05 12:22:37 +00:00
Dan Albert
f4239c7707
Remove's uses of sys/timeb.h for Android.
...
Android is removing sys/timeb.h because it was removed in POSIX 2008.
llvm-svn: 210235
2014-06-05 02:00:24 +00:00
Alexey Samsonov
1c9a921a04
[Deadlock detector] Fix CMake build rules for shared runtime
...
llvm-svn: 210232
2014-06-05 00:58:28 +00:00
Greg Fitzgerald
a1b620051f
[asan] Add install rule for Android runtime
...
llvm-svn: 210216
2014-06-04 21:05:01 +00:00
Peter Collingbourne
8501e39a85
[dfsan] Fix the declaration of dfsan_add_label.
...
llvm-svn: 210202
2014-06-04 17:54:51 +00:00
Sergey Matveev
dcd9bba602
[sanitizer] Make LSan/MSan/TSan honor the "color" flag.
...
Based on a patch by Stephan Bergmann.
llvm-svn: 210199
2014-06-04 16:57:03 +00:00
Evgeniy Stepanov
fe18102649
[sancov] Handle fork.
...
Reset coverage data on fork().
For memory-mapped mode (coverage_direct=1) this helps avoid loss of data
(before this change two processes would write to the same file simultaneously).
For normal mode, this reduces coverage dump size, because PCs from the parent
process are no longer inherited by the child.
llvm-svn: 210180
2014-06-04 12:13:54 +00:00
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
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
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
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
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
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
Timur Iskhodzhanov
82ee0433da
[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows-only tests explicitly use clang-cl.
...
Reviewed at http://reviews.llvm.org/D3893
llvm-svn: 209719
2014-05-28 08:38:13 +00:00
Evgeniy Stepanov
d74bdccafe
[asan] Add a dll thunk for __sanitizer_cov_module_init.
...
llvm-svn: 209718
2014-05-28 08:34:53 +00:00
Evgeniy Stepanov
a00ff194b7
[asan] Add a few stubs to fix windows build.
...
llvm-svn: 209717
2014-05-28 08:26:24 +00:00
Evgeniy Stepanov
de9467593a
[tsan] Fix tsango build.
...
llvm-svn: 209658
2014-05-27 14:18:43 +00:00
Evgeniy Stepanov
360c911872
[asan] Disable dlopen interceptor on Android.
...
It can not work, as libdl is always first in the lookup order,
even ahead of LD_PRELOAD-ed libraries.
llvm-svn: 209657
2014-05-27 14:14:03 +00:00
Evgeniy Stepanov
567e516015
[asancov] Write coverage directly to a memory-mapped file.
...
This way does not require a __sanitizer_cov_dump() call. That's
important on Android, where apps can be killed at arbitrary time.
We write raw PCs to disk instead of module offsets; we also write
memory layout to a separate file. This increases dump size by the
factor of 2 on 64-bit systems.
llvm-svn: 209653
2014-05-27 12:37:52 +00:00
Greg Fitzgerald
7b15cf8884
On AArch64, use clone() instead of fork()
...
Patch by Gideon Billings.
Differential Revision: http://reviews.llvm.org/D3903
llvm-svn: 209641
2014-05-26 23:44:55 +00:00
Sergey Matveev
a531058d2b
[MSan] Implement __sanitizer_print_stack_trace().
...
llvm-svn: 209625
2014-05-26 13:08:08 +00:00
Sergey Matveev
2be4a28297
[sanitizer] Make stack traces from dlclose()'d modules more meaningful.
...
Previously, they silently omitted PCs belonging to unknown modules. Now we print
(<unknown module>) instead.
llvm-svn: 209522
2014-05-23 16:04:41 +00:00
Kostya Serebryany
a72efdff9e
[ubsan] handle long double in 32-bit mode; part of the patch by Marek Polacek
...
llvm-svn: 209516
2014-05-23 14:45:13 +00:00
Kostya Serebryany
e1e9a4e2ec
[asan] fix a test following r209508
...
llvm-svn: 209509
2014-05-23 11:52:38 +00:00
Alexey Samsonov
958a59b777
[TSan] ifdef out certain functions if 128-bit ints are not supported.
...
llvm-svn: 209476
2014-05-22 22:02:38 +00:00