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
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
b0250948c6
tsan: remove unnecessary line split
...
llvm-svn: 212527
2014-07-08 13:07:23 +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
f0831ee8d2
[msan] Increase hash table size for chained origins.
...
llvm-svn: 212448
2014-07-07 10:45:15 +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
cffaa1c298
Fix apparent thinko in r209744: allocator stats can be zero
...
llvm-svn: 212071
2014-06-30 22:40:58 +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
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
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
3fc095e031
tsan: remove unused header include
...
llvm-svn: 211385
2014-06-20 18:28:34 +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
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
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
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
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
Dmitry Vyukov
909b7490a3
sanitizer: document missing macro
...
llvm-svn: 210329
2014-06-06 12:16:26 +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
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
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
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
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
2fcc427741
[sancov] Remove debug leftovers and update usage text.
...
llvm-svn: 210009
2014-06-02 09:04:45 +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
Evgeniy Stepanov
3a0486b1e9
[sanitizer] Fix build on ARM.
...
llvm-svn: 209884
2014-05-30 10:50: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
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
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
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
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
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
a00ff194b7
[asan] Add a few stubs to fix windows build.
...
llvm-svn: 209717
2014-05-28 08:26:24 +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
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
Sergey Matveev
83f91e786c
[sanitizer] Add __sanitizer_maybe_open_cov_file().
...
Summary: Add a new interface function required for coverage sandboxing support.
llvm-svn: 209298
2014-05-21 13:43:52 +00:00
Evgeniy Stepanov
f77f2ece71
[tsan] Fix gotsan build.
...
llvm-svn: 209286
2014-05-21 09:42:56 +00:00
Evgeniy Stepanov
208aae8ee0
[msan] Chained origins re-design.
...
Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.
This reduces memory usage for chained origins roughly by an order of
magnitude.
Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.
See comments in lib/msan/msan_origin.h for more details.
llvm-svn: 209284
2014-05-21 09:02:13 +00:00
Kostya Serebryany
b9aa538db1
[sanitizer] fix linux_dirent for SANITIZER_X32; based on patch by H.J. Lu
...
llvm-svn: 209281
2014-05-21 08:21:13 +00:00
Kostya Serebryany
b4e24fccd1
[sanitizer] define SANITIZER_X32 and use it in ThreadDescriptorSize; partially based on patch by H.J. Lu
...
llvm-svn: 209279
2014-05-21 08:01:44 +00:00
Kostya Serebryany
84019ff7e5
Cast pointers to uptr when calling internal_syscall
...
For Linux/x86-64, pointers passed to internal_syscall should be casted
to uptr first. Otherwise, they won't be properly extended to 64-bit for
x32.
Patch by H.J. Lu
llvm-svn: 209278
2014-05-21 07:49:03 +00:00
Kostya Serebryany
6c9eacb384
Use 64-bit pointer to unwind stack for x86-64
...
X32 uses ILP32 data model in 64-bit hardware mode. This patch always
uses 64-bit pointer to unwind stack for x86-64.
Patch by H.J. Lu
llvm-svn: 209277
2014-05-21 07:34:03 +00:00
Sergey Matveev
6d8b9a747c
[sanitizer] Fix go build following r209121.
...
llvm-svn: 209136
2014-05-19 16:08:53 +00:00
Sergey Matveev
6cb47a083b
[sanitizer] Support sandboxing in sanitizer coverage.
...
Summary:
Sandboxed code may now pass additional arguments to
__sanitizer_sandbox_on_notify() to force all coverage data to be dumped to a
single file (the default is one file per module). The user may supply a file or
socket to write to. The latter option can be used to broker out the file writing
functionality. If -1 is passed, we pre-open a file.
llvm-svn: 209121
2014-05-19 12:53:03 +00:00
Timur Iskhodzhanov
930ffe94aa
[Sanitizer tests] Don't need to use -lstdc++ thanks to --driver-mode=g++
...
Reviewed at http://reviews.llvm.org/D3796
llvm-svn: 209115
2014-05-19 08:19:38 +00:00
Greg Fitzgerald
f42b49787b
cleanup and test litlint
...
llvm-svn: 208907
2014-05-15 18:52:11 +00:00
Evgeniy Stepanov
f532c5bfd5
[sanitizer] Remove the definition of xdr_ops.
...
User-visible instances of xdr_ops always seem to be allocated statically, and
don't need unpoisoning. Also, it's size differs between platforms.
llvm-svn: 208851
2014-05-15 07:18:34 +00:00
Alp Toker
1ee7fc7a1a
Fix typos
...
llvm-svn: 208841
2014-05-15 02:22:34 +00:00
Greg Fitzgerald
ceae1fbafd
migrate litlint from argparse to optparse. reenabled
...
llvm-svn: 208826
2014-05-14 23:31:20 +00:00
Greg Fitzgerald
73bd03cee9
Disabled litlint. It requires Python 2.7 or later
...
llvm-svn: 208823
2014-05-14 23:20:30 +00:00
Greg Fitzgerald
a310d98ff1
add script to ensure lit test contains %run
...
llvm-svn: 208819
2014-05-14 22:49:46 +00:00
Kostya Serebryany
b9e31d7fcd
[asan] use some LIKELY/UNLIKELY
...
llvm-svn: 208776
2014-05-14 14:03:31 +00:00
Timur Iskhodzhanov
86e2470a5b
[ASan/Win] Enable demangling of global variable names
...
llvm-svn: 208775
2014-05-14 13:55:59 +00:00
Evgeniy Stepanov
99d3791a88
[sanitizer] Fix crash in getgrnam_r and similar interceptors.
...
When no matching record is found, getgrnam_r return 0 but sets result to NULL.
Should fix PR19734.
llvm-svn: 208773
2014-05-14 12:32:40 +00:00
Alexander Potapenko
04e2f43756
[libsanitizer] Notify the runtime about file being closed before the actual call to fclose().
...
This shall fix spurious false positive race reports between fclose() and fopen64().
llvm-svn: 208772
2014-05-14 11:48:37 +00:00
Kostya Serebryany
d5e1091c73
[asan] tyring to fix the Android build
...
llvm-svn: 208763
2014-05-14 09:21:22 +00:00
Kostya Serebryany
7534a60753
[asan] Respect personality in kernel area detector, patch by Yuri Gribov
...
llvm-svn: 208760
2014-05-14 08:13:11 +00:00
Alexander Potapenko
291b827890
[libsanitizer] Fix the return type of internal_fork
...
llvm-svn: 208714
2014-05-13 17:31:09 +00:00
Alexander Potapenko
4a6cac4382
[libsanitizer] Use internal_fork() to spawn the symbolizer process.
...
This should fix https://code.google.com/p/thread-sanitizer/issues/detail?id=61
llvm-svn: 208707
2014-05-13 16:17:54 +00:00
Timur Iskhodzhanov
5ce3937ed4
[Sanitizer tests] Define 16- and 64-bit versions of atomic_compare_exchange_strong on Windows
...
Reviewed at http://reviews.llvm.org/D3745
llvm-svn: 208700
2014-05-13 14:23:25 +00:00
Timur Iskhodzhanov
5812350591
[Sanitizer tests] Exclude three tests that fail on Windows
...
llvm-svn: 208698
2014-05-13 13:34:00 +00:00
Timur Iskhodzhanov
e33158bcd1
[Sanitizer tests] Land the sanitizer twin of the asan-only change r208682
...
llvm-svn: 208697
2014-05-13 13:29:11 +00:00
Timur Iskhodzhanov
339e8c98f8
[Sanitizer tests] Add sanitizer_test_config.h to make the inclusion of gtest.h conditional
...
Reviewed at http://reviews.llvm.org/D3744
llvm-svn: 208696
2014-05-13 13:25:12 +00:00
Timur Iskhodzhanov
2e9136c2da
[Sanitizer/ASan tests] Automatically detect the presence of libstdc++
...
llvm-svn: 208695
2014-05-13 12:57:50 +00:00
Evgeniy Stepanov
68d7f43e38
[sanitizer] Disable fopen64 interceptor on osx.
...
llvm-svn: 208693
2014-05-13 12:05:38 +00:00
Timur Iskhodzhanov
e5e92fac4a
[Sanitizer tests] Fix most of the build problems on Windows
...
E.g. use the pthread helpers introduced in r208674
llvm-svn: 208692
2014-05-13 12:02:53 +00:00
Evgeniy Stepanov
7bd7063db0
[sanitizer] Mark several functions as possibly unused.
...
llvm-svn: 208686
2014-05-13 11:18:22 +00:00
Evgeniy Stepanov
4d16c1df0c
[sanitizer] Delete an unused function.
...
llvm-svn: 208678
2014-05-13 09:03:45 +00:00
Evgeniy Stepanov
6b21d560c9
[sanitizer] Fix windows build.
...
llvm-svn: 208677
2014-05-13 08:47:40 +00:00
Evgeniy Stepanov
5680a26b0b
[msan] Better open_memstream support.
...
Move fflush and fclose interceptors to sanitizer_common.
Use a metadata map to keep information about the external locations
that must be updated when the file is written to.
llvm-svn: 208676
2014-05-13 08:36:31 +00:00
Timur Iskhodzhanov
711269966c
[Sanitizer tests] Make simple pthread tests compile and pass on Windows
...
Reviewed at http://reviews.llvm.org/D3725
llvm-svn: 208674
2014-05-13 08:07:09 +00:00
Kostya Serebryany
0d00675df2
[sanitizer] fix for ARM Linux, patch by Maxim Ostapenko
...
llvm-svn: 208673
2014-05-13 08:01:59 +00:00
Kostya Serebryany
b7a7e55dc5
[sanitizer] define __sanitizer_time_t
...
llvm-svn: 208671
2014-05-13 07:49:39 +00:00
Timur Iskhodzhanov
1ac44dd087
[Sanitizer tests] Fix a comment that got out of sync with the #if
...
llvm-svn: 208602
2014-05-12 17:33:00 +00:00
Timur Iskhodzhanov
36fc9b18b7
[ASan tests] Also define USED/UNUSED in lib/sanitizer_common/sanitizer_internal_defs.h if Clang is used on Windows
...
Otherwise we end up with macro redefinition warnings
llvm-svn: 208571
2014-05-12 14:44:29 +00:00
Timur Iskhodzhanov
9a205ed8ee
[ASan tests] Use the proper attribute on RunStrChrTest helper functions to avoid "unused function" warnings
...
llvm-svn: 208568
2014-05-12 14:31:57 +00:00
Sergey Matveev
f37bd92c3a
[asan] Move the "coverage" flag to common flags.
...
The implementation lives in sanitizer_common and will need to access that flag.
llvm-svn: 208566
2014-05-12 14:27:36 +00:00
Alexey Samsonov
35744c4753
Fixup for r208066. Properly get values of PTRACE_GETREGSET/PTRACE_SETREGSET.
...
llvm-svn: 208363
2014-05-08 22:11:20 +00:00
Sergey Matveev
76e02e90c5
[ASan] Fix coverage behavior when a PC belongs to an unknown address range.
...
This happens, e.g., when coverage data is collected for a module which is then
dlclose()'d. Currently this causes CovDump() to ignore all PCs that are greater
than the unrecognized PC. In other words, unloading a module causes ASan to
silently ignore any coverage data for modules loaded at higher addresses.
Instead we should just skip the unrecognized PCs.
llvm-svn: 208333
2014-05-08 16:09:54 +00:00
Timur Iskhodzhanov
76f43eecb0
[ASan] Update sanitizer_common and asan test_util headers to support building on Windows
...
llvm-svn: 208306
2014-05-08 12:43:33 +00:00
Evgeniy Stepanov
d31ac26230
[sanitizer] Unconditionally write to target buffer in *sprintf interceptors.
...
This does not change the default behavior (check_printf in on by default in all tools).
With this change, check_printf flag only affects format string parsing.
llvm-svn: 208290
2014-05-08 09:18:22 +00:00
Evgeniy Stepanov
7d46040ff2
[sanitizer] Replace a macro with a function.
...
llvm-svn: 208207
2014-05-07 13:24:28 +00:00
Evgeniy Stepanov
55590227f8
[sanitizer] Intercept obstack.
...
llvm-svn: 208196
2014-05-07 11:50:56 +00:00
Kostya Serebryany
7a733480c8
[asan] introduce interface function __sanitizer_verify_contiguous_container to verify annotations in vector-like containers
...
llvm-svn: 208092
2014-05-06 14:41:01 +00:00
Evgeniy Stepanov
aa44aaee90
[sanitizer] Print addresses in hexadecimal.
...
llvm-svn: 208089
2014-05-06 14:01:13 +00:00
Timur Iskhodzhanov
7d5c81db0a
[ASan/Win] Don't crash when ASAN_OPTIONS have disable_core=1
...
Reviewed at http://reviews.llvm.org/D3610
llvm-svn: 208070
2014-05-06 08:21:50 +00:00
Kostya Serebryany
98e55ef41a
[sanitizer] fix build with glibc 2.4, patch by Sandra Loosemore
...
llvm-svn: 208066
2014-05-06 07:36:51 +00:00
Kostya Serebryany
12963b54a8
[asan] disable GetKernelStartAddress as it misbehaves in schroot
...
llvm-svn: 207768
2014-05-01 16:20:23 +00:00
Kostya Serebryany
8b530e10a1
[asan] make AsanCoverage lock-free (and AS-safe)
...
llvm-svn: 207630
2014-04-30 10:40:48 +00:00
Alexey Samsonov
d94e87db3f
[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interceptors
...
llvm-svn: 207443
2014-04-28 20:40:25 +00:00
Viktor Kutuzov
f9eba2f51d
Fix building Asan and common sanitizers tests on FreeBSD 9.2
...
llvm-svn: 207408
2014-04-28 10:33:01 +00:00
Evgeniy Stepanov
c435fb07dd
[sanitizer] Limit fopen interceptor to linux.
...
llvm-svn: 207227
2014-04-25 13:55:29 +00:00
Evgeniy Stepanov
f3d5d119a8
[sanitizer] Intercept a bunch of stdio calls.
...
Add move fopen/freopen interceptors from TSan to common.
llvm-svn: 207224
2014-04-25 13:26:21 +00:00
Alexander Potapenko
623c989eea
[ASan] Use a non-null altstack.ss_size when disabling sigaltstack on Darwin.
...
llvm-svn: 207220
2014-04-25 10:39:41 +00:00
Justin Bogner
b83dd55eb6
[sanitizer] wordexp isn't available on iOS
...
llvm-svn: 207140
2014-04-24 20:10:31 +00:00
Dmitry Vyukov
b7ebc53772
tsan: stop background thread when sandbox is enabled
...
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=56
llvm-svn: 207114
2014-04-24 13:09:17 +00:00
Kostya Serebryany
7afc6b2c72
[asan] enable use_sigaltstack by default (this will provide verbose reports on stack-overflow instead of silently crashing with SEGV)
...
llvm-svn: 207099
2014-04-24 11:55:17 +00:00
Kostya Serebryany
c9db838267
[asan] enable LeakSanitizer (LSan) by default in asan. This only affects Linux x86_64. LSan has been used in various projects for more than half a year and we now consider it quite stable to be on by default.
...
llvm-svn: 206896
2014-04-22 13:56:56 +00:00
Kostya Serebryany
26c4e96455
[sanitizer] enable check_printf by default for asan and tsan. We've been using this flag for a while and it seems to be stable enough for the rest of the world.
...
llvm-svn: 206872
2014-04-22 09:17:08 +00:00
Evgeniy Stepanov
a7f9071f25
[sanitizer] Intercept tsearch.
...
llvm-svn: 206755
2014-04-21 14:21:51 +00:00
Alexey Samsonov
aefbec9dfd
Move pthread_cond_* interceptors from sanitizer_common with all the ugly hacks to TSan
...
llvm-svn: 206423
2014-04-16 23:06:46 +00:00
Kostya Serebryany
498b18a01e
[asan] try to harden __tls_get_addr interceptor against signals (no good test still); update the comment in a test.
...
llvm-svn: 206367
2014-04-16 09:07:27 +00:00
Alexander Potapenko
65a6c57013
[ASan] Replace a CHECK for mmap_limit_mb with a RAW_CHECK.
...
In the case of a CHECK failure the program tries to fork and launch llvm-symbolizer,
but hangs in mz_force_lock because one of the allocator locks is already acquired.
llvm-svn: 206274
2014-04-15 11:36:18 +00:00
Kostya Serebryany
b1232474b2
[asan] try fixing the mmap_limit_mb failure on buildbot (tests pass locally)
...
llvm-svn: 206262
2014-04-15 08:35:43 +00:00
Hans Wennborg
8f80ccc635
sanitizer_atomic_msvc.h: add atomic_fetch_{add,sub} overloads for uintptr_t
...
This should hopefully unbreak the MSVC build after r206178.
llvm-svn: 206200
2014-04-14 17:43:49 +00:00
Hans Wennborg
ec77f619bb
sanitizer_deadlock_detector.h: MSVC 2012 doesn't like compound literals
...
llvm-svn: 206199
2014-04-14 17:43:45 +00:00
Kostya Serebryany
bcfbea6d4e
[asan] added internal flag mmap_limit_mb
...
llvm-svn: 206178
2014-04-14 14:51:01 +00:00
Kostya Serebryany
f694ab1f18
[asan] provide better reports for cases where memcpy/etc get negative size parameter. Also fix a typo found by Tetsuo Kiso
...
llvm-svn: 206158
2014-04-14 09:50:52 +00:00
Dmitry Vyukov
b5eb8f0212
tsan: fix vector clocks
...
the new optimizations break when thread ids gets reused (clocks go backwards)
add the necessary tests as well
llvm-svn: 206035
2014-04-11 15:38:03 +00:00
Evgeniy Stepanov
652cbd7c15
[tsan] Fix false positive on xdr*_create.
...
llvm-svn: 206030
2014-04-11 12:29:24 +00:00
Evgeniy Stepanov
24c8d92fec
[sanitizer] Intercept a subset of sunrpc interface (xdr_*).
...
llvm-svn: 205627
2014-04-04 14:51:23 +00:00
Kostya Serebryany
9f20c9b17c
[asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to disable this handler completely; remove a workaround for a bug fixed in glibc
...
llvm-svn: 205617
2014-04-04 09:10:58 +00:00
Viktor Kutuzov
7fedc179d2
Add FreeBSD support to sanitizers' procmaps facilities
...
llvm-svn: 205291
2014-04-01 10:34:21 +00:00
Viktor Kutuzov
3ece65b894
Fix definition of the __sanitizer_passwd structure on FreeBSD
...
llvm-svn: 205290
2014-04-01 10:29:42 +00:00
Alexey Samsonov
78a8435fd6
[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
...
Soon there will be an option to build compiler-rt parts as shared libraries
on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042
by Yuri Gribov.
llvm-svn: 205183
2014-03-31 13:45:36 +00:00
Kostya Serebryany
683d55f50e
[sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over)
...
llvm-svn: 205168
2014-03-31 07:23:50 +00:00
Evgeniy Stepanov
6f34082590
[sanitizer] Fix Mac build.
...
llvm-svn: 205006
2014-03-28 14:01:40 +00:00
Evgeniy Stepanov
86a4d2c32b
[sanitizer] Intercept fgetpwent / fgetgrent.
...
These interceptors require deep unpoisoning of return values.
While at it, we do the same for all other pw/gr interceptors to
reduce dependency on libc implementation details.
llvm-svn: 205004
2014-03-28 13:03:55 +00:00
Evgeniy Stepanov
163ee4efb5
[sanitizer] Intercept setpwent/endpwent.
...
It's hard to write a reliable test for this code because they
work with unpredictable memory locations. But this change should
fix current failures in getpwent() tests on the sanitizer bots.
llvm-svn: 205002
2014-03-28 11:46:35 +00:00
Evgeniy Stepanov
92bee36b3e
[sanitizer] Intercept rand_r.
...
llvm-svn: 205001
2014-03-28 11:21:45 +00:00
Evgeniy Stepanov
74e77756ef
[sanitizer] Intercept getpwent/getgrent.
...
llvm-svn: 205000
2014-03-28 10:56:07 +00:00
Evgeniy Stepanov
2e972f63b5
[sanitizer] Intercept mktime.
...
llvm-svn: 204994
2014-03-28 09:02:57 +00:00
Evgeniy Stepanov
7b44e1ad42
[sanitizer] Intercept ftime.
...
llvm-svn: 204991
2014-03-28 08:33:32 +00:00
Evgeniy Stepanov
a6eb1bb59e
[sanitizer] Intercept __bzero on Mac.
...
This should make memset_test pass on Mac.
llvm-svn: 204929
2014-03-27 14:20:34 +00:00
Evgeniy Stepanov
1189734413
[sanitizer] Fix Android build.
...
llvm-svn: 204927
2014-03-27 14:06:15 +00:00
Evgeniy Stepanov
9dcd5a353a
[msan] Intercept several malloc-related functions.
...
llvm-svn: 204923
2014-03-27 13:29:29 +00:00