Dmitry Vyukov
6466f43688
tsan: fix crash when a program registers zillions of atexit callbacks
...
I don't remember that crash on mmap in internal allocator
ever yielded anything useful, only crashes in rare wierd untested situations.
One of the reasons for crash was to catch if tsan starts allocating
clocks using mmap. Tsan does not allocate clocks using internal_alloc anymore.
Solve it once and for all by allowing mmaps.
llvm-svn: 217929
2014-09-17 00:12:50 +00:00
Dmitry Vyukov
69c4d37b45
tsan: support longjmp out of signal handlers
...
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=75
llvm-svn: 217908
2014-09-16 21:48:22 +00:00
Joerg Sonnenberger
ed35a3e717
Implement floatsitf, floatunstfsi, which perform
...
(signed/unsigned)integer to quad-precision conversion.
Submitted by GuanHong Liu.
Differential Revision: http://reviews.llvm.org/D2805
llvm-svn: 217901
2014-09-16 20:34:41 +00:00
Evgeniy Stepanov
3905bb9150
[asan] De-flake one test.
...
This change replaces an in-test timeout with an unconditional blocking wait.
It speeds up normal execution significantly at the cost of hanging up indefinitely
in case of a failure. This is a very specific regression test and we don't
expect any failures in the future.
Another approach ould be increasing the timeout to ~8 seconds, which seems too
much for a lit test.
llvm-svn: 217870
2014-09-16 12:03:52 +00:00
Evgeniy Stepanov
6ef0106e43
[asan] Fix a comment in a test.
...
llvm-svn: 217869
2014-09-16 12:01:01 +00:00
Evgeniy Stepanov
a59459de27
[asan] Fix a flaky test.
...
This test has a chance to hit some other random allocation
and get neither heap overflow nor SEGV.
Relax test condition to only check that there is no internal CHECK failure.
llvm-svn: 217769
2014-09-15 13:05:40 +00:00
Evgeniy Stepanov
7a8330e7bf
[asan] Fix path in test.
...
llvm-svn: 217754
2014-09-15 09:33:20 +00:00
Evgeniy Stepanov
207930d345
[asan] Disable wait4 test on Android.
...
https://code.google.com/p/memory-sanitizer/issues/detail?id=64
llvm-svn: 217753
2014-09-15 09:20:15 +00:00
Timur Iskhodzhanov
651725e191
[ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
...
llvm-svn: 217679
2014-09-12 14:01:30 +00:00
Alexey Samsonov
74f07ed7fe
Revert r217616. Problems and complexity it introduces negate its benefit
...
llvm-svn: 217652
2014-09-12 01:26:57 +00:00
Alexey Samsonov
5d2c0dfe4c
[UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even if
...
UBSan is combined with ASan.
llvm-svn: 217616
2014-09-11 18:20:11 +00:00
Alexey Samsonov
b69d5dffc3
[UBSan] Add halt_on_error runtime flag
...
llvm-svn: 217535
2014-09-10 19:35:31 +00:00
Yuri Gorshenin
6118d07b00
[asan-assembly-instrumentation] Added end-to-end test for proper stack unwind for functions with inline assembly.
...
Summary: [asan-assembly-instrumentation] Added end-to-end test for proper stack unwind for functions with inline assembly.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5260
llvm-svn: 217487
2014-09-10 10:44:35 +00:00
Alexey Samsonov
90452df7b1
Report source location of returns_nonnull attribute in UBSan reports.
...
llvm-svn: 217400
2014-09-08 20:17:19 +00:00
Alexey Samsonov
8e1162c71d
Implement nonnull-attribute sanitizer
...
Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnull in runtime.
To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
(where applicable) and if function declaration has nonnull attribute specified
for a certain formal parameter, we compare the corresponding RValue to null as
soon as it's calculated.
Test Plan: regression test suite
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits, rnk
Differential Revision: http://reviews.llvm.org/D5082
llvm-svn: 217389
2014-09-08 17:22:45 +00:00
Evgeniy Stepanov
256d5512e6
[msan] Fix wrong array index in io_submit interceptor.
...
llvm-svn: 217362
2014-09-08 09:28:25 +00:00
Evgeniy Stepanov
36974a7061
[msan] Make chained_origin_limits test faster.
...
llvm-svn: 217361
2014-09-08 09:04:45 +00:00
Alexey Samsonov
62063b46fc
Use "-gline-tables-only" instead of "-g" in sanitizer test suites.
...
We are interested in verifying that -gline-tables-only provides enough
debug information for verbose error reports and symbolized stack traces.
llvm-svn: 217284
2014-09-05 22:05:32 +00:00
Alexander Potapenko
869342c1cb
[ASan] disable zero_page_pc.cc on Android.
...
Bug: https://code.google.com/p/address-sanitizer/issues/detail?id=336
llvm-svn: 217228
2014-09-05 06:26:08 +00:00
Kostya Serebryany
d147590492
[asan] trying to de-flake new_array_cookie_uaf_test.cc
...
llvm-svn: 217177
2014-09-04 18:02:59 +00:00
Justin Bogner
cc0d7eeb6d
profile: Avoid name collisions between instrumentation and runtime
...
The naming scheme we're using for counters in profile data shares a
prefix with some fixed names we use for the runtime, notably
__llvm_profile_data_begin and _end. Embarrassingly, this means a
function called begin() can't be instrumented.
This modifies the runtime names so as not to collide with the
instrumentation.
llvm-svn: 217166
2014-09-04 15:45:31 +00:00
Alexander Potapenko
7c3d581e8a
[ASan] Remove the check for a double-SEGV from zero_page_pc.cc
...
Looks like the second crash doesn't happen on Mac.
llvm-svn: 217165
2014-09-04 15:40:25 +00:00
Evgeniy Stepanov
e9ca1c72be
[msan] Fix fork test on centos-6.5.
...
Missing <atomic> header.
llvm-svn: 217142
2014-09-04 11:07:42 +00:00
Evgeniy Stepanov
bb91e02efd
[msan] Make origin tracking fork-safe.
...
Chained origins make plain memory stores async-signal-unsafe.
We already disable it inside signal handlers.
This change grabs all origin-related locks before fork() and releases
them after fork() to avoid a deadlock in the child process.
llvm-svn: 217140
2014-09-04 10:36:14 +00:00
Alexander Potapenko
9d24aa0fa8
[ASan] allow deadly signals to be received in signal handlers
...
(previously ASan would just crash upon the second SEGV)
Other tools do not use this code yet.
llvm-svn: 217137
2014-09-04 09:34:22 +00:00
Alexey Samsonov
c8d8ca0bd6
Fix fast stack unwind on ARM to support code generated with GCC.
...
http://reviews.llvm.org/D4692
Patch by Maxim Ostapenko!
llvm-svn: 217079
2014-09-03 21:10:44 +00:00
Dmitry Vyukov
f8cfdd9207
tsan: handle early signals
...
The second part of the fix of
https://code.google.com/p/thread-sanitizer/issues/detail?id=71
llvm-svn: 217031
2014-09-03 12:25:22 +00:00
Evgeniy Stepanov
f1741f52ad
[msan] Fix origin_history_per_stack_limit=0 behavior.
...
It disables the per-stack limit.
llvm-svn: 217030
2014-09-03 12:15:59 +00:00
Dmitry Vyukov
26411d6929
tsan: more precise handling of atexit callbacks
...
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=74
llvm-svn: 216906
2014-09-02 14:22:31 +00:00
Dmitry Vyukov
1841219abd
tsan: restructure signal handling to allow recursive handling
...
Fixes issue
https://code.google.com/p/thread-sanitizer/issues/detail?id=71
llvm-svn: 216903
2014-09-02 12:27:45 +00:00
Dmitry Vyukov
34fb3799a3
tsan: fix false positive related to signal handlers
...
Users expect synchronization between sigaction and arrival
of the signal. See the test for details.
llvm-svn: 216878
2014-09-01 12:46:42 +00:00
Kostya Serebryany
c148f7c3af
[asan] enable poison_array_cookie back
...
llvm-svn: 216705
2014-08-29 01:16:18 +00:00
Kostya Serebryany
ac77055272
[asan] introduce __asan_load_cxx_array_cookie: check that the array cookie address is properly poisoned and return the cookie value. If not, return 0 to avoid infinite loop of DTORs (in case of use-after-free). Calls to this function will be inserted by clang (separate change)
...
llvm-svn: 216692
2014-08-28 22:28:04 +00:00
Kostya Serebryany
1e3b338606
[asan] disable poison_array_cookie while I am investigating a false positive on chromium (I suspect that LLVM looses nosanitizer metadata; no test yet)
...
llvm-svn: 216684
2014-08-28 20:24:05 +00:00
Timur Iskhodzhanov
f77d20b1a9
[ASan/Win] Add a test case for r216663 [-Zl vs LIBCMT vs asan_win_uar_thunk]
...
llvm-svn: 216665
2014-08-28 13:20:23 +00:00
Alexander Potapenko
2164fa3b9b
[ubsan] Follow-up for r216657: fixed the line numbers in the test.
...
llvm-svn: 216661
2014-08-28 10:25:17 +00:00
Alexander Potapenko
53cce89a81
[UBSan] Temporarily disable checks for stack traces in UBSan reports on Darwin
...
to make the tests green.
Slow stack unwinding is disabled in libsanitizer on Darwin now.
llvm-svn: 216657
2014-08-28 09:25:06 +00:00
Evgeniy Stepanov
5d321d759d
[asan] Add asprintf negative test.
...
llvm-svn: 216542
2014-08-27 12:46:58 +00:00
Kostya Serebryany
9455c5ab81
[asan] add a test for poison_array_cookie=1
...
llvm-svn: 216494
2014-08-26 22:05:12 +00:00
Sergey Matveev
08347ca4fd
[lsan] Implement the public allocator interface in standalone LSan.
...
llvm-svn: 216459
2014-08-26 14:28:28 +00:00
Sergey Matveev
93a2906e80
[lsan] Implement __sanitizer_print_stack_trace() in standalone LSan.
...
llvm-svn: 216454
2014-08-26 12:52:41 +00:00
Timur Iskhodzhanov
81885731a8
[ASan/Win] Rename asan_dll_thunk.cc to asan_win_dll_thunk.cc
...
llvm-svn: 216448
2014-08-26 10:21:37 +00:00
Kostya Serebryany
74bd6bc9f9
[sanitizer] move mlock interceptor from asan/tsan/msan to common; no functionality change intended
...
llvm-svn: 216407
2014-08-25 20:57:59 +00:00
Alexey Samsonov
2ccbc621df
[UBSan] Add support for printing backtraces to all UBSan handlers
...
llvm-svn: 216289
2014-08-22 21:42:04 +00:00
Alexander Potapenko
ea2402ebf4
[ubsan] Follow-up for r216263: fix the expected line number.
...
llvm-svn: 216266
2014-08-22 12:44:16 +00:00
Timur Iskhodzhanov
220ddacf8d
[ASan/Win] Land the trivial bits of -MD RTL support (PR20214)
...
llvm-svn: 216265
2014-08-22 12:38:07 +00:00
Alexander Potapenko
66ae9712c5
[ubsan] Do not run Function/function.cpp on Darwin where -fsanitize=function is not supported.
...
llvm-svn: 216263
2014-08-22 11:09:10 +00:00
Alexey Samsonov
2e39027931
[LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined with
...
another sanitizer.
A user may run both LSan and LSan+ASan. It is weird to pass path to leak
suppression file (or other common sanitizer flags, like "verbosity") in
"LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case.
llvm-svn: 215949
2014-08-18 23:39:47 +00:00
Alexey Samsonov
00c02b297a
Add regression test for PR15823
...
llvm-svn: 215941
2014-08-18 22:11:14 +00:00
Alexey Samsonov
591d15272e
[TSan] Add -lpthread to the test which uses pthread_ functions
...
llvm-svn: 215939
2014-08-18 22:09:17 +00:00