Commit Graph

4851 Commits

Author SHA1 Message Date
Viktor Kutuzov 30bd345613 [Msan] Generalize mapping facilities to add FreeBSD support
Differential Revision: http://reviews.llvm.org/D6387

llvm-svn: 222919
2014-11-28 11:42:55 +00:00
Evgeniy Stepanov a0b6899234 [msan] Fix origin propagation for select of floats.
MSan does not assign origin for instrumentation temps (i.e. the ones that do
not come from the application code), but "select" instrumentation erroneously
tried to use one of those.

https://code.google.com/p/memory-sanitizer/issues/detail?id=78

llvm-svn: 222918
2014-11-28 11:17:58 +00:00
Evgeniy Stepanov f34bad98af [asan] Remove the local copy of Android ucontext.h.
This header is present in the r10c release of the NDK.

llvm-svn: 222915
2014-11-28 10:37:44 +00:00
Viktor Kutuzov d977985e43 [Msan] Fix some interceptors to pass initialization on FreeBSD
Differential Revision: http://reviews.llvm.org/D6417

llvm-svn: 222885
2014-11-27 14:28:57 +00:00
Evgeniy Stepanov b52e3aba3f [asan] Disable preload tests on Android.
They don't test what they claim to because LD_PRELOAD applies to "not" instead
of the actual test binary. And all Android tests run with LD_PRELOAD anyway.

llvm-svn: 222835
2014-11-26 15:44:15 +00:00
Viktor Kutuzov fb61eae0e4 [Asan] Fix the heavy_uar_test.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6406

llvm-svn: 222826
2014-11-26 11:38:45 +00:00
Viktor Kutuzov 38ec0481d2 [Msan] Exclude non-FreeBSD interceptors on FreeBSD
Differential Revision: http://reviews.llvm.org/D6404

llvm-svn: 222822
2014-11-26 10:51:49 +00:00
Viktor Kutuzov 3e4542eac4 [Msan] Check returning value of DTLS_Get()
Differential Revision: http://reviews.llvm.org/D6403

llvm-svn: 222818
2014-11-26 10:42:02 +00:00
Alexey Samsonov 4cc76cb872 [Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead of hardcoded constants
llvm-svn: 222803
2014-11-26 01:48:39 +00:00
Alexey Samsonov 9f8d091ea9 [ASan] Fix typo in test
llvm-svn: 222800
2014-11-26 00:23:51 +00:00
Evgeniy Stepanov 089c066bd6 [msan] Remove leftover MSanDR bits in tests.
llvm-svn: 222762
2014-11-25 15:00:23 +00:00
Viktor Kutuzov 28e3d0b6f9 [Sanitizers] Intercept __tls_get_addr() and shmctl() on FreeBSD
Differential Revision: http://reviews.llvm.org/D6384

llvm-svn: 222757
2014-11-25 13:08:02 +00:00
Viktor Kutuzov 9b75b757de [Asan] Pack signal context into a structure
Differential Revision: http://reviews.llvm.org/D6148

llvm-svn: 222756
2014-11-25 13:00:21 +00:00
Jay Foad 0160570a0f [ASan] Fix leak tests on 64-bit targets other than x86-64 (take two)
Summary:
First, remove lit configuration that sets ASAN_OPTIONS to detect_leaks=1
because this is already the default when leak detection is supported.
This removes a bit of duplication between various lit.cfg files.

Second, add a new feature 'leak-detection' if we're targetting x86_64
(not i386) on Linux.

Third, change a couple of tests that need leak detection to require the
new 'leak-detection' feature.

Reviewers: kcc, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6396

llvm-svn: 222738
2014-11-25 07:56:04 +00:00
Yury Gribov 4646b11acf [asan] Improvements for asan deactivated mode: disable asan activation for runtime library on Linux, disable malloc checks.
Reviewed in http://reviews.llvm.org/D6265

llvm-svn: 222732
2014-11-25 07:10:30 +00:00
Alexey Samsonov 49a040a483 [TSan] Deflake test
llvm-svn: 222699
2014-11-24 22:27:34 +00:00
Kostya Serebryany 4cadd4afa0 [asan/coverage] change the way asan coverage instrumentation is done: instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected
llvm-svn: 222675
2014-11-24 18:49:53 +00:00
Eric Fiselier 909deebfc8 [compiler-rt] Make the MSAN wmemset intercepter call wmemset instead of memset. Fixes PR 21579
Summary:
Exactly what the title says. I've tested this change against the libc++ test failures and it solves all of them. The check-msan rule also still passes.
I'm not sure why it called memset originally. 

I can add tests if requested but currently there are no tests involving wide chars and they are a c++11 features.

Reviewers: kcc, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6352

llvm-svn: 222673
2014-11-24 18:17:04 +00:00
Renato Golin 94a272d479 Try to fix ARM buildbots
llvm-svn: 222619
2014-11-22 16:59:03 +00:00
Reid Kleckner 04748b98a6 Don't make check-sanitizer depend on profile on Windows
We don't build the profiling library on Windows, so CMake warns that the
target doesn't exist.

llvm-svn: 222588
2014-11-21 23:09:51 +00:00
Jay Foad e47130e407 [ASan] Get fake stack code working with GCC 4.8.2.
Summary:
TestCases/Linux/heavy_uar_test.cc was failing on my
PowerPC64 box with GCC 4.8.2, because the compiler recognised
a memset-like loop and turned it into a call to memset, which
got intercepted by __asan_memset, which got upset because it was
being called on an address in high shadow memory.

Use break_optimization to stop the compiler from doing this.

Reviewers: kcc, samsonov

Reviewed By: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6266

llvm-svn: 222572
2014-11-21 21:25:09 +00:00
Alexander Potapenko 7a0f81a9b7 [ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint option in llvm-symbolizer
Let the users of SymbolizationLoop define a function that produces the list of .dSYM hints (possible path to the .dSYM bundle) for the given binary.
Because the hints can't be added to an existing llvm-symbolizer process, we spawn a new symbolizer process ones each time a new hint appears.
Those can only appear for binaries that we haven't seen before.

llvm-svn: 222535
2014-11-21 14:12:00 +00:00
Dmitry Vyukov 8a3934f85b sanitizer_common: fix function w/o return
When SANITIZER_USES_CANONICAL_LINUX_SYSCALLS the function misses return statement.

llvm-svn: 222532
2014-11-21 13:55:19 +00:00
Yury Gribov 30a990744b [asan] Runtime support for asan-instrument-allocas which enables instrumentation of variable-sized dynamic allocas. Patch by Max Ostapenko.
Reviewed at http://reviews.llvm.org/D6055

llvm-svn: 222520
2014-11-21 10:32:05 +00:00
Kuba Brecka b5b4dd81ba Move ASan non-Linux-specific tests out of the Linux/ directory
Reviewed at http://reviews.llvm.org/D6244

llvm-svn: 222486
2014-11-21 00:21:43 +00:00
Lorenzo Martignoni 101f1d82ff [DFSan] Add flag to dump the labels when the program terminates.
Differential Revision: http://reviews.llvm.org/D6306

llvm-svn: 222425
2014-11-20 10:01:08 +00:00
Alexey Samsonov de13018874 [MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).
Reviewed at http://reviews.llvm.org/D5906

llvm-svn: 222388
2014-11-19 21:42:33 +00:00
Dmitry Vyukov 9b80e5f969 tsan: fix binary names in tests
test_output.sh produces source.cc.exe binaries

llvm-svn: 222345
2014-11-19 10:47:06 +00:00
Dmitry Vyukov 1e8df882ce tsan: exclude unsupported test from test_output.sh script
llvm-svn: 222344
2014-11-19 10:46:23 +00:00
Dmitry Vyukov 6eef1d2259 tsan: don't add -pie when compiling tests
driver should add it as necessary

llvm-svn: 222343
2014-11-19 10:45:53 +00:00
Dmitry Vyukov 1f84559b7d tsan: fix Go build
llvm-svn: 222342
2014-11-19 10:43:11 +00:00
Kuba Brecka 638bb4a2a3 Make the ASan OS X DYLD_INSERT_LIBRARIES detection path-independent
Reviewed at http://reviews.llvm.org/D6238

ASan on Darwin during launch reads DYLD_INSERT_LIBRARIES env. variable and if it's not set or if the ASan dylib is not present in there, it relaunches the process. The check whether the dylib is present in the variable is now trying to find a full path in there. This fails in the scenarios where we want to copy the dylib to the executable's directory or somewhere else and set the DYLD_INSERT_LIBRARIES manually, see http://reviews.llvm.org/D6018.

Let's change the search in DYLD_INSERT_LIBRARIES to only look for the filename of the dylib and not the full path.

llvm-svn: 222297
2014-11-19 01:31:59 +00:00
Kostya Serebryany c9d251e4d1 [asan] initial support for experimental basic-block tracing; also add tests for various levels of -fsanitize-coverage
llvm-svn: 222291
2014-11-19 00:24:11 +00:00
Justin Bogner aa5bb91f5a profile: Robustify instrprof tests
Change these tests not to rely on the exact metadata numbers the
profile data gets.

llvm-svn: 222279
2014-11-18 23:03:14 +00:00
Evgeniy Stepanov e0a026f8ad [asan] Re-enable zero_page_pc test on Android.
It's not failing anymore. Not sure what has changed (the bot was down for a
long time), but lets keep it this way.

llvm-svn: 222236
2014-11-18 14:28:57 +00:00
Evgeniy Stepanov ca72ebb9ce [asan] Fix CMake CMP0046 warning in standalone build.
Make FileCheck an "imported dependency" in standalone build.

llvm-svn: 222234
2014-11-18 14:04:12 +00:00
Evgeniy Stepanov 7555f5ed1f [msan] Remove MSanDR and supporting code.
MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.

This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.

llvm-svn: 222232
2014-11-18 10:33:15 +00:00
Dmitry Vyukov bd167973b4 tsan: add description of AcquireGlobal function
llvm-svn: 222228
2014-11-18 06:44:43 +00:00
Jay Foad 670bdb5a64 Revert r222091 because it caused a buildbot failure.
llvm-svn: 222095
2014-11-16 09:44:37 +00:00
Jay Foad 83c97c6997 [ASan] Fix leak tests on 64-bit targets other than x86-64
Summary:
This test explicitly sets ASAN_OPTIONS=detect_leaks=1 which is only
supported on x86-64. The test is currently restricted to run only on
64-bit targets, but needs to be restricted further so it only runs on
x86-64.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6189

llvm-svn: 222091
2014-11-15 23:00:14 +00:00
Jay Foad eb392de411 As a follow up to r222001, Peter Bergner pointed out that there is
nothing 64-bit-specific about the PowerPC stack overflow detection.

llvm-svn: 222084
2014-11-15 13:52:10 +00:00
Kostya Serebryany 183cb6e35d [asan] add interface function __sanitizer_get_total_unique_coverage; useful for coverage-guided in-process fuzzers
llvm-svn: 222060
2014-11-14 23:15:55 +00:00
Jay Foad 1180c05db2 [ASan] Improved stack overflow detection for PowerPC64
Summary:
AsanOnSIGSEGV has some heuristics for detecting stack overflow, but
they don't cope with a PowerPC store-with-update instruction which
modifies sp and stores to the modified address in one instruction.

This patch adds some PowerPC-specific code to check for this case.

This fixes the last few cases of the stack-overflow test.

Reviewers: kcc, samsonov, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6253

llvm-svn: 222001
2014-11-14 15:30:39 +00:00
Evgeniy Stepanov ceaebb8ebb [sanitizer] Extend a comment in SlowUnwind.
This better explains a change in r221520.

llvm-svn: 222000
2014-11-14 15:13:23 +00:00
Evgeniy Stepanov ba7308c07e [asan] Revert r221882.
This code is not part of ASan runtime (as it may be linked into a different
DSO), and thus can not call non-exported functions.

llvm-svn: 221986
2014-11-14 13:02:28 +00:00
Alexey Samsonov cbbd2fd8d6 [Profile] Always build profile runtime library with -fPIC.
This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.

llvm-svn: 221952
2014-11-14 00:16:26 +00:00
Alexey Samsonov 4925fd4b05 Fix -Wcast-qual warnings in sanitizers
llvm-svn: 221936
2014-11-13 22:40:59 +00:00
Jay Foad 66928be0af [ASan] Really fix zero_page_pc test for PowerPC
Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.

On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).

On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.

You can see this difference if you run the test case under gdb.

Reviewers: kcc, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6226

llvm-svn: 221929
2014-11-13 21:53:00 +00:00
Alexey Samsonov 829da45631 [CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.
llvm-svn: 221925
2014-11-13 21:19:53 +00:00
Yury Gribov ecfa592671 Removed r221896, it seems to break build in various ways.
llvm-svn: 221912
2014-11-13 19:37:30 +00:00