Timur Iskhodzhanov
cb5bf58f3d
[ASan/Win] Add SEH handling to the DLL thunk as well
...
llvm-svn: 213656
2014-07-22 14:02:53 +00:00
Timur Iskhodzhanov
6d4a6cd68f
[ASan/Win] Handle SEH exceptions (best-effort, similar to longjmp)
...
llvm-svn: 213654
2014-07-22 13:44:18 +00:00
Timur Iskhodzhanov
f2b96e3009
[ASan/Win] Add handling of C++ exceptions to the RTL
...
Also add a longjmp() test
llvm-svn: 213649
2014-07-22 12:37:51 +00:00
Alexey Samsonov
d6906e4ffe
[MSan] Fix strncpy interceptor
...
llvm-svn: 213590
2014-07-22 00:10:08 +00:00
Alexey Samsonov
a89ad664b1
[ASan] Fix __asan_describe_address and add a test for it.
...
llvm-svn: 213583
2014-07-21 21:33:46 +00:00
Alexey Samsonov
4532489752
Adjust gen_dynamic_list for PowerPC function descriptors
...
llvm-svn: 213577
2014-07-21 19:01:03 +00:00
Joerg Sonnenberger
9720fcf4bf
Redo THUMB support.
...
Discussed with and tested by: Saleem Abdulrasool
llvm-svn: 213481
2014-07-20 20:53:37 +00:00
Joerg Sonnenberger
8f6cf7085a
Revert r213467, it breaks non-thumb mode.
...
llvm-svn: 213479
2014-07-20 20:00:26 +00:00
Saleem Abdulrasool
8817bfe7e2
ARM: fix division in some cases
...
For ARM cores that are ARMv6T2+ but not ARMv7ve or ARMv7-r and not an updated
ARMv7-a that has the idiv extension (chips with clz but not idiv), an incorrect
jump would be calculated due to the preference to thumb instructions over ARM.
Rather than computing the target at runtime, use a jumptable instead. This
trades a bit of storage for performance. The overhead is 32-bytes for each of
the three routines, but avoid the calculation of the offset.
Because clz was introduced in ARMv6T2 and idiv in certain versions of ARMv7,
the non-clz, non-idiv case implies a target which does not support Thumb-2, and
thus we cannot use Thumb on those targets (as it is unlikely that the assembly
will assemble).
Take the opportunity to refactor the IT block macros into assembly.h rather than
redefining them in the TUs where they are used.
Existing tests cover the full change already, so no new tests are added.
This effectively reverts SVN r213309.
llvm-svn: 213467
2014-07-20 04:44:21 +00:00
Dmitry Vyukov
9cf7ac7589
tsan: fix Go runtime build with clang
...
llvm-svn: 213384
2014-07-18 15:32:22 +00:00
Dmitry Vyukov
a8df247f5a
tsan: expose atomic operations in Go runtime
...
llvm-svn: 213382
2014-07-18 14:54:02 +00:00
Viktor Kutuzov
5f5adb8ed5
Add FreeBSD support to the Asan symbolization script
...
Differential Revision: http://reviews.llvm.org/D4560
llvm-svn: 213370
2014-07-18 12:07:00 +00:00
Stephen Hines
31a38cc32f
Revert Thumb-2 conversion of some ARM builtins.
...
The udivmodsi4/modsi3/umodsi3 code computes jump targets based on ARM encodings
(if CLZ is present and IDIV is not present).
Reverts parts of r211032 and r211035.
llvm-svn: 213309
2014-07-17 20:41:01 +00:00
Evgeniy Stepanov
92d20f3f90
[asan] Remove leftover debug printf.
...
llvm-svn: 213264
2014-07-17 13:05:21 +00:00
Evgeniy Stepanov
f62cd5559e
[asan] Fix malloc interception on Android L Preview.
...
Format of __libc_malloc_dispatch has changed in Android L.
While we are moving towards a solution that does not depend on bionic
internals, here is something to support both K* and L releases.
llvm-svn: 213263
2014-07-17 12:48:45 +00:00
Kuba Brecka
033890cd0a
[compiler-rt] [asan] Refactor DescribeAddressIfStack to allow reuse for debugging API
...
Refactoring the DescribeAddressIfStack function in asan_report.cc to be able to reuse it for http://reviews.llvm.org/D4527 .
Reviewed at http://reviews.llvm.org/D4545 .
llvm-svn: 213215
2014-07-17 00:18:03 +00:00
Timur Iskhodzhanov
bdf23a51b1
[ASan/Win] Handle situations when the client app has used DbgHelp before
...
Reviewed at http://reviews.llvm.org/D4533
llvm-svn: 213151
2014-07-16 14:11:02 +00:00
Alexander Potapenko
9c62a6d8a2
[ASan] Factor out SymbolizationLoop.process_line() function to let Python
...
scripts that import asan_symbolize to symbolize their reports line by line.
llvm-svn: 213136
2014-07-16 11:00:16 +00:00
Kuba Brecka
58f44dce96
[ASan] Add ASan debugging API to get malloc/free stack traces and shadow memory mapping info
...
Reviewed at http://reviews.llvm.org/D4466
llvm-svn: 213080
2014-07-15 17:33:23 +00:00
Dmitry Vyukov
1015f8d753
tsan: remove special handling of false reports coming from JVM
...
There is now a more common functionality in the form of called_from_lib suppressions.
llvm-svn: 213057
2014-07-15 09:38:30 +00:00
Dmitry Vyukov
48b00fe8f9
tsan: remove compat mapping
...
There are no known usages anymore, so one less thing to support.
llvm-svn: 213056
2014-07-15 09:31:29 +00:00
Timur Iskhodzhanov
9e4580c8ee
[ASan] Only define macros in asan_init_version.h, move the __asan_init declaration back to asan_interface_internal.h
...
This fixes the issues we've uncovered after landing r212815.
Reviewed at http://reviews.llvm.org/D4500
llvm-svn: 213053
2014-07-15 08:16:04 +00:00
Ehsan Akhgari
911ea4e2be
Add support for intercepting thunks of the form
...
llvm-svn: 212979
2014-07-14 20:28:21 +00:00
Evgeniy Stepanov
d73e7cc879
[sanitizer] Intercept getpass.
...
llvm-svn: 212937
2014-07-14 13:07:51 +00:00
Evgeniy Stepanov
465466e80c
[msan] Stop demangling function name in the stack origin report.
...
This was done by calling __cxa_demangle directly, which is bad
when c++abi library is instrumented. The following line always
contains the demangled name (when running with a symbolizer) anyway.
llvm-svn: 212929
2014-07-14 09:35:27 +00:00
Alexey Samsonov
ae9d59e8c4
[ASan] Improve ODR-violation error reports.
...
Demangle names of involved globals. Print a more consistent summary line.
llvm-svn: 212857
2014-07-11 23:34:26 +00:00
Kostya Serebryany
8e9a5b1899
[asan] fix x32 build, patch by H.J. Lu
...
llvm-svn: 212823
2014-07-11 15:22:45 +00:00
Timur Iskhodzhanov
03f1e408de
[ASan/Win] Don't apply dllexport to __asan_init in the DLL thunk
...
This fixes '___asan_init_v4 already defined' errors when linking some of Chromium DLLs.
Looks like one of the DLL is using a .lib produced while linking another DLL and it exploded after r212699.
I'm trying to come up with a small testcase...
llvm-svn: 212815
2014-07-11 13:46:05 +00:00
Timur Iskhodzhanov
f6827cef73
[ASan] Print register values in a consistent way
...
llvm-svn: 212809
2014-07-11 12:14:46 +00:00
Timur Iskhodzhanov
19853dd28c
[ASan/Win] Catch NULL derefs and page faults
...
Reviewed at http://reviews.llvm.org/D4471
llvm-svn: 212807
2014-07-11 11:57:41 +00:00
Evgeniy Stepanov
9c62621c4b
[msan] A comment for the chained-origin-depot hash function.
...
llvm-svn: 212801
2014-07-11 09:09:37 +00:00
Evgeniy Stepanov
db298121e0
[msan] Use real memset/memcpy/memmove in interceptors.
...
Our versions are not exactly as fast as libc's, and
MSan uses them heavily (even compared to other sanitizers).
This will break if libc version of mem* are instrumented,
but they never are, and if they are, we should be able
to fix it on libc side.
llvm-svn: 212799
2014-07-11 08:57:57 +00:00
Alexey Samsonov
3a2cb3ad41
[TSan] Fix a bug in libcxx-tsan build conditions spotted by Ryuta Suzuki
...
llvm-svn: 212749
2014-07-10 18:17:51 +00:00
Evgeniy Stepanov
8fc7e1fb13
[msan] Fix performance issue in fast_memset.
...
Fast path was never triggered when called from __msan_poison.
llvm-svn: 212715
2014-07-10 12:45:56 +00:00
Evgeniy Stepanov
c2c435f95d
[msan] Switch chained origins hash to murmur2.
...
llvm-svn: 212704
2014-07-10 11:02:33 +00:00
Timur Iskhodzhanov
3eb1f4bb90
[ASan/Win] Don't hardcode ASan runtime version in ASan dll thunk
...
Reviewed at http://reviews.llvm.org/D4459
llvm-svn: 212699
2014-07-10 10:33:48 +00:00
Tim Northover
9775cffe14
MachO: add dummy armv6m architecture directory so clang_macho_embedded builds things.
...
Without some mention of armv6m in a subdirectory of builtins, the make code
doesn't even know that armv6m exists and is something it should be looking for
in the platform-specific Makefiles. This means that none of the functions
listed actually get built and we end up with an almost entirely empty
libclang_rt.a for armv6m.
Unfortunately, the assembly code in the usual arm directory has no hope of
running on armv6m, which only supports Thumb-1 (not even ARM mode), so adding
it there won't work. Realistically, we probably *will* want to put any
optimised versions in a separate directory, so creating it now is harmless.
rdar://problem/17613576
llvm-svn: 212696
2014-07-10 10:06:42 +00:00
Viktor Kutuzov
f294f25d3a
Make sanitizers' interceptors non-weak on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D4418
llvm-svn: 212693
2014-07-10 09:16:58 +00:00
Viktor Kutuzov
794d4dde48
Only use fast stack unwinding for sanitizers failure reports on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D4420
llvm-svn: 212691
2014-07-10 09:11:15 +00:00
Viktor Kutuzov
d0907ae222
Fix getting environment variables for sanitizers needs on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D4229
llvm-svn: 212690
2014-07-10 08:53:29 +00:00
Alexey Samsonov
020ac94665
[ASan] Force the compiler to generate frame pointer in certain Mac-specific interceptors.
...
Patch by Kuba Brecka!
llvm-svn: 212664
2014-07-10 00:06:53 +00:00
Alexey Samsonov
f723794da8
[Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.
...
Otherwise, it can be accidentally redefined when we build specific sanitizer
runtime. This definition should be provided only once - when we build
sanitizer_common library.
llvm-svn: 212663
2014-07-09 23:59:40 +00:00
Alexey Samsonov
cd0a4aaba3
Don't check lint for SpecialCaseList.cpp
...
llvm-svn: 212642
2014-07-09 19:29:10 +00:00
Dmitry Vyukov
67ccf9851c
tsan: reapply 212531 and 212532 with a fix
...
don't reset s->addr as well
llvm-svn: 212565
2014-07-08 20:37:16 +00:00
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