Dmitry Vyukov
3431b38067
tsan: minor refactoring
...
Replace duplicate code snippet with function.
llvm-svn: 192357
2013-10-10 16:03:24 +00:00
Dmitry Vyukov
fbb194ff34
tsan: add annotations to ignore synchronization operations
...
The annotations are AnnotateIgnoreSyncBegin/End,
may be useful to ignore some infrastructure synchronization
that introduces lots of false negatives.
llvm-svn: 192355
2013-10-10 15:58:12 +00:00
Sergey Matveev
6f7fb43ad3
[sanitizer] Fix the parent liveness check in StopTheWorld.
...
Comparing the parent PID with 1 isn't sufficient to ensure the parent is alive,
because of prctl(PR_SET_CHILD_SUBREAPER, ...). Compare with the real parent's
recorded PID instead.
llvm-svn: 192295
2013-10-09 13:36:20 +00:00
Sergey Matveev
adef754297
[sanitizer] Fix deadlock in StopTheWorld.
...
The tracer thread in StopTheWorld could wait on a mutex forever if the parent
process died before unlocking it. Use PR_SET_PDEATHSIG so that the parent would
kill the child in this scenario.
llvm-svn: 192210
2013-10-08 18:01:03 +00:00
Sergey Matveev
398fb700a2
[sanitizer] Do not break the CFI unwind chain in clone().
...
Fixes build on clang 3.2, which doesn't support cfi_undefined. This change
doesn't seem to break the slow unwinder. Even if it does, the worst thing that
could happen is that we would not see a backtrace when a fatal error happens
under StopTheWorld.
llvm-svn: 192196
2013-10-08 16:38:39 +00:00
Alexey Samsonov
50ec07c196
[TSan] Automatically pick up llvm-symbolizer from PATH, as we do in another sanitizers
...
llvm-svn: 191954
2013-10-04 13:38:35 +00:00
Alexey Samsonov
12f5e639d6
[TSan] Add ValgrindSlowdown to the list of exported symbols
...
llvm-svn: 191952
2013-10-04 13:12:05 +00:00
Dmitry Vyukov
513a3a6c0b
tsan: fix a bug in pthread_once when called from an ignored library
...
It must set thr->in_rtl = 0 before executing user callback.
llvm-svn: 191946
2013-10-04 10:27:21 +00:00
Alexey Samsonov
f2b811a618
Refactor the usage of strip_path_prefix option and make it more consistent across sanitizers
...
llvm-svn: 191943
2013-10-04 08:55:03 +00:00
Dmitry Vyukov
302ec7b9bc
tsan: add memory_limit_mb flag
...
The flag allows to bound maximum process memory consumption (best effort).
If RSS reaches memory_limit_mb, tsan flushes all shadow memory.
llvm-svn: 191913
2013-10-03 17:14:35 +00:00
Dmitry Vyukov
c967d2f49c
asan/msan/tsan: fix broken linux syscalls
...
Currently the following source code:
u64 NanoTime() {
kernel_timeval tv = {};
internal_syscall(__NR_gettimeofday, &tv, 0);
return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000;
}
generates the following assembly:
Dump of assembler code for function __sanitizer::NanoTime():
=> 0x00007ff30657d380 <+0>: lea -0x10(%rsp),%rdi
0x00007ff30657d385 <+5>: xor %esi,%esi
0x00007ff30657d387 <+7>: mov $0x60,%eax
0x00007ff30657d38c <+12>: syscall
0x00007ff30657d38e <+14>: mov $0,%eax
0x00007ff30657d393 <+19>: retq
with this change:
Dump of assembler code for function __sanitizer::NanoTime():
=> 0x00007faab834f380 <+0>: movq $0x0,-0x10(%rsp)
0x00007faab834f389 <+9>: movq $0x0,-0x8(%rsp)
0x00007faab834f392 <+18>: lea -0x10(%rsp),%rdi
0x00007faab834f397 <+23>: xor %esi,%esi
0x00007faab834f399 <+25>: mov $0x60,%eax
0x00007faab834f39e <+30>: syscall
0x00007faab834f3a0 <+32>: mov -0x8(%rsp),%rax
0x00007faab834f3a5 <+37>: mov -0x10(%rsp),%rcx
0x00007faab834f3aa <+42>: imul $0x3e8,%rax,%rdx
0x00007faab834f3b1 <+49>: imul $0x3b9aca00,%rcx,%rax
0x00007faab834f3b8 <+56>: add %rdx,%rax
0x00007faab834f3bb <+59>: retq
llvm-svn: 191908
2013-10-03 16:53:50 +00:00
Dmitry Vyukov
19a1302046
asan/msan: fix "unused function 'OnExit'" warning
...
llvm-svn: 191904
2013-10-03 15:43:59 +00:00
Dmitry Vyukov
fdfb2ade8f
asan/msan/tsan: move _exit interceptor to common interceptors
...
llvm-svn: 191903
2013-10-03 15:22:29 +00:00
Dmitry Vyukov
bfe7bb7034
tsan: include lsan into presubmit check
...
llvm-svn: 191902
2013-10-03 14:56:08 +00:00
Dmitry Vyukov
83ebd022d7
tsan: fix false positive in localtime()
...
llvm-svn: 191899
2013-10-03 14:12:09 +00:00
Dmitry Vyukov
e07dc7d1fe
tsan: intercept _exit so that we can override exit status
...
llvm-svn: 191898
2013-10-03 14:00:46 +00:00
Dmitry Vyukov
5ba736457c
tsan: ignore interceptors coming from specified libraries
...
LibIgnore allows to ignore all interceptors called from a particular set
of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions
from the provided SuppressionContext; finds code ranges for the libraries;
and checks whether the provided PC value belongs to the code ranges.
Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of
SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib,
then must call our internal allocator instead of libc malloc.
llvm-svn: 191897
2013-10-03 13:37:17 +00:00
Evgeniy Stepanov
c907a60ffb
[sanitizer] Fix localtime and gmtime interceptors to clean tm->tm_zone.
...
llvm-svn: 191827
2013-10-02 14:30:03 +00:00
Dmitry Vyukov
945397157b
tsan: fix the following compiler warning
...
sanitizer_common_interceptors.inc:1142:53: warning: invoking macro INTERCEPTOR argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98 [enabled by default]
llvm-svn: 191822
2013-10-02 14:04:23 +00:00
Dmitry Vyukov
af335eddfe
msan: fix compiler warnings about unused variables
...
llvm-svn: 191821
2013-10-02 14:02:08 +00:00
Dmitry Vyukov
8358c41477
tsan: use ninja instead of make (faster and less output)
...
llvm-svn: 191819
2013-10-02 12:57:43 +00:00
Nick Lewycky
f60d8ae155
This fixme is resolved, fix the test.
...
llvm-svn: 191810
2013-10-02 05:05:28 +00:00
Nick Lewycky
b7aa592c19
Make the InvalidValueData take a SourceLocation.
...
llvm-svn: 191807
2013-10-02 02:29:47 +00:00
Alexey Samsonov
3b54a83d26
[LSan] Rework r191522 - treat allocations with short stack traces as live
...
llvm-svn: 191662
2013-09-30 10:57:56 +00:00
Alexey Samsonov
f56ddf7fd1
[LSan] Don't report leaks with single-frame stack traces
...
llvm-svn: 191522
2013-09-27 13:54:20 +00:00
Evgeniy Stepanov
01781722b6
[sanitizer] Intercept backtrace, backtrace_symbols.
...
llvm-svn: 191516
2013-09-27 12:40:23 +00:00
Kostya Serebryany
3c42ce1516
[asan] introduce run-time flag uar_stack_size_log to control the size of FakeStack; don't crash when the fake stack is exhausted, move some code to .cc file
...
llvm-svn: 191510
2013-09-27 11:37:23 +00:00
Evgeniy Stepanov
022235cf04
[msan] Unpoison argument shadow for C++ module destructors.
...
Fixes PR17377.
llvm-svn: 191508
2013-09-27 11:32:21 +00:00
Dmitry Vyukov
439a904515
tsan: support allocator_may_return_null flag
...
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=29
llvm-svn: 191482
2013-09-27 02:31:23 +00:00
Dmitry Vyukov
e435f94b69
tsan: fix scanf interceptor
...
llvm-svn: 191445
2013-09-26 18:38:54 +00:00
Evgeniy Stepanov
8f27f6b549
[sanitizer] A bunch of libc interceptors.
...
sigwait
sigwaitinfo
sigtimedwait
sigemptyset
sigfillset
sigpending
sigprocmask
llvm-svn: 191374
2013-09-25 14:47:43 +00:00
Alexey Samsonov
4fc53e4c06
[Sanitizer] Don't include wordexp.h on Android
...
llvm-svn: 191358
2013-09-25 07:41:46 +00:00
Evgeniy Stepanov
2761ee0409
[sanitizer] Intercept wordexp.
...
llvm-svn: 191305
2013-09-24 14:38:22 +00:00
Alexander Potapenko
ae49e8c34a
[ASan] Fix GCD tests by spinning forever in the main thread.
...
Since the error is always reported by one of the GCD workers, this will help avoid premature program termination with exit code 0.
llvm-svn: 191294
2013-09-24 12:42:25 +00:00
Evgeniy Stepanov
46901f613b
[msan] Test for atomic handling in MSan.
...
llvm-svn: 191288
2013-09-24 11:21:16 +00:00
Kostya Serebryany
01ff028814
[asan] remove -fsanitize=use-after-return from the tests (this flag now comes with asan by default)
...
llvm-svn: 191204
2013-09-23 14:34:06 +00:00
Evgeniy Stepanov
ce72b2c20b
[msan] Fix a WTF in r191196.
...
llvm-svn: 191197
2013-09-23 13:34:26 +00:00
Evgeniy Stepanov
f497bfee76
[msan] Allow nested symbolizer and loader scopes.
...
llvm-svn: 191196
2013-09-23 13:26:31 +00:00
Timur Iskhodzhanov
7f92aa687a
[ASan/Win] Slightly optimize the DLL thunk
...
llvm-svn: 191190
2013-09-23 11:40:58 +00:00
Timur Iskhodzhanov
e2b207cfd2
[ASan] Fix a compile-time warning
...
llvm-svn: 191189
2013-09-23 11:19:43 +00:00
Timur Iskhodzhanov
d6c93c7b4d
[ASan] Add DLL thunks for the new stack UAR interface
...
llvm-svn: 191188
2013-09-23 11:05:41 +00:00
Alexander Potapenko
92b566b0e4
[ASan] Fix the interface test on Darwin.
...
llvm-svn: 191187
2013-09-23 10:38:23 +00:00
Kostya Serebryany
b997c543fc
[asan] disable the detect_stack_use_after_return run-time flag by default and enable it explicitly in tests. This is done in preparation to enabling the -fsanitize=use-after-return compile-time flag by default when -fsanitize=address is present.
...
llvm-svn: 191184
2013-09-23 08:58:14 +00:00
Dmitry Vyukov
2ea2d9cb29
tsan: remove unneeded ___chkstk_ms function from Go runtime
...
llvm-svn: 191161
2013-09-22 02:49:56 +00:00
Dmitry Vyukov
a2c6e1e80f
tsan: allow symbolization of non-native PCs, e.g. coming from JIT/JAVA/etc
...
llvm-svn: 191157
2013-09-22 00:14:57 +00:00
Dmitry Vyukov
76ec1910ac
tsan: ignore malloc/free/strdup when called from libjvm
...
llvm-svn: 191153
2013-09-21 23:44:19 +00:00
Dmitry Vyukov
150406bbf3
tsan: ignore all interceptors coming directly from JVM
...
llvm-svn: 191152
2013-09-21 23:06:00 +00:00
Dmitry Vyukov
017015c9ed
tsan: improve diagnostics for incorrect usages of mutexes
...
llvm-svn: 191151
2013-09-21 22:43:27 +00:00
Dmitry Vyukov
4e9c091dd7
tsan: allow to obtain code range for a particular module
...
this is required to ignore interceptors when called from the module
llvm-svn: 191149
2013-09-21 21:41:08 +00:00
Dmitry Vyukov
1da6b4d5c8
tsan: intercept fork syscall
...
llvm-svn: 191144
2013-09-21 20:59:04 +00:00
Dmitry Vyukov
3d15bcca1d
tsan: do not try to use builtin atomic operations
...
see the comment in code
llvm-svn: 191132
2013-09-21 04:59:02 +00:00
Dmitry Vyukov
a182592aa0
tsan: intercept close syscall
...
llvm-svn: 191129
2013-09-21 03:47:35 +00:00
Alexander Potapenko
6c49695e7a
[ASan] Remove a complex multiline comment that baffles lint.
...
That comment is repeated in another function below.
llvm-svn: 191085
2013-09-20 11:33:14 +00:00
Alexander Potapenko
d1bae72e39
[libsanitizer] Pass an explicit template to mktemp. Running mktemp without a template doesn't work on Darwin.
...
llvm-svn: 191084
2013-09-20 11:29:44 +00:00
Alexander Potapenko
bff7e64a3f
[ASan] Fix compilation of asan_str_test.cc on non-Darwin.
...
llvm-svn: 191083
2013-09-20 11:03:27 +00:00
Alexander Potapenko
7be1a632b2
[ASan] Enforce the memmove semantics for both memcpy() and memmove() interceptors on Darwin.
...
Due to bugs in the interposition of resolver functions on 10.7 and 10.8 both memcpy() and memmove()
were previously intercepted by INTERCEPTOR(memcpy), which led to false positives and crashes (see http://llvm.org/bugs/show_bug.cgi?id=16362 )
We choose to use a memmove-like function in both cases. This effectively disables the overlap checks in memcpy(), but the overlaps
aren't possible in practice, because memcpy() and memmove() are the same function on Darwin.
Once the interposition is fixed in 10.9, we'll need to revisit this issue, see https://code.google.com/p/address-sanitizer/issues/detail?id=226
llvm-svn: 191081
2013-09-20 10:56:34 +00:00
Kostya Serebryany
2ab5a48dbe
[asan] nuke yet another async-signal-safety bug in UAR (oh, my)
...
llvm-svn: 191080
2013-09-20 09:16:21 +00:00
Alexey Samsonov
29d7be1f68
[Sanitizer] Add pthread_cond_init to the list of versioned functions
...
llvm-svn: 191078
2013-09-20 08:37:57 +00:00
Dmitry Vyukov
481d90c480
tsan: handle memory read/write in syscalls
...
llvm-svn: 191074
2013-09-20 06:54:14 +00:00
Dmitry Vyukov
c7547d0527
tsan: allow to ignore memory accesses in malloc and free
...
llvm-svn: 191072
2013-09-20 05:37:36 +00:00
Dmitry Vyukov
20f6ff1e66
tsan: do not crash when user intercepts fopen()
...
llvm-svn: 191066
2013-09-20 02:01:38 +00:00
Dmitry Vyukov
b523b9c8d4
tsan: fix linking of tsan runtime into dynamic libraries
...
versioned symbols can not be linked into dynamic library w/o linker script
also simplifies code as side effect
llvm-svn: 191056
2013-09-19 23:44:51 +00:00
Alexander Potapenko
8f5d907aea
[ASan] Fix init-order-dlopen.cc test to not depend on the -Wl,-undefined,dynamic_lookup being passed to the linker.
...
llvm-svn: 191012
2013-09-19 17:12:45 +00:00
Kostya Serebryany
f8bbdfaf95
[asan] fix one more async-signal-safety issue with use-after-return
...
llvm-svn: 191004
2013-09-19 14:59:52 +00:00
Alexey Samsonov
786ee9b1ad
[MSan] Fix -Wempty-body warning
...
llvm-svn: 190994
2013-09-19 08:35:16 +00:00
Alexey Samsonov
1c5cd7516f
[TSan] Fix -Wempty-body warning
...
llvm-svn: 190993
2013-09-19 07:59:18 +00:00
Dmitry Vyukov
d78bc3aa11
asan/tsan/msan: use builtin atomic operations when available
...
this should fix episodic crashes on ARM/PPC
x86_32 is still broken
llvm-svn: 190991
2013-09-19 06:02:56 +00:00
Dmitry Vyukov
f54631dcfe
tsan: prevent the following false positive due to __cxa_atexit
...
WARNING: ThreadSanitizer: data race (pid=29103)
Write of size 8 at 0x7d64003bbf00 by main thread:
#0 free tsan_interceptors.cc:477
#1 __run_exit_handlers <null>:0 (libc.so.6+0x000000050cb7)
Previous write of size 8 at 0x7d64003bbf00 by thread T78 (mutexes: write M9896):
#0 calloc tsan_interceptors.cc:449
#1 ...
llvm-svn: 190989
2013-09-19 04:48:59 +00:00
Dmitry Vyukov
c2437ffc23
tsan: consistently use thr instead of cur_thread() in annotations implementation
...
llvm-svn: 190988
2013-09-19 04:42:25 +00:00
Dmitry Vyukov
1a7ca92006
tsan: refactor internal IgnoreCtl interface
...
llvm-svn: 190987
2013-09-19 04:39:04 +00:00
Evgeniy Stepanov
91375fd66e
[tsan] No-op implementation of AnnotateMemoryIsInitialized.
...
llvm-svn: 190933
2013-09-18 11:20:31 +00:00
Kostya Serebryany
c3d43ca3ec
[asan] add a run-time option detect_stack_use_after_return, add verbosity output for fake stack
...
llvm-svn: 190932
2013-09-18 10:35:12 +00:00
Alexey Samsonov
c947eb08b5
[ASan] Don't add SANITIZER_INTERFACE_ATTRIBUTE for internal ASan functions
...
llvm-svn: 190860
2013-09-17 09:42:03 +00:00
Alexey Samsonov
a7f35c06dc
[ASan] Enable fake stack test on Mac and Android, as no-instrumentation tests are now fixed
...
llvm-svn: 190856
2013-09-17 08:40:32 +00:00
Alexey Samsonov
676c109c24
[ASan] Link tests with -pie if ASan runtime uses zero-base shadow
...
llvm-svn: 190853
2013-09-17 07:50:12 +00:00
Kostya Serebryany
2f5c2be6bd
[asan] further speedup use-after-return: simplify deallocation of fake frames. ~ 20% speedup.
...
llvm-svn: 190852
2013-09-17 07:42:54 +00:00
Nick Lewycky
885136d3b6
Check the function we just called for errors, not an incoming argument. Noticed
...
by inspection.
llvm-svn: 190828
2013-09-17 00:23:28 +00:00
Alexey Samsonov
f71c88910c
[ASan] Don't link with pthread on Android
...
llvm-svn: 190794
2013-09-16 16:51:49 +00:00
Alexey Samsonov
036a5bef2d
[ASan] Split ASan unit tests into two different binaries:
...
(1) instrumented, i.e. compiled and linked with -fsanitize=address
(2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically.
llvm-svn: 190788
2013-09-16 15:50:53 +00:00
Alexey Samsonov
48e256466a
[ASan] Check that getSymbolizer() is defined. Turn magic mapping constants into named variables
...
llvm-svn: 190787
2013-09-16 15:45:06 +00:00
Alexey Samsonov
ad7925e0c1
Minor enhancements for sanitizer_common build rules
...
llvm-svn: 190786
2013-09-16 15:43:23 +00:00
Evgeniy Stepanov
08d649c024
[msan] Check return value of main: compiler-rt tests.
...
llvm-svn: 190783
2013-09-16 13:25:26 +00:00
Evgeniy Stepanov
65562f5281
[msan] Fix origin of deallocated memory.
...
MSan poisons deallocated memory but it used to give it an invalid origin value,
resulting in confusing reports. This change associates deallocation stack trace
with such memory.
Note that MSan does not have quarantine, and use-after-free detection is very
limited.
llvm-svn: 190781
2013-09-16 11:03:31 +00:00
Evgeniy Stepanov
0da35401ce
[msan] Add source file:line to stack origin reports.
...
Test.
llvm-svn: 190690
2013-09-13 12:55:07 +00:00
Evgeniy Stepanov
ac5ac34cf7
[msan] Add source file:line to stack origin reports.
...
Runtime library part.
llvm-svn: 190686
2013-09-13 12:49:13 +00:00
Evgeniy Stepanov
9be91e970e
[msan] Intercept tzset.
...
llvm-svn: 190682
2013-09-13 11:27:38 +00:00
Evgeniy Stepanov
8f0b7feb4c
[msandr] Add debugging instructions to README.txt.
...
llvm-svn: 190680
2013-09-13 11:00:50 +00:00
Kostya Serebryany
3bee8efc95
[asan] Android does not have TLS
...
llvm-svn: 190669
2013-09-13 08:58:22 +00:00
Alexey Samsonov
70c93d3b1c
[ASan] Temporary disable UAR unit test on Android due to https://code.google.com/p/address-sanitizer/issues/detail?id=222
...
llvm-svn: 190667
2013-09-13 08:07:21 +00:00
Kostya Serebryany
9583b87077
[asan] don't record the class_id in FakeFrame (scratching the last bits of performance)
...
llvm-svn: 190666
2013-09-13 07:50:44 +00:00
Kostya Serebryany
4117bdbbbc
[asan] more performance to FakeStack: a) don't used atomic exchange, instead rely on regular load and store and other signal-safe logic; b) remove allocated_from_size_class_mask_ which is not helping much anyway; Another 10% speedup
...
llvm-svn: 190664
2013-09-13 07:20:35 +00:00
Kostya Serebryany
43c4493b44
[asan] second attempt to use TLS with fake stack. This time it looks (more) async-signal safe.
...
llvm-svn: 190663
2013-09-13 06:32:26 +00:00
Kostya Serebryany
c19851ab6c
[asan] undo the previous commit since TLS hack breaks with signals... :(
...
llvm-svn: 190662
2013-09-13 06:15:02 +00:00
Kostya Serebryany
096413ba3b
[asan] use TLS on Linux to get the FakeStack. Saves 15% performance
...
llvm-svn: 190661
2013-09-13 06:04:18 +00:00
Kostya Serebryany
77caab4d7b
[asan] inline PoisonShadow in FakeStack to get ~10% speedup
...
llvm-svn: 190660
2013-09-13 05:57:58 +00:00
Peter Collingbourne
cdec0a8ad2
[dfsan] Add a few easy functions to the ABI list.
...
llvm-svn: 190653
2013-09-13 01:38:56 +00:00
Kostya Serebryany
7638aa135e
[asan] a bit of performance improvement in fake stack, generalized one test, fixed android build of another test
...
llvm-svn: 190606
2013-09-12 14:41:10 +00:00
Kostya Serebryany
627ea6391e
[asan] add a test for use-after-return and exceptions and fix it. Not 100% sure this is a complete fix, will keep looking for harder cases.
...
llvm-svn: 190603
2013-09-12 13:25:29 +00:00
Alexander Potapenko
9caa10d0c7
[ASan] Do not build asan_fake_stack_test.cc on OSX until https://code.google.com/p/address-sanitizer/issues/detail?id=222 is fixed.
...
llvm-svn: 190597
2013-09-12 09:46:56 +00:00
Kostya Serebryany
79d98a851b
[asan] limit the size of the fake stack with a reasonable constant. This fixes a failure when the main thread's stack is considered unlimited (very large).
...
llvm-svn: 190596
2013-09-12 09:08:13 +00:00
Kostya Serebryany
44441cc34b
[asan] (part 2) don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)
...
llvm-svn: 190594
2013-09-12 08:47:00 +00:00
Kostya Serebryany
736bd08e05
[asan] don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)
...
llvm-svn: 190593
2013-09-12 08:43:44 +00:00
Kostya Serebryany
628cda7367
[asan] hopefully make the FakeStack async-signal safe, enable the related test
...
llvm-svn: 190592
2013-09-12 08:34:50 +00:00
Evgeniy Stepanov
58dbe06230
[asan] Fix deadlock in stack unwinder on android/x86.
...
Fixes PR17116.
Patch by 林作健 (manjian2006 at gmail.com).
llvm-svn: 190590
2013-09-12 08:16:28 +00:00
Kostya Serebryany
e8f961e847
[asan] use xchg instead of CAS in FakeStack::Allocate (5% faster for this case)
...
llvm-svn: 190589
2013-09-12 07:28:42 +00:00
Kostya Serebryany
729c8dc65b
[asan] fully re-implement the FakeStack (use-after-return) to make it faster and async-signal-safe. The implementation is not yet complete (see FIXMEs) but the existing tests pass.
...
llvm-svn: 190588
2013-09-12 07:11:58 +00:00
Bill Wendling
a6ec07ce2d
Fix typo
...
llvm-svn: 190543
2013-09-11 19:35:32 +00:00
Daniel Jasper
333e0cb055
Revert r190520 as it wasn't the right fix.
...
llvm-svn: 190524
2013-09-11 12:53:04 +00:00
Daniel Jasper
2b3f143f23
Add empty virtual destructor...
...
... as this otherwise triggers -Wnon-virtual-dtor.
llvm-svn: 190520
2013-09-11 12:28:15 +00:00
Alexey Samsonov
4a2447fd81
[TSan] Use --whole-archive around TSan runtime in old TSan makefiles. Fix a Go build
...
llvm-svn: 190513
2013-09-11 11:06:06 +00:00
Alexey Samsonov
279283c064
[Sanitizer] build sanitizer_common library with -Wglobal-constructors
...
llvm-svn: 190504
2013-09-11 09:57:15 +00:00
Alexey Samsonov
e99a0b9b76
[TSan] Use Clang to compile and link TSan unit tests with TSan runtime
...
llvm-svn: 190503
2013-09-11 09:56:33 +00:00
Alexey Samsonov
d397a9ba1d
Fixup for r190410: use lazy initialization for symbolizer as some compilers emit global constructor to setup vptr
...
llvm-svn: 190414
2013-09-10 16:16:27 +00:00
Timur Iskhodzhanov
92702d8401
[ASan] Remove the explicit function prototypes for intercepted functions on Windows
...
llvm-svn: 190411
2013-09-10 14:42:15 +00:00
Alexey Samsonov
7a36e6126b
[Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files
...
llvm-svn: 190410
2013-09-10 14:36:16 +00:00
Kostya Serebryany
8fc35ca008
[asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. compiler-rt part
...
llvm-svn: 190406
2013-09-10 13:16:26 +00:00
Evgeniy Stepanov
df96e863de
[msan] bool -> int to make msan_interface.h C-compatible.
...
llvm-svn: 190402
2013-09-10 11:04:37 +00:00
Timur Iskhodzhanov
190784b21b
[ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID
...
Also make DescribeThread easier to use.
This was firing on Dr.ASan runs, not sure how to repro InvalidTID in a simple test.
llvm-svn: 190392
2013-09-10 08:36:21 +00:00
Eli Friedman
abc1a5cb9b
Delete unused variables.
...
llvm-svn: 190383
2013-09-10 03:27:07 +00:00
Peter Collingbourne
0dca2e5ed1
[dfsan] Initial set of DFSAN_OPTIONS flags.
...
llvm-svn: 190379
2013-09-10 01:51:35 +00:00
Bill Wendling
97c22c3c92
Don't allow a NULL-length file. Try to revert to the buffered version.
...
llvm-svn: 190359
2013-09-09 22:25:46 +00:00
Evgeniy Stepanov
842fa3f80d
[msan] Intercept fstatat / fstatat64.
...
llvm-svn: 190306
2013-09-09 13:40:41 +00:00
Evgeniy Stepanov
cf02f171a9
[sanitizer] Fix PR17138.
...
strerror_r on OSX returns a positive error code when the errno value is
unknown. Buffer contents are initialized in any case.
llvm-svn: 190295
2013-09-09 08:58:54 +00:00
Evgeniy Stepanov
80cc27857b
[sanitizer] Delete extra whitespace.
...
llvm-svn: 190292
2013-09-09 06:18:07 +00:00
Alexey Samsonov
77029be19a
[ASan] fix one more memory leak in test case
...
llvm-svn: 190277
2013-09-08 14:01:07 +00:00
Alexey Samsonov
a302a1affc
[Sanitizer] Use generic configs for running sanitizer_common unit tests
...
llvm-svn: 190276
2013-09-08 13:52:07 +00:00
Alexey Samsonov
071cc9e89d
[ASan] turn on leak checking for ASan tests and fix a few discovered leaks
...
llvm-svn: 190274
2013-09-08 13:23:29 +00:00
Evgeniy Stepanov
73166796a3
[sanitizer] Avoid including any system headers in the system-header-free part of the runtime library.
...
llvm-svn: 190161
2013-09-06 15:34:17 +00:00
Evgeniy Stepanov
09d33c67e1
[sanitizer] Fix Android build.
...
Android actually has "__unused" macro defined in <cdefs.h>.
llvm-svn: 190160
2013-09-06 14:58:49 +00:00
Evgeniy Stepanov
5c1035e7fa
[sanitizer] A bunch of linux system call handlers.
...
llvm-svn: 190157
2013-09-06 14:20:01 +00:00
Alexander Potapenko
2a54274c25
[ASan] make the check for NULL more portable.
...
llvm-svn: 190139
2013-09-06 12:04:37 +00:00
Alexey Samsonov
6985f3f67b
Fix compiler warning introduced in r190022
...
llvm-svn: 190137
2013-09-06 11:08:12 +00:00
Alexey Samsonov
16516b9b00
Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ATTRIBUTE_NO_SANITIZE_ADDRESS
...
llvm-svn: 190136
2013-09-06 11:07:33 +00:00
Kostya Serebryany
895ff83e47
[tsan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190135
2013-09-06 11:04:14 +00:00
Kostya Serebryany
6c5b034d7b
[msan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190132
2013-09-06 10:58:55 +00:00
Kostya Serebryany
e009ef4ac1
[asan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190128
2013-09-06 09:51:50 +00:00
Kostya Serebryany
ada5a7b7ef
[sanitizer] make the allocator crash instead of returning 0 on huge size (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190127
2013-09-06 09:25:11 +00:00
Kostya Serebryany
5e0b2085c8
[tsan] add colors to tsan output
...
llvm-svn: 190045
2013-09-05 11:23:27 +00:00
Reid Kleckner
d483c072af
sanitizers: Make sure Visual Studio gets error reports
...
Visual Studio appears to close stderr before launching a non-console
win32 program. This means we don't see any sanitizer reports. If
stderr printing fails, call OutputDebugStringA to get the reports into
the Visual Studio debugger console.
llvm-svn: 190030
2013-09-05 03:19:57 +00:00
Reid Kleckner
0071525492
asan: Add a wcslen interceptor mirroring strlen
...
Tested on Linux, since I can't build the tests on Windows yet.
llvm-svn: 190022
2013-09-05 01:13:49 +00:00
Kostya Serebryany
2e57127cf7
[asan] add a test that demonstrates why the current use-after-return is not signal-safe
...
llvm-svn: 189943
2013-09-04 14:39:43 +00:00
Kostya Serebryany
1f13414d45
[asan] make use-after-return handle very deep recursion; fixes 483.xalancbmk in UAR mode
...
llvm-svn: 189929
2013-09-04 10:59:32 +00:00
Alexey Samsonov
5b2000e4d9
Disable FindPathToBinary test on Android
...
llvm-svn: 189923
2013-09-04 06:40:48 +00:00
Timur Iskhodzhanov
2eea5894fe
[asan] Hopefully un-break the RTL on Windows
...
llvm-svn: 189821
2013-09-03 15:50:13 +00:00
Timur Iskhodzhanov
2b8d35f8ac
[asan] Hopefully fix the RTL build on Windows (part 2)
...
llvm-svn: 189817
2013-09-03 15:09:21 +00:00
Dmitry Vyukov
4e27d1fdaf
tsan: catch races on condition variables
...
llvm-svn: 189816
2013-09-03 15:04:15 +00:00
Kostya Serebryany
14b7caca13
[asan] attemping to fix the Windows build
...
llvm-svn: 189814
2013-09-03 14:53:02 +00:00
Timur Iskhodzhanov
8a9f07626f
Revert r185536 as it neither fixes any memory leaks, nor is it necessary (see the example from "man pthread_getattr_np")
...
llvm-svn: 189810
2013-09-03 14:21:21 +00:00
Kostya Serebryany
6bafcd1949
implement PR17059: more visible diagnostics for stack-buffer-overflow
...
llvm-svn: 189806
2013-09-03 13:58:04 +00:00
Sergey Matveev
b9d34443f2
[lsan] Colorize LSan reports.
...
llvm-svn: 189804
2013-09-03 13:31:03 +00:00
Alexey Samsonov
5b5c99d219
ASan, LSan, MSan: try to find llvm-symbolizer binary in PATH if it is not provided. Now we don't need to explicitly set the location of llvm-symbolizer in lit test configs.
...
llvm-svn: 189801
2013-09-03 13:22:51 +00:00
Alexey Samsonov
de647ddc8b
[Sanitizer] Add the way to find binary in PATH
...
llvm-svn: 189799
2013-09-03 13:20:48 +00:00
Alexey Samsonov
249c7fb10e
Add internal_strchrnul function
...
llvm-svn: 189797
2013-09-03 13:09:28 +00:00
Alexey Samsonov
1ecb96f652
[TSan] fixup for r189791: don't put ; on the newline
...
llvm-svn: 189792
2013-09-03 11:50:48 +00:00
Dmitry Vyukov
ed93fbf93e
tsan: add suppressions for true/false positives in standard libraries
...
llvm-svn: 189791
2013-09-03 11:43:04 +00:00
Alexander Potapenko
94377c337b
[libsanitizer] Remove an unused variable introduced in r189789
...
llvm-svn: 189790
2013-09-03 11:30:07 +00:00
Alexander Potapenko
7e1c51988d
[TSan] Move the /proc/self/maps parsing logic to sanitizer_common
...
Provide a generic way for the tools to generate memory profiles from contents of /proc/self/maps
llvm-svn: 189789
2013-09-03 11:09:16 +00:00
Dmitry Vyukov
e2391f66f9
tsan: fix linking when -ltsan is passed before -lpthread
...
libpthread is weird:
/lib/x86_64-linux-gnu/libpthread.so.0:000000000000b9b0 T pthread_cond_init@@GLIBC_2.3.2
/lib/x86_64-linux-gnu/libpthread.so.0:000000000000c720 T pthread_cond_init@GLIBC_2.2.5
let's do it with @@ for now
we can always introduce more macros parameters later
llvm-svn: 189788
2013-09-03 10:16:44 +00:00
Evgeniy Stepanov
499d480be5
[msan] Another regression test for r189786.
...
llvm-svn: 189787
2013-09-03 10:08:14 +00:00
Evgeniy Stepanov
f9ddb43975
[msan] A regression test for r189785.
...
llvm-svn: 189786
2013-09-03 10:05:45 +00:00
Kostya Serebryany
8d42228e47
fix PR17061 (and pleeease, don't ask me for a test, this is just a minor output formatting issue :)
...
llvm-svn: 189783
2013-09-03 09:44:56 +00:00
Dmitry Vyukov
23b80ab87f
asan: fix android build
...
android does not have dlvsym
llvm-svn: 189781
2013-09-03 07:53:49 +00:00
Dmitry Vyukov
3a6c7cea77
tsan: properly intercept pthread_cond functions
...
llvm-svn: 189767
2013-09-02 18:06:28 +00:00
Evgeniy Stepanov
bbca4903c4
[msan] Update MSanDR build instructions.
...
llvm-svn: 189760
2013-09-02 14:21:12 +00:00
Sergey Matveev
69931c5841
[sanitizer_common] Add internal_clone().
...
Add a wrapper for the clone syscall for use in StopTheWorld. We
implement it only for x86_64, so stop building StopTheWorld for other platforms
(no one uses it outside x86_64 anyway).
See https://code.google.com/p/address-sanitizer/issues/detail?id=214 for why we
can't use the glibc clone() wrapper.
llvm-svn: 189753
2013-09-02 11:36:19 +00:00
Evgeniy Stepanov
e3eaa7bb35
[msan] Intercept memalign, valloc, pvalloc.
...
PR17039
llvm-svn: 189750
2013-09-02 09:24:53 +00:00
Alexey Samsonov
bbd5f46696
[ASan] Make blacklist test more robust
...
llvm-svn: 189748
2013-09-02 09:17:51 +00:00
Alexey Samsonov
d95129060c
[CMake] Don't build sanitizer runtimes if LLVM_USE_SANITIZER is specified
...
llvm-svn: 189745
2013-09-02 08:57:23 +00:00
Alexey Samsonov
4b16885839
Improve collecting malloc stats in ASan
...
Summary:
This change makes races between updates of thread-local stats and
merging all the thread-local stats together less harmful.
Reviewers: kcc
Reviewed By: kcc
CC: dvyukov, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1572
llvm-svn: 189744
2013-09-02 08:39:07 +00:00
Peter Collingbourne
de8e3a097c
Conditionalise inclusion of link.h on !SANITIZER_ANDROID.
...
Hopefully fixes the Android build.
Differential Revision: http://llvm-reviews.chandlerc.com/D1551
llvm-svn: 189696
2013-08-30 20:50:12 +00:00
Will Dietz
1b9b9ec464
Avoid compiler-generated memset by using internal_memset.
...
Fixes PR17025.
llvm-svn: 189693
2013-08-30 19:53:55 +00:00
Peter Collingbourne
014328e76c
[dfsan] Add a syms file.
...
llvm-svn: 189620
2013-08-29 22:49:00 +00:00
Alexey Samsonov
5ffab0959a
Minor updates to gen_dynamic_list script suggested by glider
...
llvm-svn: 189588
2013-08-29 15:45:41 +00:00
Alexey Samsonov
06379b3537
[TSan] Add a couple of compiler warnings to TSan runtime compile flags
...
llvm-svn: 189581
2013-08-29 12:08:36 +00:00
Alexey Samsonov
ab7ff52efd
[TSan] Move build rules a bit to ensure correct dependencies of check-tsan command
...
llvm-svn: 189579
2013-08-29 11:53:11 +00:00
Alexey Samsonov
25dc018843
[sanitizer] Parallelize lint checker script
...
llvm-svn: 189578
2013-08-29 11:35:01 +00:00
Alexey Samsonov
5a2f073926
[sanitizer] Refine CMake rules for generating exported symbols and lint checking
...
llvm-svn: 189577
2013-08-29 10:49:04 +00:00
Peter Collingbourne
187a169603
[dfsan] Add custom function for dl_iterate_phdr.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1505
llvm-svn: 189503
2013-08-28 20:18:25 +00:00
Peter Collingbourne
3e5524d6c5
[dfsan] Add custom function for pthread_create.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1504
llvm-svn: 189502
2013-08-28 20:18:22 +00:00
Will Dietz
f967d1f947
sanitizer_common: Use PYTHON_EXECUTABLE to choose appropriate python.
...
Fixes build on systems where 'python' is not python2.
llvm-svn: 189486
2013-08-28 15:53:17 +00:00
Alexey Samsonov
dd1d1b2c79
Make lint checker script more robust
...
llvm-svn: 189479
2013-08-28 12:15:03 +00:00
Alexey Samsonov
d875c39be6
Check code style in check-sanitizer command
...
llvm-svn: 189475
2013-08-28 11:27:31 +00:00
Alexey Samsonov
ef643ce471
[sanitizer] fix code style
...
llvm-svn: 189474
2013-08-28 11:26:09 +00:00
Evgeniy Stepanov
4f961de94e
[msan] Remove extra backup/restore calls.
...
llvm-svn: 189461
2013-08-28 09:17:47 +00:00
Kostya Serebryany
fab9336413
[asan]: fix a CHECK failure in use-after-return mode; enable and fix stack-use-after-return.cc; add a test for UAR mode in asan_noinst_test
...
llvm-svn: 189457
2013-08-28 08:59:23 +00:00
Alexey Samsonov
0803953cea
Generate list of symbols exported from sanitizer runtimes only on 64-bit Unix
...
llvm-svn: 189454
2013-08-28 08:07:04 +00:00
Alexey Samsonov
acab30e927
Properly generate lists of exported symbols for sanitizer runtimes
...
This change adds a Python script that is invoked for
the just-built sanitizer runtime to generate the list of exported symbols
passed to the linker. By default, it contains interceptors and sanitizer
interface functions, but can be extended with tool-specific lists.
llvm-svn: 189356
2013-08-27 15:08:02 +00:00
Evgeniy Stepanov
cb22c67a21
[msan] Save/restore va_arg_overflow_tls in signal handlers.
...
llvm-svn: 189351
2013-08-27 14:08:15 +00:00
Alexey Samsonov
614a5ea990
Revert r189347: it breaks on machines w/o installed debug versions of system libraries
...
llvm-svn: 189350
2013-08-27 14:04:01 +00:00
Alexey Samsonov
ea0ef986e2
LSan: Check that dynamic linker library is properly symbolized
...
llvm-svn: 189347
2013-08-27 13:39:33 +00:00
Evgeniy Stepanov
c41798152f
[msan] Unpoison all TLS shadow when leaving a signal handler.
...
llvm-svn: 189343
2013-08-27 12:59:39 +00:00
Evgeniy Stepanov
bb25af5f7b
[msan] Fix a data race in signal/sigaction interceptors.
...
llvm-svn: 189342
2013-08-27 11:34:05 +00:00
Evgeniy Stepanov
82185980c4
[msan] A test for ppoll() interceptor.
...
llvm-svn: 189339
2013-08-27 11:10:20 +00:00
Evgeniy Stepanov
a40a058ff1
[sanitizer] Simplify sigaction and sigset_t handling.
...
llvm-svn: 189338
2013-08-27 11:10:04 +00:00
Hans Wennborg
67c6e5041b
cmake: fix the compiler-rt build with MSVC
...
This sets flags and excludes things that aren't working with MSVC yet,
allowing us to build the ASan runtime as part of the cmake build.
Differential Revision: http://llvm-reviews.chandlerc.com/D1525
llvm-svn: 189304
2013-08-27 01:24:01 +00:00
Sergey Matveev
9e3e80208f
[sanitizer] Add a fast version of StackDepotGet() for use in LSan.
...
Add a class that holds a snapshot of the StackDepot optimized for querying by
ID. This allows us to speed up LSan dramatically.
llvm-svn: 189217
2013-08-26 13:24:43 +00:00
Sergey Matveev
ef7db73e11
[sanitizer] Handle Die() in StopTheWorld.
...
Handle calls to Die() from the tracer thread. Fixes a bug where a CHECK
could fail in the tracer thread, resulting in a call to AsanDie. The tracer
thread then exited and the parent process continued execution despite its
address space being in an unusable state.
llvm-svn: 189216
2013-08-26 13:20:31 +00:00
Peter Collingbourne
469c056299
[dfsan] Integration test for the equal-labels case
...
llvm-svn: 189134
2013-08-23 18:45:22 +00:00
Evgeniy Stepanov
0d13c707d5
[msan] Extend VAArgTLSOverwrite test.
...
This test now covers LLVM r189104.
llvm-svn: 189105
2013-08-23 12:13:18 +00:00
Alexey Samsonov
903c3250d2
Slightly improve lint checker script and fix a few style issues
...
llvm-svn: 189092
2013-08-23 07:43:56 +00:00
Sergey Matveev
5371e90f7a
[lsan] Add a regression test for building C code.
...
llvm-svn: 189016
2013-08-22 14:48:44 +00:00
Evgeniy Stepanov
251080b0eb
[sanitizer] Fix build when scanf interceptors are enabled, and __isoc99_*scanf are not.
...
Fixes PR16916.
llvm-svn: 189015
2013-08-22 13:59:15 +00:00
Sergey Matveev
f6ca04d468
[lsan] Add a stress test.
...
llvm-svn: 189012
2013-08-22 13:32:10 +00:00
Sergey Matveev
bed55036a9
[lsan] Build standalone LSan with -fno-rtti.
...
Fix issue where C code could not be built with -fsanitize=leak.
llvm-svn: 189010
2013-08-22 13:23:22 +00:00
Alexey Samsonov
287fca44af
[LSan] Add support for building standalone LSan runtime to Make build (compiler-rt part)
...
llvm-svn: 188804
2013-08-20 14:49:01 +00:00
Chandler Carruth
6b8d17bf35
It appears that glibc 2.13 has the same thread descriptor size as 2.11,
...
bump up the inflection point to 2.14. If someone can tell me how to
actually figure out value for this, that would be awesome.
Anyways, this takes me to one ASan failure, one LSan failure, and three
TSan failures for 'check-all' on Linux.
llvm-svn: 188635
2013-08-18 10:04:51 +00:00
Chandler Carruth
022a3d4e88
Revert r188369 (and r188455) which breaks the build on at least some
...
Linux systems. I've replied on the original commit thread with details
of the problem.
llvm-svn: 188628
2013-08-18 08:47:06 +00:00
Joerg Sonnenberger
9dce26947e
Fix endian conditions on Solaris. From Alexander Esilevich.
...
llvm-svn: 188613
2013-08-17 22:32:10 +00:00
Timur Iskhodzhanov
10286e1e59
[ASan/RTL] Disable colored reporting on Windows
...
llvm-svn: 188545
2013-08-16 11:26:26 +00:00
Dmitry Vyukov
f6ea6a5a19
tsan: better report formatting for Go
...
Say that gorotuine 1 is main goroutine.
Remove excessive new line.
llvm-svn: 188542
2013-08-16 11:15:14 +00:00
Timur Iskhodzhanov
51cda144ae
[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows
...
llvm-svn: 188541
2013-08-16 11:04:59 +00:00
Peter Collingbourne
12b0809eb1
[dfsan] Initial set of custom functions and interceptors for libc.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1397
llvm-svn: 188490
2013-08-15 21:18:53 +00:00
Peter Collingbourne
ae52ac7479
[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.
...
Reviewers: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1406
llvm-svn: 188471
2013-08-15 18:51:07 +00:00
Evgeniy Stepanov
a1d44d4d8f
[sanitizer] Add missing include.
...
llvm-svn: 188455
2013-08-15 10:20:30 +00:00
Peter Collingbourne
64308d92c0
[dfsan] New __dfsan_set_label runtime function.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1396
llvm-svn: 188411
2013-08-14 20:51:33 +00:00
Peter Collingbourne
0e51eda83b
[dfsan] Runtime support for ABI list functionality; can now run integration tests with args ABI.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1351
llvm-svn: 188401
2013-08-14 18:54:06 +00:00
Evgeniy Stepanov
0bb7577d89
[sanitizer] Split platform_limits_posix into system- and kernel-dependent parts.
...
This change moves everything depending on kernel headers (mostly ioctl types
and ids) into a separate source file. This will reduce the possibility of
header conflict on various platforms (most importantly, older glibc versions).
This change also removes 2 deprecated ioctls, and symbolic ids for other bunch
of ambiguous ioctls (i.e. same id is shared by ioctls with different memory
behavior).
llvm-svn: 188369
2013-08-14 13:34:14 +00:00
Peter Collingbourne
7da504faa4
[dfsan] Introduce dfsan_read_label runtime function.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1349
llvm-svn: 188319
2013-08-13 22:15:40 +00:00
Dmitry Vyukov
8cff61f29e
tsan: intercept getaddrinfo
...
This is necessary to prevent false positives, see:
https://code.google.com/p/thread-sanitizer/issues/detail?id=25
llvm-svn: 188291
2013-08-13 16:51:27 +00:00
Timur Iskhodzhanov
9dc34adf36
[ASan/Win] Oops, forgot to add the attributes to the memory allocations functions
...
llvm-svn: 188290
2013-08-13 16:48:18 +00:00
Dmitry Vyukov
97f0eae0a5
tsan/msan: add halt_on_error flag
...
If halt_on_error==true, program terminates after reporting first error.
llvm-svn: 188279
2013-08-13 15:33:00 +00:00
Timur Iskhodzhanov
7757073c21
[ASan/Win] Hook some memory allocation functions; passes simple sanity test now
...
llvm-svn: 188278
2013-08-13 15:29:42 +00:00
Timur Iskhodzhanov
3fdabf8965
[ASan/Win] Add the first version of the RTL thunk that should be linked with instrumented DLLs
...
llvm-svn: 188267
2013-08-13 13:47:03 +00:00
Timur Iskhodzhanov
dd052cedf8
Add a FIXME to check_lint
...
llvm-svn: 188266
2013-08-13 13:44:02 +00:00
Timur Iskhodzhanov
82a6647755
[*San/RTL] One more minor fix
...
llvm-svn: 188263
2013-08-13 12:16:43 +00:00
Timur Iskhodzhanov
45e82d12b0
[*San/RTL] Fix minor breakage
...
Grumbling: this hasn't been caught by running 'make check-{a,l,t}san check-sanitizer'
llvm-svn: 188262
2013-08-13 12:03:51 +00:00
Timur Iskhodzhanov
eee13914e2
Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used
...
llvm-svn: 188261
2013-08-13 11:42:45 +00:00
Peter Collingbourne
da71ea2598
[dfsan] Remove the unused __dfsan_memcpy function.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1350
llvm-svn: 188238
2013-08-13 00:16:18 +00:00
Peter Collingbourne
a3dc875198
[dfsan] Begin a private header and move shadow_for there.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1348
llvm-svn: 188231
2013-08-12 23:51:33 +00:00
Peter Collingbourne
21b2929aca
[dfsan] Introduce dfsan_union runtime function.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1347
llvm-svn: 188229
2013-08-12 23:47:37 +00:00
Rui Ueyama
633ec6848b
Add "CHECK-" prefix to un-break buildbot failure.
...
After r188221, the prefix given by --check-prefix must match with the label
as a whole. Substring is not considered to be a correct label anymore.
llvm-svn: 188227
2013-08-12 23:43:19 +00:00
Evgeniy Stepanov
64cace0687
[sanitizer] Intercept poll/ppoll.
...
llvm-svn: 188177
2013-08-12 13:19:53 +00:00
Evgeniy Stepanov
98c39a184e
[sanitizer] Intercept getgroups.
...
llvm-svn: 188167
2013-08-12 11:01:40 +00:00
Daniel Dunbar
beadec4afd
[tests] Add one more lit rename update I missed.
...
llvm-svn: 188117
2013-08-09 22:23:23 +00:00
Daniel Dunbar
bc5dbc435e
[tests] Update to use lit_config and lit package, as appropriate.
...
llvm-svn: 188116
2013-08-09 22:14:01 +00:00
Evgeniy Stepanov
7f915cf8a5
[sanitizer] Fix handling of %n in scanf interceptor.
...
%n does not increase the input item count. The new code emits writes to %n
arguments even if it has run out of input items.
llvm-svn: 188069
2013-08-09 12:58:35 +00:00
Evgeniy Stepanov
3bf5439a9d
[sanitizer] Limit scandir interceptor to Linux.
...
Implementation uses __thread not available on certain platforms.
llvm-svn: 187983
2013-08-08 14:04:36 +00:00
Evgeniy Stepanov
564215d949
[sanitizer] Intercept scandir/scandir64.
...
llvm-svn: 187982
2013-08-08 13:57:15 +00:00
Dmitry Vyukov
87bf47894c
tsan: better diagnostics for invalid addresses passed to free()
...
llvm-svn: 187980
2013-08-08 13:47:50 +00:00
Evgeniy Stepanov
233455cba8
[sanitizer] Intercept strerror and strerror_r.
...
llvm-svn: 187978
2013-08-08 11:44:05 +00:00
Evgeniy Stepanov
7ea4795ed3
[sanitizer] ASan/MSan tests for r187967.
...
r187967: Disable inlining between sanitized and non-sanitized functions.
llvm-svn: 187971
2013-08-08 09:23:19 +00:00
Alexey Samsonov
f49c076ff7
Simplify (and fix) check-dfsan configs
...
llvm-svn: 187968
2013-08-08 08:26:39 +00:00
Peter Collingbourne
5cbab07d02
DataFlowSanitizer; compiler-rt changes.
...
DataFlowSanitizer is a generalised dynamic data flow analysis.
Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own. Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.
Differential Revision: http://llvm-reviews.chandlerc.com/D967
llvm-svn: 187924
2013-08-07 22:47:26 +00:00
Alexander Potapenko
0443f1ac72
[TSan] Fix free_race.c by removing `not` from the test invocation that doesn't fail.
...
llvm-svn: 187889
2013-08-07 13:54:27 +00:00
Alexander Potapenko
ce32410097
[TSan] Let the users suppress use-after-free errors using the "race:" suppressions.
...
If there's a race between a memory access and a free() call in the client program,
it can be reported as a use-after-free (if the access occurs after the free()) or an ordinary race
(if free() occurs after the access).
We've decided to use a single "race:" prefix for both cases instead of introducing a "use-after-free:" one,
because in many cases this allows us to keep a single suppression for both the use-after-free and free-after-use.
This may be misleading if the use-after-free occurs in a non-racy way (e.g. in a single-threaded program).
But normally such bugs shall not be suppressed.
llvm-svn: 187885
2013-08-07 12:39:00 +00:00
Alexey Samsonov
f502fd75ab
ASan: fix one more test case for pipefail
...
llvm-svn: 187881
2013-08-07 10:41:49 +00:00
Alexey Samsonov
15d5eefc65
Distinguish 32-bit ASan from 64-bit ASan in lit configs
...
llvm-svn: 187878
2013-08-07 09:31:28 +00:00
Alexey Samsonov
4431d2d566
Enable pipefail for ASan tests
...
llvm-svn: 187877
2013-08-07 09:14:30 +00:00
Evgeniy Stepanov
04b7bff1fe
[sanitizer] Intercept sched_getaffinity.
...
Re-applying with a more reliable test case.
llvm-svn: 187876
2013-08-07 09:10:16 +00:00
Alexey Samsonov
b6c8b3de70
Enable pipefail for TSan tests
...
llvm-svn: 187875
2013-08-07 09:02:37 +00:00
Alexey Samsonov
fd078b9405
Enable pipefail for LSan tests
...
llvm-svn: 187873
2013-08-07 08:46:09 +00:00
David Blaikie
787e2b6499
Revert "[sanitizer] Intercept sched_getaffinity."
...
This reverts commit r187788.
The test case is unreliable (as the test may be run in a situation in
which it has no affinity with cpu0). This can be recommitted with a more
reliable test - possibly using CPU_COUNT != 0 instead (I wasn't entirely
sure that a process was guaranteed to have at least one affinity, though
it seems reasonable, or I'd have made the change myself).
llvm-svn: 187841
2013-08-07 00:37:26 +00:00
Alexander Potapenko
8c6cd93123
[libsanitizer] Drive-by fix for -Wempty-body in sanitizer_common_syscalls.inc
...
This makes the file consistently use { } around the if statements containing the PRE_/POST_ macros.
llvm-svn: 187797
2013-08-06 14:07:46 +00:00
Evgeniy Stepanov
03c0281a17
[sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.
...
llvm-svn: 187789
2013-08-06 09:54:33 +00:00
Evgeniy Stepanov
9f05e5e533
[sanitizer] Intercept sched_getaffinity.
...
llvm-svn: 187788
2013-08-06 09:29:01 +00:00
Alexey Samsonov
b42ea7ef21
Lint fixes
...
llvm-svn: 187726
2013-08-05 13:20:39 +00:00
Evgeniy Stepanov
44b77c26e4
[msan] Allocator statistics interface and malloc hooks.
...
llvm-svn: 187653
2013-08-02 14:26:58 +00:00
Evgeniy Stepanov
90daaf9132
[msan] Fix unused function warning in the tests.
...
llvm-svn: 187648
2013-08-02 09:09:02 +00:00
Sergey Matveev
6459a370a7
[lsan] Add leak_check_at_exit flag.
...
We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.
llvm-svn: 187578
2013-08-01 14:57:07 +00:00
Evgeniy Stepanov
5dbedf6c2a
[msan] Intercept setenv, putenv.
...
llvm-svn: 187575
2013-08-01 11:14:14 +00:00
Evgeniy Stepanov
1ea380f693
[msan] Fix msan tests with pipefail option.
...
llvm-svn: 187485
2013-07-31 09:14:55 +00:00
Evgeniy Stepanov
3feb17c452
[sanitizer] Tweak read syscall handler signature for consistency.
...
llvm-svn: 187417
2013-07-30 13:16:52 +00:00
Evgeniy Stepanov
9fbd981f99
[sanitizer] read() syscall hook.
...
llvm-svn: 187414
2013-07-30 13:04:43 +00:00
Evgeniy Stepanov
807e131261
[msan] Intercept pthread_join.
...
llvm-svn: 187413
2013-07-30 12:54:34 +00:00
Evgeniy Stepanov
da9fd25603
[msan] Intercept confstr.
...
llvm-svn: 187412
2013-07-30 12:46:59 +00:00
Evgeniy Stepanov
d8a1798b47
[asan] Limit fake stack size to a reasonable value when running with unlimited stack.
...
llvm-svn: 187411
2013-07-30 11:50:26 +00:00
Evgeniy Stepanov
f3e218a021
[asan] Raise thread stack size limit.
...
It's a sanity check, mostly, and we've seen threads with >256Mb stack.
llvm-svn: 187408
2013-07-30 09:01:18 +00:00
Evgeniy Stepanov
573ba3499e
[sanitizer] Disable ForEachMappedRegion on Android.
...
It needs interface that is missing from the NDK, and it is not used on Android anyway.
llvm-svn: 187407
2013-07-30 08:39:16 +00:00
Peter Collingbourne
e572e17a8e
Fix warning.
...
llvm-svn: 187373
2013-07-29 20:13:41 +00:00
Peter Collingbourne
9058c07c95
Move UnpoisonMappedDSO to sanitizer_common.
...
This is so DFSan will be able to use it.
Differential Revision: http://llvm-reviews.chandlerc.com/D1206
llvm-svn: 187372
2013-07-29 19:09:49 +00:00
Chandler Carruth
d45abe12a6
Turn off pipefail on msan tests to match the other sanitizers until
...
someone can go through and update the RUN lines appropriately for the
new pipefail behavior.
llvm-svn: 187298
2013-07-27 10:30:39 +00:00
Rafael Espindola
3cf7eb50a9
Disable pipefail for lsan.
...
llvm-svn: 187274
2013-07-26 23:42:16 +00:00
Rafael Espindola
f4fa0d8d9f
disable pipefail for ubsan.
...
llvm-svn: 187273
2013-07-26 23:40:17 +00:00
Rafael Espindola
7bc3077afb
Disable pipefail for ThreadSanitizer.
...
llvm-svn: 187272
2013-07-26 23:38:18 +00:00
Rafael Espindola
48e479291e
disable pipefail on asan for now.
...
llvm-svn: 187269
2013-07-26 23:19:33 +00:00
Sergey Matveev
540338259d
[sanitizer] Change strip_path_prefix flag behavior.
...
Previously (in tools other than TSan) the entire prefix of the path had to mach
the argument. With this change, only some suffix of the prefix has to match.
This is the same way this flag works in TSan.
llvm-svn: 186837
2013-07-22 16:14:38 +00:00
Sergey Matveev
9c012165ad
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
...
Also move detect_leaks to common flags.
llvm-svn: 186821
2013-07-22 12:38:17 +00:00
Sergey Matveev
1ac4824841
[lsan] Print direct leaks first.
...
Direct leaks are higher priority, so it makes sense to have them on top.
llvm-svn: 186819
2013-07-22 11:18:32 +00:00
Hans Wennborg
cb445d882e
Fix another instance of -ccc-cxx vs. --driver-mode=g++
...
llvm-svn: 186609
2013-07-18 21:09:03 +00:00
Hans Wennborg
2e304b6ffd
Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
...
llvm-svn: 186607
2013-07-18 20:48:50 +00:00
Sergey Matveev
655bd0d08c
[lsan] Add __lsan_do_leak_check() to the public interface.
...
Let users override the normal behavior to run leak checking earlier in
the process. Also fix a couple nits here and there.
llvm-svn: 186581
2013-07-18 14:06:07 +00:00
Dmitry Vyukov
e9c456e15f
tsan: treat SIGSYS as synchronous signal
...
It is required for chromium sandboxing code.
From the description it seems to be indeed synchronous -- called back on syscall with incorrect arguments,
but seems to be unused in practice. So this should be fine.
llvm-svn: 186579
2013-07-18 13:14:11 +00:00
Alexey Samsonov
79d79da0e1
[ASan] Fix leaks in ASan tests found by LSan
...
llvm-svn: 186577
2013-07-18 12:59:52 +00:00
Alexey Samsonov
3122deb65c
[Sanitizer] Always provide --default-arch argument to llvm-symbolizer
...
llvm-svn: 186513
2013-07-17 15:02:43 +00:00
Dmitry Vyukov
c2e4e95580
tsan: disable one more interceptor that causes recursion
...
llvm-svn: 186497
2013-07-17 07:10:47 +00:00
Dmitry Vyukov
46cbc2ed50
tsan: fix unitialized read warning under newer gcc (it does not have visibility into asm)
...
llvm-svn: 186495
2013-07-17 06:56:47 +00:00
Anton Korobeynikov
ec42bd9700
Give compiler-rt a chance to compile with mingw-w64.
...
Patch by C. Bergström!
llvm-svn: 186463
2013-07-16 22:37:55 +00:00
Dmitry Vyukov
d4060fd281
tsan: extend suppressions format with ^ and $ symbols
...
not it's possible to write more precise suppressions,
e.g. "^foo$" won't match "blafoobar"
llvm-svn: 186424
2013-07-16 16:44:15 +00:00
Alexey Samsonov
9916aa2d95
[Sanitizer] move strcpy and strncpy to common interceptors
...
llvm-svn: 186408
2013-07-16 12:51:53 +00:00
Alexey Samsonov
eb7973246f
[ASan] Bump min supported Mac OS X version to 10.6
...
llvm-svn: 186404
2013-07-16 11:54:40 +00:00
Dmitry Vyukov
1a0c76fa55
tsan: support sigsuspend() call
...
Intercepting it makes it process pending signal before return.
llvm-svn: 186400
2013-07-16 11:28:04 +00:00
Timur Iskhodzhanov
4245f78fdd
[ASan] Use less shadow on Win 32-bit
...
llvm-svn: 186393
2013-07-16 09:47:39 +00:00
Alexander Potapenko
27155281db
[ASan] Cache the OSX version to avoid calling sysctl() on every GetMacosVersion() call.
...
llvm-svn: 186389
2013-07-16 09:29:48 +00:00
Alexander Potapenko
b137ca157b
[ASan] Add support for OS X Mavericks to GetMacosVersion.
...
llvm-svn: 186386
2013-07-16 08:35:42 +00:00
Timur Iskhodzhanov
d7eb67774e
Fix check_lint warnings in sanitizers' runtime libraries
...
llvm-svn: 186328
2013-07-15 16:11:39 +00:00
Alexey Samsonov
0048a248bd
Completely revert all mbstowcs-and-friends changes from r186109. They were unintentional
...
llvm-svn: 186158
2013-07-12 12:33:23 +00:00
Sergey Matveev
28dc98ab0d
[lsan] Increase the hardcoded limit on number of leaks.
...
We never expected to see so many leaks in the real world. Until we did.
llvm-svn: 186157
2013-07-12 12:31:22 +00:00
Alexey Samsonov
fde429ba69
[Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors
...
llvm-svn: 186155
2013-07-12 11:59:58 +00:00
Chandler Carruth
1a48dc5ed6
Fix a veritable conucopia of bugs in the readdir_r interceptors.
...
First, the reason I came here: I forgot to look at readdir64_r which had
the exact same bug as readdir_r. However, upon applying the same
quick-fix and testing it I discovered that it still didn't work at all.
As a consequence, I spent some time studying the code and thinking about
it and fixed several other problems.
Second, the code was checking for a null entry and result pointer, but
there is no indication that null pointers are viable here. Certainly,
the spec makes it extremely clear that there is no non-error case where
the implementation of readdir_r fails to dereference the 'result'
pointer and store NULL to it. Thus, our checking for a non-null 'result'
pointer before reflecting that write in the instrumentation was
trivially dead. Remove it.
Third, the interceptor was marking the write to the actual dirent struct
by looking at the entry pointer, but nothing in the spec requires that
the dirent struct written is actually written into the entry structure
provided. A threadlocal buffer would be just as conforming, and the spec
goes out of its way to say the pointer to the *actual* result dirent
struct is stored into *result, so *that* is where the interceptor should
reflect a write occuring. This also obviates the need to even consider
whether the 'entry' parameter is null.
Fourth, I got to the bottom of why nothing at all worked in readdir64_r
-- the interceptor structure for dirent64 was completely wrong in that
it was the same as dirent. I fixed this struct to be correct (64-bit
inode and 64-bit offset! just a 64-bit offset isn't enough!) and added
several missing tests for the size and layout of this struct.
llvm-svn: 186109
2013-07-11 18:51:40 +00:00
Sergey Matveev
29e787d456
[sanitizer] Remove optional arguments from clone() invocation.
...
Unbreaks compilation on older systems. Patch by Andy Jost.
llvm-svn: 186103
2013-07-11 16:37:44 +00:00
Evgeniy Stepanov
9240838655
[sanitizer] More checks in mbstowcs-like interceptors.
...
llvm-svn: 186004
2013-07-10 14:17:46 +00:00
Evgeniy Stepanov
123fdb3413
[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
...
llvm-svn: 186002
2013-07-10 14:01:51 +00:00
Chandler Carruth
28c1b294b8
Fix a bug in the readdir_r interceptor: when we reach the end of the
...
directory stream, the entry is not written to, instead *result is set to
NULL and the entry is not written to at all.
I'm still somewhat suspicious of the correct instrumention here --
I feel like it should be marking the written range as the pointer in
*result and the length (*result)->d_reclen in case the implementation
decides not to use the passed-in entry (if that's even allowed).
Finally, the definition of 'struct dirent' analog used in the
interceptor is wrong in 32-bit mode with _FILE_OFFSET_BITS=64 as it hard
codes the use of a pointer-sized offset.
I've added a somewhat goofy test for the bug I fixed via ASan --
suggestions on how to better test the interceptor logic itself welcome.
llvm-svn: 185998
2013-07-10 09:50:29 +00:00
Peter Collingbourne
2c60538ddd
[asan] Update blacklists to use categories.
...
Differential Revision: http://llvm-reviews.chandlerc.com/D1094
llvm-svn: 185980
2013-07-09 22:04:28 +00:00
Evgeniy Stepanov
7160fb6511
[sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.
...
llvm-svn: 185935
2013-07-09 12:34:25 +00:00
Evgeniy Stepanov
faba61a7bc
[sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.
...
llvm-svn: 185932
2013-07-09 12:07:59 +00:00
Evgeniy Stepanov
77ef78a0a5
[sanitizer] Intercept realpath and canonicalize_file_name.
...
Handle realpath(path, NULL) form.
llvm-svn: 185921
2013-07-09 09:53:37 +00:00
Evgeniy Stepanov
f60c75a644
[sanitizer] Wrap lines >80 chars.
...
llvm-svn: 185920
2013-07-09 09:47:36 +00:00
Evgeniy Stepanov
8495b84076
[asan] Fix windows build.
...
llvm-svn: 185917
2013-07-09 09:29:19 +00:00
Evgeniy Stepanov
f7f252d025
[sanitizer] Syscall handlers for clock_gettime and clock_getres.
...
llvm-svn: 185913
2013-07-09 08:54:59 +00:00
Sergey Matveev
ddd7b6a1c8
[lsan] Fix test.
...
llvm-svn: 185817
2013-07-08 14:08:05 +00:00
Sergey Matveev
bdeff959a1
[lsan] Handle fork() correctly.
...
Update the main thread's os_id on every pthread_create, and before
initiating leak checking. This ensures that we have the correct os_id even if we
have forked after Init().
llvm-svn: 185815
2013-07-08 12:57:24 +00:00
Alexey Samsonov
852d8a4c18
[LSan] Use overridable hook to report error summary
...
llvm-svn: 185805
2013-07-08 10:59:52 +00:00
Evgeniy Stepanov
c2e3ba9eed
[sanitizer] Fix mac build.
...
llvm-svn: 185706
2013-07-05 15:04:56 +00:00
Evgeniy Stepanov
628d727749
[msan] Intercept pthread_key_create.
...
llvm-svn: 185693
2013-07-05 12:31:07 +00:00
Evgeniy Stepanov
0d1d35aeba
[sanitizer] Disable ptrace interception on non-x86(_64).
...
Patch by Hal Finkel.
llvm-svn: 185686
2013-07-05 08:57:47 +00:00
Alexander Potapenko
4f73dea69d
[ASan] Close stderr before launching atos in asan_symbolize.py
...
llvm-svn: 185631
2013-07-04 14:21:49 +00:00
Evgeniy Stepanov
717e0cd2a7
[sanitizer] Intercept tcgetattr.
...
llvm-svn: 185626
2013-07-04 14:03:31 +00:00
Evgeniy Stepanov
db615c186f
[sanitizer] More interceptors.
...
bcopy
strtoimax, strtoumax
mbstowcs, mbsrtowcs, mbsnrtowcs
wcstombs, wcsrtombs, wcsnrtombs
llvm-svn: 185624
2013-07-04 13:19:41 +00:00
Alexander Potapenko
d0c91acb58
[ASan] Do not protect the malloc zone created by malloc_zone_create() on Snow Leopard and earlier systems.
...
Fixes https://code.google.com/p/address-sanitizer/issues/detail?id=208
llvm-svn: 185621
2013-07-04 10:16:12 +00:00
Sergey Matveev
22614e5e3f
[sanitizer] Fix memory leak in sanitizer_common discovered by LeakSanitizer.
...
llvm-svn: 185536
2013-07-03 13:45:13 +00:00
Evgeniy Stepanov
1bd0fe447f
[sanitizer] Fix Android build.
...
llvm-svn: 185432
2013-07-02 14:51:31 +00:00
Evgeniy Stepanov
aa23bd83e5
[msan] Intercept mempcpy, wmempcpy.
...
llvm-svn: 185431
2013-07-02 14:49:24 +00:00
Evgeniy Stepanov
69a387e6ae
[sanitizer] Fix GLOB_NOMATCH behaviour and refactor the interceptor a bit.
...
llvm-svn: 185428
2013-07-02 14:08:52 +00:00
Evgeniy Stepanov
165d759a6a
[sanitizer] Intercept mbtowc, mbrtowc, get_current_dir_name.
...
Move getcwd to common interceptors.
llvm-svn: 185424
2013-07-02 13:34:44 +00:00
Evgeniy Stepanov
1df4dfe87a
[sanitizer] Intercept setlocale.
...
llvm-svn: 185416
2013-07-02 09:23:45 +00:00
Alexey Samsonov
4798a08df8
[ASan] try to fix Windows build
...
llvm-svn: 185345
2013-07-01 16:38:38 +00:00
Alexey Samsonov
9857ca2564
[ASan] Properly disable strict init-order checking when pthread_create is called
...
llvm-svn: 185342
2013-07-01 16:16:41 +00:00
Evgeniy Stepanov
654688bed5
[msan] Intercept stpcpy.
...
llvm-svn: 185340
2013-07-01 15:19:37 +00:00
Evgeniy Stepanov
8a4e24ea8b
[sanitizer] Intercept getnameinfo.
...
llvm-svn: 185338
2013-07-01 13:51:31 +00:00
Alexey Samsonov
7a1ad5e605
Change __sanitizer_symbolize_demangle hook return type to 'int'
...
llvm-svn: 185326
2013-07-01 11:20:56 +00:00
Alexander Potapenko
0fde89f2aa
[ASan] Cache atos processes to make Darwin symbolication faster.
...
Patch by Jesse Ruderman<jruderman@gmail.com>
llvm-svn: 185325
2013-07-01 10:51:31 +00:00
Sergey Matveev
6b5a492091
[sanitizer] Use the correct macro to check glibc version.
...
llvm-svn: 185324
2013-07-01 10:15:29 +00:00
Alexey Samsonov
c3832f7788
[ASan] Add sanity test for asan_symbolize.py script
...
llvm-svn: 185318
2013-07-01 09:15:19 +00:00
Evgeniy Stepanov
d6e856f722
[sanitizer] Fix build with older kernels.
...
PTRACE_SETREGSET & PTRACE_GETREGSET may be missing from linux headers.
llvm-svn: 185317
2013-07-01 09:10:34 +00:00
Alexey Samsonov
cc510707af
[ASan] Remove leading underscores from function names in output tests
...
llvm-svn: 185315
2013-07-01 08:41:45 +00:00
Alexey Samsonov
8918140809
Hide mlock/munlock info message under verbosity flag.
...
llvm-svn: 185314
2013-07-01 08:25:29 +00:00
Alexey Samsonov
e71f37c1cd
Define the path to llvm-symbolizer tool in a common config to reduce copy-paste
...
llvm-svn: 185286
2013-06-30 14:47:38 +00:00
Richard Smith
079fe209f5
Fix typo found by Clang fix for extern "C" function handling.
...
llvm-svn: 185234
2013-06-28 22:28:37 +00:00
Alexey Samsonov
13f89cd19b
[ASan] Remove %symbolize from lit tests: we now use external symbolizer instead of python script
...
llvm-svn: 185163
2013-06-28 15:52:44 +00:00
Sergey Matveev
202881d1fe
[lsan] Fix build again.
...
llvm-svn: 185157
2013-06-28 15:23:15 +00:00
Sergey Matveev
b3fa575f7b
[lsan] Fix build.
...
llvm-svn: 185156
2013-06-28 15:18:06 +00:00
Sergey Matveev
6672004c47
[lsan] When verbosity > 1, always print suppressions and summary (even if no leaks found).
...
Also fix an output bug.
llvm-svn: 185153
2013-06-28 15:05:16 +00:00
Sergey Matveev
2b19ee3da8
[lsan] Add suppression support.
...
llvm-svn: 185152
2013-06-28 14:38:31 +00:00
Evgeniy Stepanov
a127039258
[sanitizer] Disable all ptrace-related definitions on Android.
...
llvm-svn: 185150
2013-06-28 14:18:10 +00:00
Alexey Samsonov
002d764f21
[ASan] Migrate lit tests to external symbolizer from asan_symbolize.py script
...
llvm-svn: 185148
2013-06-28 12:50:12 +00:00
Alexey Samsonov
6a5b0758ec
Demangle names using pluggable internal symbolizer if possible
...
llvm-svn: 185146
2013-06-28 12:30:24 +00:00
Evgeniy Stepanov
4aef0ee57d
[sanitizer] Fix an unfortunate typo and disable ptrace interception on Android.
...
llvm-svn: 185145
2013-06-28 12:16:03 +00:00
Alexey Samsonov
28e68f9f2f
Pass --default-arch flag to external symbolizer. Fix line lengths.
...
llvm-svn: 185144
2013-06-28 12:13:31 +00:00
Evgeniy Stepanov
dec0f76c14
[sanitizer] Intercept ptrace.
...
llvm-svn: 185142
2013-06-28 11:02:43 +00:00