Sergey Matveev
9450108430
[sanitizer] Support padding with spaces in Printf.
...
llvm-svn: 185082
2013-06-27 15:30:44 +00:00
Sergey Matveev
1c34897887
[lsan] Fix flaky test.
...
llvm-svn: 185079
2013-06-27 14:24:07 +00:00
Dmitry Vyukov
d2cd2d018f
tsan: revert dynamic symbols file to the old incorrect one
...
full proper list of dynamic symbols crashes old gold (see bug 16468).
the culprit is 'memcpy' function, if it's added to syms file, gold crashes
llvm-svn: 185078
2013-06-27 13:56:37 +00:00
Dmitry Vyukov
b7c6f49364
tsan: remove non-existent functions from syms file
...
llvm-svn: 185077
2013-06-27 13:52:50 +00:00
Evgeniy Stepanov
f5cae53057
[msan] Optionally disable 2 tests (dlopen & gethostbyname).
...
llvm-svn: 185076
2013-06-27 13:21:00 +00:00
Evgeniy Stepanov
815d3232a7
[sanitizer] Fix dirent interceptors.
...
The new version reads d_reclen for (struct dirent) size.
llvm-svn: 185067
2013-06-27 09:37:27 +00:00
Alexey Samsonov
895784a5b0
[LSan] Add the way to disable LSan at link time
...
llvm-svn: 185066
2013-06-27 09:35:50 +00:00
Alexey Samsonov
ecdcf11bd6
[TSan] try to fix Go build
...
llvm-svn: 185063
2013-06-27 07:57:53 +00:00
Alexey Samsonov
ed4594b76a
[MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't be in interface
...
llvm-svn: 185062
2013-06-27 07:50:56 +00:00
Sergey Matveev
0b2ffe30e4
[tsan] Fix build.
...
llvm-svn: 184963
2013-06-26 16:49:34 +00:00
Sergey Matveev
d109eb052b
[tsan] Move some suppressions-related code to common.
...
Factor out code to be reused in LSan. Also switch from linked list to vector.
llvm-svn: 184957
2013-06-26 15:37:14 +00:00
Evgeniy Stepanov
06d6c25141
[sanitizer] readdir and readdir_r interceptors.
...
llvm-svn: 184950
2013-06-26 15:00:53 +00:00
Kostya Serebryany
6a068a715d
[asan] initialize fake_stack lazily and increase its maximal size. This makes -fsanitize=address,use-after-return more robust: all SPEC tests pass now. In the default mode thread stacks become a bit smaller.
...
llvm-svn: 184934
2013-06-26 12:16:05 +00:00
Evgeniy Stepanov
b598c0b527
[sanitizer] Reformat line >80 chars.
...
llvm-svn: 184926
2013-06-26 09:16:45 +00:00
Evgeniy Stepanov
2c7d4d379e
[sanitizer] Fix build with OSS4 kernel headers.
...
This fixes PR16453.
llvm-svn: 184925
2013-06-26 08:16:38 +00:00
Chandler Carruth
fa95cc916f
Fix a use after free I introduced and that Bill caught in code review
...
(thanks!) by deferring the free of the filename until we finish writing
the coverage data to that file.
Bill, let me know if you'd prefer a different approach!
llvm-svn: 184895
2013-06-26 00:26:16 +00:00
Bill Wendling
90c38bcf58
Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.
...
llvm-svn: 184878
2013-06-25 21:08:40 +00:00
Dmitry Vyukov
eb95448245
tsan: add missing __attribute__((visibility("default"))) to interface functions
...
llvm-svn: 184858
2013-06-25 15:36:25 +00:00
Sergey Matveev
c3332bc8c3
[lsan] Define interceptors more correctly. Also, always clear allocated memory.
...
llvm-svn: 184849
2013-06-25 14:05:52 +00:00
Evgeniy Stepanov
982d56abb8
[sanitizer] Move log_path to common flag and use it in MSan.
...
llvm-svn: 184836
2013-06-25 13:50:44 +00:00
Chandler Carruth
a26c814953
Address a few of the issues in GCDAProfiling I noted when looking
...
through Bill's patch:
1) Correctly test the file descriptor after the sceond attempt at
creating the file.
2) Make the filename a global so that we can issue error messages from
other routines.
3) Check errno in several places and print it out so that errors are
easier to track down.
I don't really expect any of these to fix the current failures I'm
seeing, but I'm hopeful they'll at least let me debug them.
llvm-svn: 184799
2013-06-25 00:37:32 +00:00
Chandler Carruth
9fcb41d0fa
Remove the sysroot restriction from building GCDAProfiling.c.
...
We really need the C standard library to be available to implement the
profiling runtime library reasonably, and replicating everything in the
SDKs tree really isn't addressing any problems we have. Notably, all of
the sanitizer runtimes take the same approach, and this isn't a library
which could end up in a bootstrapping problem where the system headers
aren't even available.
This will hopefully prevent subsequent changes which start using various
other bits of C standard library to make things more debuggable.
llvm-svn: 184798
2013-06-25 00:37:28 +00:00
Dmitry Vyukov
5001d43dcb
tsan: make the test more robust
...
currently it episodically fails
the hypothesis it is due to racy race detection algorithm
the sleep should make it more robust
llvm-svn: 184752
2013-06-24 16:28:02 +00:00
Dmitry Vyukov
b4711b2c24
tsan: update dynamic export syms file
...
now it includes proper functions (including interceptors)
and does not include local functions that lead to build failures
llvm-svn: 184747
2013-06-24 15:17:36 +00:00
Evgeniy Stepanov
60d964d4f2
[sanitizer] Intercept sysinfo.
...
llvm-svn: 184739
2013-06-24 14:25:33 +00:00
Evgeniy Stepanov
8fb2c264a2
[sanitizer] Fix TSan build.
...
llvm-svn: 184736
2013-06-24 14:03:13 +00:00
Evgeniy Stepanov
02a7460d12
[sanitizer] Intercept inet_aton.
...
llvm-svn: 184735
2013-06-24 13:56:14 +00:00
Evgeniy Stepanov
830550ce4c
[msan] Unpoison param-tls in signal handler wrapper.
...
This an entry point from uninstrumented code.
llvm-svn: 184734
2013-06-24 13:48:42 +00:00
Evgeniy Stepanov
0e8053af08
[sanitizer] Intercept readv, preadv, writev, pwritev.
...
llvm-svn: 184717
2013-06-24 10:43:23 +00:00
Sergey Matveev
b8cd986b5d
[lsan] Fix android build.
...
llvm-svn: 184704
2013-06-24 09:12:11 +00:00
Sergey Matveev
4e0215a71c
Revert to C-style callbacks for iteration over allocator chunks.
...
Also clean up LSan code, fix some comments and replace void* with uptr
to bring down the number of reinterpret_casts.
llvm-svn: 184700
2013-06-24 08:34:50 +00:00
Alexey Samsonov
43937b3758
Add cmake rules for building LSan common on Mac OS
...
llvm-svn: 184639
2013-06-22 16:33:52 +00:00
Sergey Matveev
38fa1ff710
[lsan] Try REALLY hard to fix Win build.
...
llvm-svn: 184557
2013-06-21 15:50:49 +00:00
Sergey Matveev
85f1fffdfb
[lsan] This time really fix Win build.
...
llvm-svn: 184556
2013-06-21 15:22:12 +00:00
Sergey Matveev
7ed5c687ed
[lsan] Fix win build.
...
llvm-svn: 184555
2013-06-21 15:14:57 +00:00
Sergey Matveev
d28c03c03a
[lsan] Increase allocator space; minor fixes.
...
llvm-svn: 184554
2013-06-21 15:10:20 +00:00
Sergey Matveev
b94d5e2d1c
[asan] Move lsan_disabled out of thread context.
...
Fix for the case where disabler is used in pthread key destructor.
llvm-svn: 184553
2013-06-21 14:51:52 +00:00
Alexey Samsonov
a9db3f9757
[ASan] reimplement strdup() interceptor to get nicer stack traces for memory chunks allocated there
...
llvm-svn: 184546
2013-06-21 14:41:59 +00:00
Evgeniy Stepanov
b58b72e151
[msan] Intercept (v)asprintf.
...
llvm-svn: 184545
2013-06-21 13:32:26 +00:00
Evgeniy Stepanov
ae4e1ec4e6
[msan] Add keep_going runtime flag.
...
llvm-svn: 184542
2013-06-21 12:37:58 +00:00
Alexey Samsonov
f9e6624663
[ASan] make test for LSan annotations Linux-only for now
...
llvm-svn: 184541
2013-06-21 12:18:52 +00:00
Alexey Samsonov
ad25b50a89
[ASan] Check that ASan user may include and use LSan headers
...
llvm-svn: 184540
2013-06-21 11:11:44 +00:00
Evgeniy Stepanov
57a40e5a94
[santizer] Disable several EVIOxxx ioctls on older kernels.
...
llvm-svn: 184539
2013-06-21 10:54:57 +00:00
Dmitry Vyukov
03ec9545f5
tsan: fix potential false positive race on fd
...
llvm-svn: 184430
2013-06-20 14:32:12 +00:00
Sergey Matveev
5e6b9eccce
[asan] Define LSan annotations as no-ops if leak detection is not supported.
...
llvm-svn: 184422
2013-06-20 13:39:42 +00:00
Evgeniy Stepanov
673cf23d06
Fix unused function warning w/o changing compiler flags.
...
We have way too many different build systems.
llvm-svn: 184409
2013-06-20 09:45:36 +00:00
Evgeniy Stepanov
3ce228faf3
[sanitizer] Fix Mac build.
...
llvm-svn: 184407
2013-06-20 09:39:34 +00:00
Evgeniy Stepanov
d271563e5a
Remove an outdated comment.
...
llvm-svn: 184406
2013-06-20 09:21:25 +00:00
Evgeniy Stepanov
fbea5b95c6
[sanitizer] Handle EVIOxxxx ioctls.
...
llvm-svn: 184405
2013-06-20 09:19:28 +00:00
Alexey Samsonov
686c229b03
[ASan] Clear allocation magic value before recycling the chunk. This led to spurious crashes in LSan when it walked through reused chunks. Don't know how to create not-brittle test case for this.
...
llvm-svn: 184404
2013-06-20 08:13:06 +00:00
Sergey Matveev
7014179ccb
[lsan] Prevent inlining of WipeStack().
...
llvm-svn: 184312
2013-06-19 15:39:13 +00:00
Sergey Matveev
dac35c24c0
[lsan] Move symbolization and reporting out of StopTheWorld callback.
...
llvm-svn: 184303
2013-06-19 14:04:11 +00:00
Evgeniy Stepanov
49b4314cfd
[sanitizer] Fix struct ifconf definition on Mac and restore the size checks.
...
llvm-svn: 184296
2013-06-19 13:21:38 +00:00
Alexander Potapenko
29b9fcf0a8
[ASan] Delete excessive 'extern "C"' around mlock* interceptors.
...
llvm-svn: 184294
2013-06-19 11:36:51 +00:00
Evgeniy Stepanov
41060fd728
[sanitizer] Fix Android build.
...
llvm-svn: 184293
2013-06-19 10:36:31 +00:00
Evgeniy Stepanov
f9cfe76526
[sanitizer] Fix build on RHEL 6.3, 6.4.
...
linux/if_ppp.h is broken in certain kernels.
llvm-svn: 184290
2013-06-19 08:55:28 +00:00
Kostya Serebryany
63d84f8149
[asan] fix a rare failure in fast unwinder, found by asan/clang bootstrap
...
llvm-svn: 184190
2013-06-18 14:47:40 +00:00
Sergey Matveev
2717e7be06
[lsan] Set current_thread_tid correctly for main thread.
...
llvm-svn: 184189
2013-06-18 14:44:45 +00:00
Evgeniy Stepanov
394b09b00f
[sanitizer] Fix Android build.
...
llvm-svn: 184187
2013-06-18 13:56:12 +00:00
Evgeniy Stepanov
fc3f61fcf0
[sanitizer] Remove a set of deprecated ioctls.
...
llvm-svn: 184185
2013-06-18 10:37:17 +00:00
Evgeniy Stepanov
b9c1020696
[sanitizer] Replace ext2_ ioctls with generic fs_ ioctls.
...
They are actually the same, but ext2_fs.h header is not available in userspace
with newer kernels.
llvm-svn: 184184
2013-06-18 09:49:04 +00:00
Evgeniy Stepanov
8fa046e288
[sanitizer] Symbolic ioctl names.
...
Replace hardcoded ioctl request ids with symbolic names.
Disable certain ioctls on platforms where such names are not found in the
system headers.
Fix a bug in ioctl_lookup.
Reenable ioctl test on Mac.
llvm-svn: 184183
2013-06-18 09:22:24 +00:00
Dmitry Vyukov
5cf581a8d4
tsan: consistently use return pc as top frame pc
...
always substract 1 from the top pc
this allows to get correct stacks with -O2
llvm-svn: 184112
2013-06-17 19:57:03 +00:00
Alexey Samsonov
7e325fb477
Properly install LSan interface header, rely on sanitizer header presence in lit tests
...
llvm-svn: 183977
2013-06-14 11:45:36 +00:00
Alexey Samsonov
0d7012debb
[TSan] use InternalMmapVector to store fired suppressions
...
llvm-svn: 183974
2013-06-14 11:18:58 +00:00
Alexey Samsonov
bd0428b81a
[LSan] Use a typedef for frontier vector
...
llvm-svn: 183973
2013-06-14 10:07:56 +00:00
Alexey Samsonov
b0d92b3312
[Sanitizer] Rename InternalVector to InternalMmapVector
...
llvm-svn: 183972
2013-06-14 09:59:40 +00:00
Dmitry Vyukov
26daccaddb
tsan: fix Windows Go crash
...
llvm-svn: 183898
2013-06-13 10:15:44 +00:00
Alexey Samsonov
5e520c5e09
[LSan] fix link flags for building unit tests
...
llvm-svn: 183891
2013-06-13 07:23:18 +00:00
Richard Trieu
5685aa6845
Fix broken header guard.
...
llvm-svn: 183873
2013-06-12 22:37:22 +00:00
Sergey Matveev
978460c12c
[lsan] Harmonized some naming inconsistencies.
...
llvm-svn: 183748
2013-06-11 15:26:20 +00:00
Dmitry Vyukov
a8570d38fe
tsan: add -Wno-maybe-uninitialized to Go build script
...
this is how the rest of the codebase is built
llvm-svn: 183738
2013-06-11 11:44:43 +00:00
Sergey Matveev
5129c5e56f
[lsan] Fix the unittest makefiles.
...
llvm-svn: 183735
2013-06-11 09:52:02 +00:00
Alexey Samsonov
bc1c6714f2
[Sanitizer] add file forgotten in r183730
...
llvm-svn: 183732
2013-06-11 08:14:24 +00:00
Alexey Samsonov
c8e7364763
[Sanitizer] support running external llvm-symbolizer on Mac
...
llvm-svn: 183730
2013-06-11 08:13:36 +00:00
Dmitry Vyukov
79de34f75c
tsan: fix lit test failures
...
llvm-svn: 183674
2013-06-10 16:06:21 +00:00
Dmitry Vyukov
b08e72913a
tsan: add system tests for suppressions
...
llvm-svn: 183673
2013-06-10 15:39:28 +00:00
Dmitry Vyukov
315bb0e687
tsan: allows to suppress races on global variables
...
llvm-svn: 183672
2013-06-10 15:38:44 +00:00
Alexander Potapenko
152f7edf24
[ASan] Fix unset-insert-libraries-on-exec.cc on 32-bit Darwin.
...
The test used to execute a 64-bit /bin/bash binary and preload a 32-bit dynamic library into it.
Now the arch-specific version of echo-env is executed instead.
llvm-svn: 183662
2013-06-10 14:47:43 +00:00
Alexey Samsonov
f67191b4c3
[ASan] mark ioctl test as xfailing on darwin. remove redundant semicolons
...
llvm-svn: 183655
2013-06-10 14:17:08 +00:00
Kostya Serebryany
02062becea
[asan] fix Android build (mark asan_malloc_usable_size as an interface function)
...
llvm-svn: 183651
2013-06-10 13:28:33 +00:00
Dmitry Vyukov
b19a26b852
tsan: disable getaddrinfo() interceptor for tsan (causes recursion)
...
llvm-svn: 183649
2013-06-10 11:35:08 +00:00
Dmitry Vyukov
7e4a18c4fb
tsan: fix merge bug
...
llvm-svn: 183648
2013-06-10 11:11:29 +00:00
Kostya Serebryany
e71982d589
[asan] fix the bug with memalign and malloc_usable_size ( http://code.google.com/p/address-sanitizer/issues/detail?id=193 ); also fix lint
...
llvm-svn: 183647
2013-06-10 10:46:27 +00:00
Dmitry Vyukov
b278f1235f
tsan: fix windows crash (incorrect stack boundaries)
...
llvm-svn: 183646
2013-06-10 10:30:54 +00:00
Dmitry Vyukov
ddb0294dd8
tsan: fix old gcc warnings
...
llvm-svn: 183645
2013-06-10 10:30:19 +00:00
Dmitry Vyukov
e979c5467c
tsan: fix windows mingw build
...
llvm-svn: 183644
2013-06-10 10:02:02 +00:00
Dmitry Vyukov
8794772337
tsan: more detailed trace for atomic operations (include address and memory ordering)
...
llvm-svn: 183643
2013-06-10 10:01:31 +00:00
Dmitry Vyukov
50ef53ebfc
tsan: fix lint warnings
...
llvm-svn: 183642
2013-06-10 10:00:54 +00:00
Alexey Samsonov
dd489a4e15
[MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
...
llvm-svn: 183641
2013-06-10 09:09:40 +00:00
Alexey Samsonov
4c0ea93725
[ASan] don't use -m{32,64} flag in test case, as it can be run in both 32- and 64-bit modes
...
llvm-svn: 183638
2013-06-10 07:55:12 +00:00
Bill Wendling
658fb53b7e
Reverting r183529:
...
This is causing the following error on Darwin:
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:282:1: error: 'assertion_failed__282' declared as an array with a negative size
CHECK_TYPE_SIZE(ifconf);
^~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:223:3: note: expanded from macro 'CHECK_TYPE_SIZE'
COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
^~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:284:1: error: 'assertion_failed__284' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:228:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
^~~~~~~~~~~~~~~
llvm-svn: 183557
2013-06-07 20:28:29 +00:00
Evgeniy Stepanov
cead69d4a3
[sanitizer] Handle SIOCGIFCONF ioctl.
...
llvm-svn: 183529
2013-06-07 15:49:38 +00:00
Alexey Samsonov
4fdf8d66a9
[ASan] fix test case to use absolute paths
...
llvm-svn: 183527
2013-06-07 15:44:21 +00:00
Alexander Potapenko
6af3fce55e
[ASan] An early return from InitializeAsanInterceptors() on Mac has been considered unobvious.
...
Remove it and replace ASAN_INTERCEPT_FUNC with a no-op if SANITIZER_MAC==1.
llvm-svn: 183524
2013-06-07 15:10:02 +00:00
Evgeniy Stepanov
c24e13e7bb
[sanitizer] Fix Android build.
...
llvm-svn: 183523
2013-06-07 14:56:54 +00:00
Evgeniy Stepanov
74dcb1a8de
[sanitizer] Fix windows build.
...
llvm-svn: 183518
2013-06-07 13:19:33 +00:00
Evgeniy Stepanov
0b1f41b6f4
[sanitizer] ioctl interceptor.
...
ASan: disabled by default
MSan: enabled by default
TSan: disabled
llvm-svn: 183517
2013-06-07 13:00:47 +00:00
Alexey Samsonov
575c599554
Drop support for 32-bit PowerPC in sanitizer tools.
...
llvm-svn: 183499
2013-06-07 09:44:43 +00:00
Alexey Samsonov
889e3ab83c
[ASan] create separate configs for running ASan lit tests in both 32- and 64-bit mode. Clean up RUN-lines in tests.
...
llvm-svn: 183498
2013-06-07 09:38:55 +00:00
Sergey Matveev
1c4e214c32
[lsan] Put SANITIZER_INTERFACE_ATTRIBUTE on LSan interface functions.
...
llvm-svn: 183429
2013-06-06 18:40:55 +00:00
Dmitry Vyukov
0fffc0088c
tsan: use memory access size for Go after all
...
helps to make range access functions correct and fast
llvm-svn: 183418
2013-06-06 14:31:15 +00:00
Sergey Matveev
db356560fc
[sanitizer] Do not fall back to SlowUnwindStack() in GetStackTrace()
...
llvm-svn: 183414
2013-06-06 14:19:36 +00:00
Sergey Matveev
ecc4f5ba8e
[lsan] Implement __lsan_ignore_object().
...
Leak annotation similar to HeapChecker's IgnoreObject().
llvm-svn: 183412
2013-06-06 14:17:56 +00:00
Alexey Samsonov
e674320ade
[ASan] make pthread_getschedparam test more robust
...
llvm-svn: 183411
2013-06-06 14:08:40 +00:00
Alexey Samsonov
f6630ecee9
Simplify lit configs for asan/lsan/msan unit tests
...
llvm-svn: 183410
2013-06-06 13:48:20 +00:00
Dmitry Vyukov
5fe8a4f88f
tsan: always strip bottom frame in Go reports
...
llvm-svn: 183408
2013-06-06 13:31:35 +00:00
Alexey Samsonov
e3bf521b7c
Remove a bunch of copy-paste: use common config for sanitizer lit/unit tests
...
llvm-svn: 183407
2013-06-06 13:28:37 +00:00
Dmitry Vyukov
ce0247c93e
tsan: fix darwin Go crashes
...
llvm-svn: 183405
2013-06-06 13:20:40 +00:00
Dmitry Vyukov
c9e304afbd
tsan: fix darwin Go build
...
llvm-svn: 183402
2013-06-06 13:00:32 +00:00
Alexey Samsonov
c05aba7eaa
[ASan] create common autogenerated config for running compiler-rt unit tests, and use it in ASan
...
llvm-svn: 183401
2013-06-06 12:48:20 +00:00
Alexey Samsonov
6a65b18992
[ASan] lit tests: create common autogenerated config for running compiler-rt lit tests, and use it in ASan
...
llvm-svn: 183400
2013-06-06 12:35:48 +00:00
Alexey Samsonov
2874f70250
[ASan] move all lit_tests under TestCases
...
llvm-svn: 183395
2013-06-06 09:23:34 +00:00
Alexey Samsonov
b42b2f5c69
[ASan] Add a few tests for use-after-scope mode
...
llvm-svn: 183391
2013-06-06 08:30:26 +00:00
Alexey Samsonov
7a75e16c27
[ASan] One more fix for realloc: check that reallocated chunk is valid before calling memcpy
...
llvm-svn: 183390
2013-06-06 08:25:31 +00:00
Alexey Samsonov
87a59e5652
[ASan] make free_hook_realloc test more robust
...
llvm-svn: 183387
2013-06-06 07:58:00 +00:00
Evgeniy Stepanov
863746eb1a
[sanitizer] Fix windows build.
...
llvm-svn: 183225
2013-06-04 14:06:16 +00:00
Evgeniy Stepanov
56050e8f69
[sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.
...
llvm-svn: 183224
2013-06-04 13:49:10 +00:00
Evgeniy Stepanov
53c8c13bf1
[msan] Implement __sanitizer_unaligned_*.
...
llvm-svn: 183221
2013-06-04 13:08:36 +00:00
Alexey Samsonov
8f5138a23f
Call __asan_free_hook() before marking the chunk quarantinned
...
Summary:
With this change, the user may safely call __asan_get_ownership()
from malloc/free hooks and assume it would return "true". If there is a
realloc/free race, free hook might be called twice, but I think it's acceptable,
as it's a data race and would later be reported anyway.
This change also fixes a bug when failing realloc incorrectly marked the
original memory as "quarantinned".
Reviewers: timurrrr, kcc, samsonov
Reviewed By: samsonov
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D913
llvm-svn: 183220
2013-06-04 12:19:31 +00:00
Sergey Matveev
b256ac7584
[asan] Fix invalid thread registry access when checking if LSan is disabled.
...
llvm-svn: 183218
2013-06-04 10:39:24 +00:00
Timur Iskhodzhanov
baf90ccfac
Fix ALIGNED misuse in asan_thread.cc (built on all platforms); also, add a comment to the ALIGNED macro describing the correct usage
...
llvm-svn: 183214
2013-06-04 08:25:17 +00:00
Kostya Serebryany
c1aa0e8f69
[asan] ASan Linux MIPS32 support (compiler-rt part), patch by Jyun-Yan Y
...
llvm-svn: 183105
2013-06-03 14:49:25 +00:00
Sergey Matveev
17ee1abfa7
[lsan] Add __lsan_disable() and __lsan_enable().
...
Objects allocated after a call to __lsan_disable() will be treated as
live memory. Also add a ScopedDisabler.
llvm-svn: 183099
2013-06-03 11:21:34 +00:00
Sergey Matveev
3786ae5c54
[sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.
...
Address issue reported by Greg Fitzgerald.
llvm-svn: 183098
2013-06-03 10:20:23 +00:00
Alexander Potapenko
41cd6102e9
[ASan] Do not buffer stdin in asan_symbolize.py
...
llvm-svn: 183006
2013-05-31 14:55:06 +00:00
Sergey Matveev
1a566ced91
[lsan] Added a dummy unittest to suppress LIT warnings.
...
llvm-svn: 183004
2013-05-31 14:15:54 +00:00
Sergey Matveev
5494e0bec3
[lsan] Run the leak detection tests under both ASan and LSan.
...
Change the LSan lit test logic. Now "check-lsan" tests the leak
checking functionality in both standalone LSan and ASan.
llvm-svn: 183000
2013-05-31 13:13:55 +00:00
Evgeniy Stepanov
4717d2d494
[msan] Fix gcc build of msan runtime.
...
llvm-svn: 182999
2013-05-31 13:04:07 +00:00
Evgeniy Stepanov
96284becf4
[msan] Handle mixed track-origins and keep-going settings (compiler-rt part).
...
Before this change, each module defined a weak_odr global __msan_track_origins
with a value of 1 if origin tracking is enabled, 0 if disabled. If there are
modules with different values, any of them may win. If 0 wins, and there is at
least one module with 1, the program will most likely crash.
With this change, __msan_track_origins is only emitted if origin tracking is
on. Then runtime library detects if there is at least one module with origin
tracking, and enables runtime support for it.
llvm-svn: 182996
2013-05-31 12:04:08 +00:00
Sergey Matveev
53c24fe0e6
[sanitizer] Fix r182994 - update test.
...
llvm-svn: 182995
2013-05-31 11:33:21 +00:00
Sergey Matveev
69f11803ec
[lsan] Use the fast version of GetBlockBegin for leak checking in LSan and ASan.
...
llvm-svn: 182994
2013-05-31 11:13:45 +00:00
Evgeniy Stepanov
1cf5ef5018
[sanitizer] Fix wrong size of addrinfo::ai_addrlen.
...
Add compile time tests for sizes and offsets of all sanitizer-posix types.
llvm-svn: 182993
2013-05-31 10:46:51 +00:00
Kostya Serebryany
3a7c6d689d
[asan] workaround for the quemu bug in proc maps ( http://code.google.com/p/address-sanitizer/issues/detail?id=160 )
...
llvm-svn: 182922
2013-05-30 11:00:08 +00:00
Alexey Samsonov
2a6cc67225
Fix #if guards in sanitizer_common code
...
llvm-svn: 182918
2013-05-30 09:16:04 +00:00
Kostya Serebryany
831a1d7cec
[sanitizer] introduce LargeMmapAllocator::GetBlockBeginFastSingleThreaded, required for LeakSanitizer to work faster. Also fix lint.
...
llvm-svn: 182917
2013-05-30 08:43:30 +00:00
Alexander Potapenko
a8b41762e4
[ASan] Minor cleanup: remove a couple of unused variables.
...
llvm-svn: 182915
2013-05-30 07:30:07 +00:00
Timur Iskhodzhanov
013da5cb37
Replaced 'bool .* = 0;' with '... = false;'
...
llvm-svn: 182868
2013-05-29 17:26:25 +00:00
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