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
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
Summary:
These two functions are unavailable on MSVC2012, which breaks building the
ASAN tests with MSVC2012. Since the tests required to run these functions
are disabled on Windows for now, avoid building them to fix the MSVC2012
builds.
Test Plan: This is needed in order to fix building the ASAN tests with MSVC2012.
Reviewers: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5343
llvm-svn: 217763
Summary: This is copied from llvm/utils/unittest/CMakeLists.txt.
Test Plan: This partly enables building ASAN tests with MSVC2012.
Reviewers: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5342
llvm-svn: 217762
It turned out that we have to bridge more stuff between the executable
and the ASan RTL DLL than just __asan_option_detect_stack_use_after_return.
See PR20918 for more details.
llvm-svn: 217673
We may as well just use Symbolizer::GetOrInit() in all the cases.
Don't call Symbolizer::Get() early in tools initialization: these days
it doesn't do any important setup work, and we may as well create the
symbolizer the first time it's actually needed.
llvm-svn: 217558
FIx a problem reported by Jakub Jelinek: don't do early-exit from fatal
UBSan handlers: even if source location is disabled (i.e. acquired by
some other thread), we should continue the execution to make sure that:
a) some thread will print the error report before calling Die().
b) handler marked as noreturn will indeed not return.
Explicitly add "Die()" calls at the end of all fatal handlers to be
sure UBSan handlers don't introduce UB themselves.
llvm-svn: 217542
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
Add the missing AEABI functions that are part of the base platform ABI
specification. The provided implementation does the bare minimum to avoid
requiring libc headers. This permits the use of compiler-rt on bare-metal
environments which conform to EABI.
llvm-svn: 217322
This macro did not do anything at this point, and is not particularly needed for
Windows unless building the builtins as a shared library. NFC.
llvm-svn: 217321
We are interested in verifying that -gline-tables-only provides enough
debug information for verbose error reports and symbolized stack traces.
llvm-svn: 217284
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
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
There interceptors do not seem to be strictly necessary for tsan.
But we see cases where the interceptors consume 70% of execution time.
Memory blocks passed to fgetgrent_r are "written to" by tsan several times.
First, there is some recursion (getgrnam_r calls fgetgrent_r), and each
function "writes to" the buffer. Then, the same memory is "written to"
twice, first as buf and then as pwbufp (both of them refer to the same addresses).
llvm-svn: 216904
Currently it fails with:
# Testing race detector.
race_windows_amd64.syso:gotsan.cc:(.text+0x4d89): undefined reference to `__imp_SymGetModuleBase64'
race_windows_amd64.syso:gotsan.cc:(.text+0x4d90): undefined reference to `__imp_SymFunctionTableAccess64'
race_windows_amd64.syso:gotsan.cc:(.text+0x4dd8): undefined reference to `__imp_StackWalk64'
x86_64-w64-mingw32/bin/ld.exe: race_windows_amd64.syso
: bad reloc address 0x10 in section `.data'
collect2.exe: error: ld returned 1 exit status
llvm-svn: 216875
There is no reason to have different library names for shared and static
cases on linux. It also breaks Android where we install the shared asan-rt
library into the system and should keep the old name.
This change reverts most of r216380 limiting it to win32 targets only.
llvm-svn: 216533
With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON
(PR20214)
llvm-svn: 216447
At least check-asan works with this change.
If the change breaks anything, we'll need to add:
a) a comment describing why we have to use INTERCEPT_FUNCTION rather than
ASAN_INTERCEPT_FUNC
and
b) a test case.
llvm-svn: 216177
When writing a label to shadow memory, don't write if the value is already set to the value being written. This dramatically reduces real memory consumption in programs with sparse use of labels.
Test Plan: It would be nice to test that unnecessary writes are skipped, but I do not see how a unit test could do this.
Patch by Sam Kerner!
Differential Revision: http://reviews.llvm.org/D4894
llvm-svn: 215961
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