Sergey Matveev
6a0c722c23
[asan] Fix r182858.
...
llvm-svn: 182862
2013-05-29 15:31:52 +00:00
Sergey Matveev
4161813a50
[asan] Fix r182854: run the unpoison_tls test only on Linux.
...
llvm-svn: 182858
2013-05-29 14:37:04 +00:00
Timur Iskhodzhanov
cc61eefd4b
Fix MSVC W3 compiler warnings
...
llvm-svn: 182857
2013-05-29 14:11:44 +00:00
Sergey Matveev
09886cd17a
[asan] Make ASan report the correct thread address ranges to LSan.
...
This CL enables thread support in LSan when used on top of ASan.
llvm-svn: 182854
2013-05-29 13:09:44 +00:00
Sergey Matveev
89bcec8117
[sanitizer] Change the way GetThreadStackAndTls() obtains the thread descriptor address.
...
Instead of using arch_prctl(ARCH_GET_FS), read the address from the
tread descriptor itself. This lets us avoid sandboxing issues. Also,
GetThreadStackAndTls() can now be implemented on i386.
llvm-svn: 182853
2013-05-29 13:07:42 +00:00
Evgeniy Stepanov
677003140c
[sanitizer] Fix getaddrinfo interceptor to use the actual returned sockaddr size.
...
llvm-svn: 182852
2013-05-29 12:33:31 +00:00
Peter Collingbourne
112e5ba281
[nolibc] Unweak SymbolizerPrepareForSandboxing and move it to libc-independent part.
...
Fixes the Go build.
Differential Revision: http://llvm-reviews.chandlerc.com/D877
llvm-svn: 182851
2013-05-29 12:11:43 +00:00
Timur Iskhodzhanov
6ba477aa05
Fix MSVC warnings at the -W2 level
...
llvm-svn: 182848
2013-05-29 12:03:49 +00:00
Evgeniy Stepanov
a4bf67e461
[sanitizer] Fix Mac build.
...
llvm-svn: 182845
2013-05-29 11:55:27 +00:00
Evgeniy Stepanov
fc708db4c1
[sanitizer] Intercept getpeername.
...
llvm-svn: 182844
2013-05-29 11:49:25 +00:00
Evgeniy Stepanov
a4d08c4e87
[sanitizer] Move TSan and MSan recvmsg interceptors to common.
...
llvm-svn: 182843
2013-05-29 11:30:00 +00:00
Dmitry Vyukov
2b997d2914
tsan: match "race" suppressions against "race on vptr" reports
...
llvm-svn: 182842
2013-05-29 11:23:54 +00:00
Peter Collingbourne
93aa8dfb78
[nolibc] Now that we have a custom allocator, remove dummy allocator
...
definitions from test.
llvm-svn: 182841
2013-05-29 10:52:59 +00:00
Alexey Samsonov
25ad5a6735
[sanitizer] Use raw check in internal allocator to prevent self-deadlocks. Try to fix Windows build.
...
llvm-svn: 182840
2013-05-29 10:41:53 +00:00
Sergey Matveev
e615432313
[lsan] Convert the remaining LSan tests to output tests.
...
llvm-svn: 182839
2013-05-29 10:12:37 +00:00
Evgeniy Stepanov
f28217ad0e
[sanitizer] modf/modff/modfl interceptors.
...
llvm-svn: 182838
2013-05-29 10:03:11 +00:00
Alexey Samsonov
75289297af
Exclude sanitizer_nolibc_test from TSan test run. Fix lint warnings
...
llvm-svn: 182837
2013-05-29 09:40:07 +00:00
Alexey Samsonov
c30e2d6b3a
Make InternalAlloc/InternalFree in sanitizer runtimes libc-free by switching to a custom allocator.
...
llvm-svn: 182836
2013-05-29 09:15:39 +00:00
Evgeniy Stepanov
08f662845d
[sanitizer] Share TSan accept & accept4 interceptors with other sanitizers.
...
llvm-svn: 182835
2013-05-29 09:09:58 +00:00
Evgeniy Stepanov
40d7ed5d1e
[sanitizer] Improve getaddrinfo interceptor.
...
llvm-svn: 182775
2013-05-28 14:34:37 +00:00
Evgeniy Stepanov
dd0780f81c
[msan] Change report header to be more alike to ASan and TSan.
...
llvm-svn: 182774
2013-05-28 14:27:30 +00:00
Peter Collingbourne
a7887bf8be
[nolibc] Add a test case for Linux/x86_64.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D873
llvm-svn: 182770
2013-05-28 12:37:34 +00:00
Peter Collingbourne
fb1a9f17e3
[nolibc] Make SymbolizerPrepareForSandboxing weak and optional.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D872
llvm-svn: 182765
2013-05-28 11:05:05 +00:00
Peter Collingbourne
5b2669049a
[nolibc] Make AddressInfo::Clear a weak function.
...
llvm-svn: 182743
2013-05-27 21:00:36 +00:00
Peter Collingbourne
123473d243
Use an address-of operator here to silence an MSVC warning.
...
llvm-svn: 182740
2013-05-27 16:02:19 +00:00
Sergey Matveev
39e8a6d87e
[lsan] Begin converting LSan tests to output tests.
...
In this CL all old tests are removed and one LIT test is added.
llvm-svn: 182730
2013-05-27 11:41:46 +00:00
Sergey Matveev
9cda3df8bd
[sanitizer] Move FindThreadByOSIdLocked from lsan to sanitizer_common.
...
llvm-svn: 182728
2013-05-27 10:35:51 +00:00
Alexey Samsonov
9c2bcf8c15
Improve support for compiler-rt tests in CMake build.
...
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!
llvm-svn: 182726
2013-05-27 09:35:24 +00:00
Nick Kledzik
23bbd617e4
<rdar://problem/12512722> Use arm divide instruction if available
...
llvm-svn: 182665
2013-05-24 19:38:11 +00:00
Sergey Matveev
e45a0677a6
[lsan] Allow the ignored TLS range to be empty.
...
llvm-svn: 182657
2013-05-24 18:07:53 +00:00
Sergey Matveev
37dff38495
[lsan] Minor adjustments to LSan messages.
...
llvm-svn: 182648
2013-05-24 15:36:30 +00:00
Sergey Matveev
c7715a228a
[lsan] Prettify LSan reports and add a summary.
...
llvm-svn: 182646
2013-05-24 14:49:13 +00:00
Sergey Matveev
bc880f3a54
[lsan] Add exitcode flag. Kill the process if leaks are found.
...
llvm-svn: 182641
2013-05-24 13:16:02 +00:00
Alexey Samsonov
646ec67e25
Disable init-order checking before destructors are run.
...
We don't want to report initialization-order bugs when a destructor of a global
variable accesses dynamically initialized global from another
(not necessarily initialized) module. We do this by intercepting __cxa_atexit and
registrering our own callback that unpoisons shadow for all dynamically initialized
global variables.
llvm-svn: 182637
2013-05-24 11:46:56 +00:00
Bill Wendling
b7e7a38929
Don't override 'mode' and cleanup some variable names.
...
llvm-svn: 182599
2013-05-23 18:18:31 +00:00
Bill Wendling
a600457cde
Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing this out.
...
llvm-svn: 182598
2013-05-23 18:08:22 +00:00
Sergey Matveev
a4a01975d5
[lsan] Add lit test support.
...
"check-lsan" now runs both the tests from lib/lsan/tests and any lit
tests found under lib/lsan/lit_tests.
llvm-svn: 182583
2013-05-23 12:58:56 +00:00
Alexander Potapenko
22e92fa954
[TSan] Try to fix the Go-TSan build.
...
llvm-svn: 182582
2013-05-23 12:54:35 +00:00
Evgeniy Stepanov
bfbd37e6e7
[tsan] Remove -Wgnu from Makefile.old.
...
llvm-svn: 182580
2013-05-23 11:57:47 +00:00
Alexander Potapenko
6535f510a3
[ASan] Introduce SymbolizerPrepareForSandboxing(), which is a no-op on every platform except Linux (because we don't support sandboxing anywhere else yet)
...
On Linux we pre-cache the value of readlink("/proc/self/exe"), so that it can be later used when the sandbox has been turned on.
llvm-svn: 182579
2013-05-23 11:53:36 +00:00
Evgeniy Stepanov
a343d1d881
[msan] Fix line >80 chars.
...
llvm-svn: 182578
2013-05-23 11:51:47 +00:00
Evgeniy Stepanov
5415c9c352
[sanitizer] Fix Windows build.
...
llvm-svn: 182576
2013-05-23 11:41:58 +00:00
Timur Iskhodzhanov
e05f9ba956
[ASan] Rename a atomic_compare_exchange_strong parameter to avoid a compiler warning
...
llvm-svn: 182575
2013-05-23 11:40:51 +00:00
Evgeniy Stepanov
b978627cb8
[sanitizer] Intercept getsockopt.
...
llvm-svn: 182574
2013-05-23 11:38:08 +00:00
Evgeniy Stepanov
ab25369d04
[sanitizer] Interceptors for gethostbyname and friends.
...
llvm-svn: 182573
2013-05-23 11:10:23 +00:00
Sergey Matveev
bb12f840b5
[lsan] Ensure lsan is initialized when interceptors are called.
...
Also remove unnecessary ifdefs.
llvm-svn: 182571
2013-05-23 10:24:44 +00:00
Alexander Potapenko
fd7d9f45dd
[ASan] Rename __asan_preinit to __local_asan_preinit to avoid warnings from the linker which is trying to export all the __asan_* symbols
...
llvm-svn: 182567
2013-05-23 09:15:20 +00:00
Bill Wendling
353fbd3516
Performance improvement.
...
Using fwrite and fread was very *very* slow. The resulting code was multiple
times slower than GCC's implementation of gcov. Replace the fwrite/fread system
with an mmap() version.
If the `.gcda' file doesn't exist, we (re)allocate a buffer that we write
into. That gets written to the `.gcda' file in one chunk. If the `.gcda' file
already exists, we simply mmap() the file, modify the mapped data, and use
msync() to write the contents out to disk. It's much easier than implementing
our own buffering scheme, and we don't have to use fwrite's and fread's
buffering.
For those who are numbers-oriented, here are some timings:
GCC Verison
-----------
`.gcda' files don't exist: 23s
`.gcda' files do exist: 14s
LLVM Version (before this change)
---------------------------------
`.gcda' files don't exist: 28s
`.gcda' files do exist: 28s
LLVM Version (with this change)
-------------------------------
`.gcda' files don't exist: 18s
`.gcda' files do exist: 4s
It's a win-win-win-win-lose-win-win scenario!
<rdar://problem/13466086>
llvm-svn: 182563
2013-05-23 07:18:59 +00:00
Evgeniy Stepanov
d23422f025
[sanitizer] Fix Mac build one more time.
...
llvm-svn: 182481
2013-05-22 15:21:04 +00:00
Evgeniy Stepanov
093e499e27
[sanitizer] Fix Android build.
...
llvm-svn: 182479
2013-05-22 14:26:52 +00:00
Alexey Samsonov
58df72e0d2
Effectively revert r182453 - atomic.c may not be compiled if host compiler doesn't understand _Atomic
...
llvm-svn: 182478
2013-05-22 14:22:04 +00:00
Kostya Serebryany
6ca6ba2f2c
[asan] fix the reported PCs for powerpc64
...
llvm-svn: 182477
2013-05-22 14:21:34 +00:00
Evgeniy Stepanov
97aea34b54
[msan] Intercept getsockname.
...
llvm-svn: 182475
2013-05-22 13:46:22 +00:00
Evgeniy Stepanov
a8ea8a03fd
[sanitizer] Fix Android build.
...
llvm-svn: 182473
2013-05-22 13:38:02 +00:00
Alexey Samsonov
49eb5700e2
Revert r182465 and add lsan-common library to makefile-based build
...
llvm-svn: 182470
2013-05-22 13:20:37 +00:00
Evgeniy Stepanov
02c9c8c9f7
[sanitizer] Fix Mac build.
...
llvm-svn: 182469
2013-05-22 13:07:23 +00:00
Evgeniy Stepanov
bfd2122b20
[msan] getaddrinfo & nested interceptor support.
...
Multiple connected changes:
- Ignore reads from nested interceptors.
- Check shadow on reads from common interceptors.
- getaddrinfo interceptor.
llvm-svn: 182466
2013-05-22 12:50:26 +00:00
Alexey Samsonov
155dd46e04
[ASan] Temporary remove leak checking from ASan, while we don't have makefile-based build for LSan
...
llvm-svn: 182465
2013-05-22 12:44:57 +00:00
Kostya Serebryany
15fd53fa39
[asan] enhance stack-overflow.cc test: check that the location frame is properly symbolized
...
llvm-svn: 182463
2013-05-22 11:00:56 +00:00
Kostya Serebryany
b93ae15205
[asan] attempting to fix the debian bot (on ubuntu the test builds; on debian it complains that _SC_PAGESIZE is unknown)
...
llvm-svn: 182462
2013-05-22 10:38:51 +00:00
Kostya Serebryany
62debd6d6a
[asan] fix dlclose-test to work with non-4K pages. Properly disable interface_symbols_linux on non-x86
...
llvm-svn: 182461
2013-05-22 10:20:10 +00:00
Kostya Serebryany
8410a867eb
[asan] workaround for asan bug 189 (swapcontext followed by throw gets OOM kill). Also, disable swapcontext_test on non-x86. Fix lint
...
llvm-svn: 182456
2013-05-22 08:54:30 +00:00
Alexey Samsonov
57cbb6c6cc
Add atomic.c to CMake build of compiler-rt to match r182420
...
llvm-svn: 182453
2013-05-22 06:46:07 +00:00
Nick Kledzik
69e25c45e4
<rdar://problem/13806954> enable __atomic_* functions for Darwin
...
llvm-svn: 182435
2013-05-21 23:02:04 +00:00
Daniel Dunbar
eaa153bdad
Add atomic.c back to the builtins module sources lists (for Makefile build).
...
llvm-svn: 182420
2013-05-21 20:40:36 +00:00
Sergey Matveev
20ccf95f80
[lsan] Invoke leak detection with atexit().
...
Keeps it consistent between ASan and LSan.
llvm-svn: 182399
2013-05-21 17:56:45 +00:00
Sergey Matveev
17f5705d3c
[asan] Do not invoke LSan hooks unless CAN_SANITIZE_LEAKS.
...
llvm-svn: 182389
2013-05-21 15:35:34 +00:00
Sergey Matveev
8c235f40d7
[asan] LSan hooks in asan_rtl.
...
llvm-svn: 182384
2013-05-21 14:15:35 +00:00
Sergey Matveev
620744556a
[lsan] Change CMakeLists to build the common LSan module for ASan.
...
Also, define CAN_SANITIZE_LEAKS.
llvm-svn: 182383
2013-05-21 14:12:11 +00:00
Alexey Samsonov
b99085b0b8
[MSan] Add empty default blacklist for MSan
...
llvm-svn: 182382
2013-05-21 13:55:56 +00:00
Alexey Samsonov
e838135b6c
[ASan] create default (empty) ASan blacklist file in resource directory
...
llvm-svn: 182380
2013-05-21 13:48:27 +00:00
Sergey Matveev
7159b2a382
[asan] LSan hooks in asan_allocator2.cc
...
llvm-svn: 182379
2013-05-21 13:46:41 +00:00
Sergey Matveev
65dd62abe5
[asan] LSan hooks in asan_thread.cc
...
llvm-svn: 182378
2013-05-21 13:40:13 +00:00
Sergey Matveev
aa0b45a094
[lsan] LSan in LD_PRELOAD library form.
...
llvm-svn: 182376
2013-05-21 12:49:33 +00:00
Alexey Samsonov
73565f7f5d
[Sanitizer] Print verbose warning if symbolizer can't read /proc/self/exe for some reason
...
llvm-svn: 182374
2013-05-21 12:22:36 +00:00
Peter Collingbourne
c787d42f40
[nolibc] Move symbolizer to RTSanitizerCommonLibc, and make it optional using a weak symbol.
...
llvm-svn: 182372
2013-05-21 12:08:37 +00:00
Peter Collingbourne
fa8aa4105c
[nolibc] Move stoptheworld to RTSanitizerCommonLibc.
...
llvm-svn: 182369
2013-05-21 11:38:39 +00:00
Peter Collingbourne
8575195772
[nolibc] Move libc-dependent sanitizer_posix.cc code to sanitizer_posix_libcdep.cc.
...
llvm-svn: 182366
2013-05-21 10:27:07 +00:00
Alexey Samsonov
3677b18388
[ASan] Mark init-order test as XFAIL on Darwin
...
llvm-svn: 182365
2013-05-21 10:11:17 +00:00
Alexey Samsonov
af456d0c40
[ASan] Don't run fast unwinder tests on 32-bit Linux as fast unwinder may be unexpectedly smart on some hosts
...
llvm-svn: 182363
2013-05-21 09:35:48 +00:00
Evgeniy Stepanov
4059d778d1
[sanitizer] Enable pthread_getschedparam interceptor on Android.
...
llvm-svn: 182361
2013-05-21 09:01:23 +00:00
Alexey Samsonov
1c26f007ed
[ASan] Mark some tests as working only on x86_64 and i386 arches
...
llvm-svn: 182360
2013-05-21 09:01:13 +00:00
Evgeniy Stepanov
1d2f22825d
[msan] Replace GetArgv hack with something that is slightly better.
...
llvm-svn: 182359
2013-05-21 08:56:22 +00:00
Alexey Samsonov
4ca93997f7
Add lit config feature <target>-supported-target to mark target-specific tests
...
llvm-svn: 182355
2013-05-21 08:22:03 +00:00
Dmitry Vyukov
536bff3396
tsan: detect when a thread ends with ignores enabled
...
llvm-svn: 182354
2013-05-21 08:12:35 +00:00
Evgeniy Stepanov
970be35808
[sanitizer] Intercept pthread_getschedparam.
...
llvm-svn: 182353
2013-05-21 08:12:08 +00:00
Kostya Serebryany
b1333fe831
[sanitizer] fix asan on the platforms where the page size is not a compile-time constant (or at least where EXEC_PAGESIZE may not be trustworthy), e.g. powerpc64.
...
llvm-svn: 182351
2013-05-21 06:15:50 +00:00
Peter Collingbourne
b69b8a4a8f
[nolibc] Move GetPageSize to the individual platforms.
...
GetPageSize wraps sysconf(_SC_PAGESIZE) on POSIX platforms, but
sysconf resides in libc. To make this libc-independent on Linux,
move the wrapper to sanitizer_mac.cc and return the Linux-specific
constant EXEC_PAGESIZE in the sanitizer_linux.cc implementation.
llvm-svn: 182303
2013-05-20 17:05:29 +00:00
Peter Collingbourne
0c8df4e1d8
[nolibc] Move libc-dependent sanitizer_linux.cc code to sanitizer_linux_libcdep.cc.
...
llvm-svn: 182292
2013-05-20 15:57:44 +00:00
Peter Collingbourne
d5169edc36
[nolibc] Make GetArgsAndEnv libc-independent.
...
__libc_stack_end is made into a weak symbol if possible. If libc is
not linked, read args and environment from /proc.
llvm-svn: 182276
2013-05-20 14:25:32 +00:00
Alexey Samsonov
cbbdfc50ee
Build LSan on x86_64 only if this target is supported
...
llvm-svn: 182272
2013-05-20 14:16:45 +00:00
Sergey Matveev
6dd91e475a
[lsan] Fix r182256.
...
Add missing call to GetUserBegin().
llvm-svn: 182267
2013-05-20 14:04:56 +00:00
Alexander Potapenko
a15d49cc1f
[libsanitizer] Introduce INTERCEPTOR_WITH_SUFFIX which is to be used for appending the __DARWIN_ALIAS() version suffixes to function names on Darwin.
...
This should fix asan/lit_tests/wait.cc under ASan.
llvm-svn: 182259
2013-05-20 13:32:35 +00:00
Sergey Matveev
bcfd838bcb
[lsan] GetUserBegin() in LSan.
...
Separate the notions of user-visible chunk and allocator chunk, to facilitate
ASan integration.
llvm-svn: 182256
2013-05-20 13:08:23 +00:00
Timur Iskhodzhanov
67c918a424
Fix realloc'ing freed/invalid pointers
...
See https://code.google.com/p/address-sanitizer/issues/detail?id=187 for the details
llvm-svn: 182255
2013-05-20 13:05:58 +00:00
Sergey Matveev
6a6c5b6dee
[asan] Modify ASan metadata atomically.
...
We need this to avoid races when ASan and LSan are used together.
llvm-svn: 182252
2013-05-20 11:25:18 +00:00
Sergey Matveev
3c20829559
[lsan] CMakeLists and lit test configs for LSan.
...
llvm-svn: 182251
2013-05-20 11:13:33 +00:00
Sergey Matveev
48c1d1acad
[lsan] Tests for LeakSanitizer.
...
llvm-svn: 182250
2013-05-20 11:09:27 +00:00
Sergey Matveev
b5483be858
[lsan] Common leak checking module.
...
Leak checking functionality which will be shared between
LSan/ASan/MSan.
llvm-svn: 182249
2013-05-20 11:06:50 +00:00
Sergey Matveev
3d97cdd140
[lsan] Standalone LSan initialization.
...
llvm-svn: 182248
2013-05-20 11:04:43 +00:00
Sergey Matveev
a5f9691dfb
[lsan] Interceptors for standalone LSan.
...
llvm-svn: 182247
2013-05-20 11:01:40 +00:00
Sergey Matveev
c7d003ec43
[lsan] Thread registry for standalone LSan.
...
llvm-svn: 182246
2013-05-20 10:57:53 +00:00
Sergey Matveev
866abfb3fe
[lsan] Allocator for standalone LSan.
...
This is the first in a series of CLs implementing LeakSanitizer.
http://clang.llvm.org/docs/LeakSanitizer.html
llvm-svn: 182245
2013-05-20 10:54:00 +00:00
Timur Iskhodzhanov
667cae7b69
[ASan] Remove an unused ChunkBase field
...
Also fix wrong alignment maths and an outdated comment
llvm-svn: 182238
2013-05-20 08:20:17 +00:00
Kostya Serebryany
3469375e4f
[sanitizer] factor out ByteMap from SizeClassAllocator32 so that it can be later replaced with a more memory-efficient implementation on 64-bit.
...
llvm-svn: 182234
2013-05-20 07:29:21 +00:00
Richard Smith
73241096f7
Avoid rebuilding the RTSanitizerCommon objects when building clang_rt.san.
...
llvm-svn: 182218
2013-05-19 19:53:01 +00:00
Timur Iskhodzhanov
836a4f3643
Replace CHECK(a == b); with CHECK_EQ(a, b); throughout asan_allocator2.cc
...
llvm-svn: 182198
2013-05-18 18:27:33 +00:00
David Blaikie
97c3018aac
Fix the UBSan CMake build broken in r182118
...
llvm-svn: 182177
2013-05-17 23:57:24 +00:00
Peter Collingbourne
ffaf2eac4d
[nolibc] Move all platforms to internal_getpid.
...
Before, we had an unused internal_getpid function for Linux, and a
platform-independent GetPid function. To make the naming conventions
consistent for syscall-like functions, the GetPid syscall wrapper
in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is
renamed to internal_getpid, bringing the Linux variant into use.
llvm-svn: 182132
2013-05-17 16:56:53 +00:00
Peter Collingbourne
6d4a7d3723
[nolibc] Begin moving sanitizer_common's libc-dependent code to a separate library
...
Introduce a new object library, RTSanitizerCommonLibc, which will contain
the subset of sanitizer_common with libc dependencies. RTSanitizerCommon
contains the remainder of sanitizer_common, and is intended to have no
libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting
with sanitizer_common.cc, whose libc-dependent portion is moved to
sanitizer_common_libcdep.cc, the first member of the new library.
This split affects the CMake build only. The makefile build continues
to produce the full sanitizer_common library.
llvm-svn: 182118
2013-05-17 16:17:19 +00:00
Evgeniy Stepanov
bec53faad0
[sanitizer] Fix build with Android NDK r8e.
...
llvm-svn: 182110
2013-05-17 15:22:32 +00:00
Alexander Potapenko
dd3c583211
[ASan] Make the regression test for time(NULL) Linux-specific, as it crashes on Darwin (and the problem used to occur on Linux).
...
Do not use zero-based shadow for the time() test.
llvm-svn: 182107
2013-05-17 15:11:26 +00:00
Evgeniy Stepanov
44ff0eb4b9
[sanitizer] Fix gcc build.
...
llvm-svn: 182094
2013-05-17 13:30:48 +00:00
Evgeniy Stepanov
ff6728f2f8
[msan] Unpoison dlpi_name in dl_iterate_phdr interceptor.
...
llvm-svn: 182093
2013-05-17 12:51:13 +00:00
Dmitry Vyukov
9ff1023816
tsan: remove "printing report from signal handler. Can crash or hang" output
...
it was added to debug mysterious hangs, but it does not seem to happen anymore
now it only clutter up output
llvm-svn: 182089
2013-05-17 12:05:44 +00:00
Dmitry Vyukov
c9af818515
tsan: introduce recursive mutex lock/unlock java interface
...
this is required to handle Object.Wait()
llvm-svn: 182088
2013-05-17 12:03:46 +00:00
Dmitry Vyukov
69c544d857
tsan: comment out debug output in test
...
llvm-svn: 182087
2013-05-17 11:54:37 +00:00
Alexander Potapenko
00b44ba778
[ASan] Fix allow_user_segv.cc on Darwin (32-bit build required a SIGBUS handler instead of the SIGSEGV one)
...
llvm-svn: 182080
2013-05-17 08:08:50 +00:00
Alexander Potapenko
12d09f3a3d
[ASan] Fix init-order-dlopen.cc to pass under Mac OS.
...
llvm-svn: 182010
2013-05-16 14:51:01 +00:00
Alexander Potapenko
3917fe0d94
[ASan] Fix interface_symbols_darwin to pass a correct flag to nm.
...
llvm-svn: 182008
2013-05-16 13:49:12 +00:00
Kostya Serebryany
21cbaee6a9
[sanitizer] fix gcc build
...
llvm-svn: 182006
2013-05-16 13:24:31 +00:00
Kostya Serebryany
aaf7275677
[asan] symbolize when possible, even if ASAN_SYMBOLIZER_PATH is not provided. On Linux this will use dl_iterate_phdr instead of /proc/self/maps, even if the symbolizer is not installed
...
llvm-svn: 182005
2013-05-16 13:04:29 +00:00
Evgeniy Stepanov
87c6ec7cfe
[msan] Intercept dl_iterate_phdr.
...
llvm-svn: 182004
2013-05-16 13:00:25 +00:00
Sergey Matveev
efb6172cb3
[sanitizer] Fix the region overflow condition in SanitizerAllocator64::PopulateFreeList().
...
llvm-svn: 182002
2013-05-16 12:58:34 +00:00
Kostya Serebryany
19eb46f4ca
[sanitizer] fix a gcc warning
...
llvm-svn: 181992
2013-05-16 08:03:26 +00:00
Kostya Serebryany
b7ca536888
[asan] fix ShadowGapTest on PowerPC64
...
llvm-svn: 181991
2013-05-16 07:54:28 +00:00
Kostya Serebryany
a551aaa944
[sanitizer] fix the GetBlockBegin overflow bug while preserving the performance optimization (use 32-bit division when possible). Improve the benchmarks that checks for performance of GetBlockBegin/GetMetaData
...
llvm-svn: 181989
2013-05-16 07:11:16 +00:00
Kostya Serebryany
ad9971d793
[sanitizer] added a test for a bug in allocator discovered by Sergey Matveev (uint32 overflow in GetBlockBegin)
...
llvm-svn: 181984
2013-05-16 05:22:50 +00:00
Bill Wendling
c054086630
Try to improve performance by using a read/write buffer instead of I/O.
...
The calls to fwrite/fread can be very expensive. GCC avoids this by using a
buffer to read and write from the file, thus limiting the number of fwrite/fread
calls.
<rdar://problem/13466086>
llvm-svn: 181924
2013-05-15 21:31:22 +00:00
Kostya Serebryany
2b824f3575
[asan] disable BuiltinLongJmpTest on PowerPC
...
llvm-svn: 181890
2013-05-15 15:01:14 +00:00
Kostya Serebryany
2b42716213
[asan] fix powerpc build and one test; fix lint
...
llvm-svn: 181881
2013-05-15 12:36:29 +00:00
Sergey Matveev
2387687788
[sanitizer] Fix Android build.
...
llvm-svn: 181796
2013-05-14 15:22:39 +00:00
Sergey Matveev
61101ba419
[sanitizer] Fixed a bug in GetListOfModules.
...
llvm-svn: 181793
2013-05-14 14:48:58 +00:00
Sergey Matveev
4b603e5c50
[sanitizer] Filtering in GetListOfModules.
...
llvm-svn: 181791
2013-05-14 14:04:06 +00:00
Evgeniy Stepanov
f1efb256f6
Add sanitizer syscall hooks to the tool's export lists.
...
llvm-svn: 181790
2013-05-14 13:55:21 +00:00
Sergey Matveev
af05543c86
[sanitizer] LibraryNameIs in sanitizer_linux
...
llvm-svn: 181787
2013-05-14 13:24:46 +00:00
Sergey Matveev
14b56186ab
[sanitizer] Minor fixes in sanitizer_common tests.
...
llvm-svn: 181786
2013-05-14 13:19:33 +00:00
Kostya Serebryany
9d987e34f7
[tsan] fix gcc build with -Wall
...
llvm-svn: 181763
2013-05-14 08:26:55 +00:00
Sergey Matveev
d9da20f56f
[sanitizer] Generic sorting in sanitizer_common.
...
llvm-svn: 181698
2013-05-13 11:58:48 +00:00
Sergey Matveev
37432e815e
[sanitizer] Fix StopTheWorld build on non-Android ARM.
...
Original patch by Abdoulaye Walsimou Gaye.
llvm-svn: 181697
2013-05-13 10:35:20 +00:00
Peter Collingbourne
53caf563a9
Try to fix Windows build too
...
llvm-svn: 181457
2013-05-08 18:15:01 +00:00
Peter Collingbourne
8e110ce57c
Try to fix the mac buildbots
...
llvm-svn: 181440
2013-05-08 15:07:12 +00:00
Peter Collingbourne
6f4be19b57
[nolibc] Change internal syscall API to remove reliance on libc's errno.
...
This change moves to a model where the error value of a system call is
potentially contained in the return value itself rather than being
implicit in errno. The helper function internal_iserror can be used
to extract the error value from a return value. On platforms other
than Linux/x86_64 this still uses errno, but other platforms are free
to port their error handling to this new model.
Differential Revision: http://llvm-reviews.chandlerc.com/D756
llvm-svn: 181436
2013-05-08 14:43:49 +00:00
Sergey Matveev
ffe38d267c
Quick fix for ASan test build on Android.
...
llvm-svn: 181429
2013-05-08 14:11:12 +00:00
Sergey Matveev
0d8cc4a2d2
[sanitizer] Fix build breakage in Go TSan.
...
llvm-svn: 181428
2013-05-08 13:59:30 +00:00
Sergey Matveev
af179b8d63
[sanitizer] Move GetStackTrace from ASan to sanitizer_common.
...
llvm-svn: 181424
2013-05-08 12:45:55 +00:00
Sergey Matveev
3704453368
[sanitizer] Fixed InitTlsSize for Android.
...
llvm-svn: 181330
2013-05-07 16:29:26 +00:00
Sergey Matveev
88d0c664ef
[sanitizer] Fixed includes in sanitizer_linux.cc for Android.
...
llvm-svn: 181327
2013-05-07 15:38:53 +00:00
Sergey Matveev
954c6ef10f
[sanitizer] Move GetThreadStackAndTls from TSan to sanitizer_common.
...
Move this function to sanitizer_common because LSan uses it too. Also, fix a bug
where the TLS range reported for main thread was off by the size of the thread
descriptor from libc (TSan doesn't care much, but for LSan it's critical).
llvm-svn: 181322
2013-05-07 14:41:43 +00:00
Evgeniy Stepanov
517118e6b4
[sanitizer] Sanitizer __internal_*stat interface.
...
With this change, __internal_*stat always expect a "struct stat *" argument.
This avoids stat/stat64 caller-side confusion (sanitizer_common tests already
made this mistake), and allows the use of __internal_fstat() as a drop-in
replacement for libc's fstat().
llvm-svn: 181311
2013-05-07 12:47:04 +00:00