Commit Graph

5051 Commits

Author SHA1 Message Date
Chandler Carruth 11fb7a49ae [cmake/multilib] Support multilib libdir suffixes by applying the
LLVM_LIBDIR_SUFFIX variable to one place in the cmake file.

This is all that I had to do to get everything from compiler-rt working
for me, but there may be more work required if folks are relying on more
parts of compiler-rt. Notably, I'm mostly using it for the sanitizers.

llvm-svn: 224928
2014-12-29 12:26:30 +00:00
Kuba Brecka c52f300698 [sanitizer-common] Fixing the ASan test build failure on OS X
The change in r224819 started using internal_unlink in a sanitizer_common unit test. For some reason, internal_unlink is not defined in sanitizer_mac.cc, fixing that.

llvm-svn: 224910
2014-12-29 02:18:59 +00:00
Daniel Jasper 1e8eafd6c8 Escape ? to silence GCC warning about trigraphs.
llvm-svn: 224863
2014-12-26 18:21:34 +00:00
Evgeniy Stepanov 9e609426a7 [sanitizer] Treat \r, \n, \t as flag separators.
llvm-svn: 224858
2014-12-26 16:09:15 +00:00
Evgeniy Stepanov ef0f244594 [asan] Fix possibly uninitialized coverage flag.
llvm-svn: 224857
2014-12-26 16:07:33 +00:00
Timur Iskhodzhanov a04b33b9de [ASan/Win] Add basic support for MemoryRangeIsAvailable and DumpProcessMap to make it easier to debug startup shadow mapping failures
llvm-svn: 224856
2014-12-26 14:28:32 +00:00
Evgeniy Stepanov 103084691d [asan] Bump coverage size limit on 32-bit platforms.
This increases the limit from 4M locations to 16M, reserving
64Mb virtual memory. Chrome has >5M unique coverage locations with coverage=3.

llvm-svn: 224855
2014-12-26 13:54:11 +00:00
Evgeniy Stepanov da02effd9e [asan] Extend coverage test.
llvm-svn: 224854
2014-12-26 12:51:31 +00:00
Evgeniy Stepanov 05dc4be0dc [asan] Allow enabling coverage at activation.
This is a re-commit of r224838 + r224839, previously reverted in r224850.
Test failures were likely (still can not reproduce) caused by two lit tests
using the same name for an intermediate build target.

llvm-svn: 224853
2014-12-26 12:32:32 +00:00
Timur Iskhodzhanov b8373bc119 [ASan/Win] Suppress error messaging when Abort() is called
This will prevent ASan bots from hanging / timing out

llvm-svn: 224852
2014-12-26 12:25:54 +00:00
Evgeniy Stepanov f8c7e25560 Revert r224838, r224839.
Flaky failures on the build bots.

llvm-svn: 224850
2014-12-26 10:19:56 +00:00
Evgeniy Stepanov b723834d82 [sanitizer] Tweak sancov.py output.
llvm-svn: 224841
2014-12-25 16:03:24 +00:00
Evgeniy Stepanov 01b922d9f2 [sanitizer] sancov.py: print status to stderr
llvm-svn: 224840
2014-12-25 16:01:09 +00:00
Evgeniy Stepanov 300d29a75d [asan] Disable __sanitizer_cov_dump registration on Windows.
Looks like we can't use atexit() during ASan initialization on Windows.

llvm-svn: 224839
2014-12-25 15:11:00 +00:00
Evgeniy Stepanov be9a53fec6 [asan] Allow enabling coverage at activation.
llvm-svn: 224838
2014-12-25 14:26:45 +00:00
Timur Iskhodzhanov fe5c5b98b3 Simplify allocator_returns_null.cc test
llvm-svn: 224837
2014-12-25 13:03:58 +00:00
Dmitry Vyukov bda655004e tsan: fix trace initialization during thread id reuse
The current code leaves the first event in the trace part uninitialized
(from the previous thread). It can cause unpredictable behavior
during stack/mutexset restoration.
Initialize the first event to a fake harmless memory access.

llvm-svn: 224834
2014-12-25 10:32:25 +00:00
Evgeniy Stepanov cb2f6d4314 [asan] Support ASAN_ACTIVATION_OPTIONS.
This is mostly useful for testing, as the only other way of specifying
activation options (Android system property) is system-wide and affects
concurrently running tests.

llvm-svn: 224824
2014-12-24 16:58:50 +00:00
Timur Iskhodzhanov ced288f822 [ASan/Win] Bandaid fix for PR22025 -- deadlocks when creating suspended threads
llvm-svn: 224823
2014-12-24 16:14:16 +00:00
Evgeniy Stepanov 5a09b2cdeb [sanitizer] Disable InternalMmapWithOffset test on OSX.
llvm-svn: 224822
2014-12-24 13:59:35 +00:00
Evgeniy Stepanov ca9e045570 [sanitizer] Fix off-by-8x in direct coverage.
File mapping offset was calculated by offsetting (uptr *) instead of (char *).

llvm-svn: 224821
2014-12-24 13:57:11 +00:00
Evgeniy Stepanov 40b16f4037 [sanitizer] Disable InternalMmapWithOffset test on Windows.
llvm-svn: 224820
2014-12-24 13:05:21 +00:00
Evgeniy Stepanov 98211121ab [sanitizer] mmap2 syscall works with 4096-byte units instead of bytes.
Ouch.

llvm-svn: 224819
2014-12-24 12:58:09 +00:00
Evgeniy Stepanov 0b7c1cf1e0 [asan] Disable one test on Android.
It used to pass by chance and started failing on recent Android builds.

llvm-svn: 224818
2014-12-24 12:23:15 +00:00
Jay Foad 4195dff0fb [ASan] Fix asan_preload_test-2 on PowerPC64 Linux
Summary:
This test failed because clang compiled the call to memset() into a
single sth instruction, instead of a call. Fix it by using write() instead
of memset().

Reviewers: kcc, samsonov, garious, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 224812
2014-12-24 11:48:40 +00:00
Kostya Serebryany 9fdeb37bd3 [asan] change the coverage collection scheme so that we can easily emit coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset
llvm-svn: 224789
2014-12-23 22:32:17 +00:00
Evgeniy Stepanov b2dacb0c76 [asan] Fix line >80 chars.
llvm-svn: 224763
2014-12-23 10:18:47 +00:00
Evgeniy Stepanov 874b2bb228 [asan] Better error message in coverage.
llvm-svn: 224762
2014-12-23 10:12:51 +00:00
Dmitry Vyukov 10070626b7 tsan: fix style
Usually we roll the variable declaration into the condition in cases like this.

llvm-svn: 224755
2014-12-23 07:21:23 +00:00
Kuba Brecka 5238deb2ff Change the CMake build to generate full debugging info when COMPILER_RT_DEBUG=ON
The compiler-rt CMake build currently uses -gline-tables-only for all builds. While this makes the debugger correctly map source files, debugging of the runtime libraries in general is pretty tough, because you don't see any local variables, parameters, etc. Let's allow emitting full debugging info by setting COMPILER_RT_DEBUG=ON.

Reviewed at http://reviews.llvm.org/D6764

llvm-svn: 224749
2014-12-23 01:52:53 +00:00
Alexey Samsonov b430f6e17a [Sanitizer] Make CommonFlags immutable after initialization.
Summary:
Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and
OverrideCommonFlags() functions, which are only supposed to be
called during initialization.

Test Plan: regression test suite

Reviewers: kcc, eugenis, glider

Subscribers: llvm-commits

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

llvm-svn: 224736
2014-12-22 21:46:10 +00:00
Viktor Kutuzov 54c7590073 [Msan] Fix msan_test.cc inclusions to build the unit tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6757

llvm-svn: 224724
2014-12-22 19:14:23 +00:00
Kuba Brecka 742c471142 AddressSanitizer: Abort after failed exec() and get rid of the allow_reexec ASan flag
As mentioned in
https://code.google.com/p/address-sanitizer/issues/detail?id=365, when the
re-exec that adds the required DYLD_INSERT_LIBRARIES variable fails, ASan
currently continues to run, but things are broken (some memory can be
overwritten, interceptors don't work, ...). This patch aborts if the execv()
fails and prints an error message that DYLD_INSERT_LIBRARIES is required. It
also removes the "alllow_reexec" flag, since using it causes the same issues.

Reviewed at http://reviews.llvm.org/D6752

llvm-svn: 224712
2014-12-22 17:32:27 +00:00
Kuba Brecka 090d33e393 AddressSanitizer: Properly handle dispatch_source_set_cancel_handler with a
NULL handler

Per
https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html,
the dispatch_source_set_cancel_handler() API *can* be called with a NULL
handler. In that case, the libdispatch removes an already existing cancellation
handler, if there was one. ASan's interceptor always creates a new block that
always tries to call the original handler. In case the original block is NULL,
a segmentation fault happens. Let's fix that by not wrapping a NULL-block at
all.

It looks like all the other libdispatch APIs (which we intercept) do *not*
allow NULL. So it's really only the dispatch_source_set_cancel_handler one that
needs this fix.

Reviewed at http://reviews.llvm.org/D6747

llvm-svn: 224711
2014-12-22 17:30:04 +00:00
Alexander Potapenko 7f9be7120d [ASan] Fix the logic that decides whether we need to spawn a new llvm-symbolizer in asan_symbolize.py
llvm-svn: 224710
2014-12-22 16:00:00 +00:00
Viktor Kutuzov 90f8673f05 [Sanitizers] Intercept wcsnrtombs() on FreeBSD
Differential Revision: http://reviews.llvm.org/D6755

llvm-svn: 224709
2014-12-22 14:45:30 +00:00
Viktor Kutuzov 2a5b81dd7f [Msan] Fix uname() interception on FreeBSD
Differential Revision: http://reviews.llvm.org/D6738

llvm-svn: 224708
2014-12-22 14:42:24 +00:00
Dmitry Vyukov c1a04162ba tsan: reset stack0 in the first partition of thread trace
stack0/mset0 contained bogus values from the previous thread
that used the same id

llvm-svn: 224702
2014-12-22 12:32:52 +00:00
Dmitry Vyukov 8f9911b571 tsan: fix debugging output
llvm-svn: 224701
2014-12-22 12:31:32 +00:00
Viktor Kutuzov d4c3ffc5bf [Sanitizers] Intercept snprintf_l() on FreeBSD
Differential Revision: http://reviews.llvm.org/D6418

llvm-svn: 224700
2014-12-22 12:29:40 +00:00
Viktor Kutuzov 35fb0b5d52 [Sanitizers] Intercept wordexp on FreeBSD
Differential Revision: http://reviews.llvm.org/D6737

llvm-svn: 224699
2014-12-22 12:21:35 +00:00
Dmitry Vyukov 732b128129 tsan: add acquire/release functions to java interface
they are required to handle synchronization on volatile/final fields

llvm-svn: 224697
2014-12-22 09:44:56 +00:00
Kuba Brecka 2ce8c25f4b log-path_test testcase - make the invalid path more invalid
The ASan test/asan/TestCases/log-path_test.cc testcase uses /INVALID as an invalid path and expects that the program will not be allowed to create or write to that file. This actually is a valid writable path on one of my setups. Let's make the path more invalid.

Reviewed at http://reviews.llvm.org/D6727

llvm-svn: 224694
2014-12-22 00:02:28 +00:00
Kostya Serebryany baae9d2df1 [sanitizer] fix a performance regression in sanitizer coverage: move a small perf-critical function to a header. ALso set the coverage guard to 1 before the early return from CoverageData::Add
llvm-svn: 224660
2014-12-20 01:45:28 +00:00
Kostya Serebryany f053fc9b5c [sanitizer] initialize two flas in SetCommonFlagsDefaults
llvm-svn: 224645
2014-12-19 23:09:59 +00:00
Alexey Samsonov 2f8c8d59b2 [Sanitizer] Refactor CommonFlags interface. NFC.
Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(),
so that this object can be easily tested. Enforce
that ParseCommonFlagsFromString() and SetCommonFlagsDefaults()
work only with singleton CommonFlags, shared across all sanitizer
runtimes.

llvm-svn: 224617
2014-12-19 21:40:04 +00:00
Alexey Samsonov 04eeec32e6 [ASan] Change activation strategy.
Now ASan deactivation doesn't modify common or ASan-specific runtime
flags. Flags stay constant after initialization, and "deactivation"
instead stashes initialized runtime state, and deactivates the
runtime. Activation then just restores the original state (possibly,
overriden by some activation flags provided in system property on
Android).

llvm-svn: 224614
2014-12-19 20:35:53 +00:00
Alexey Samsonov 30f330b39b [Sanitizer] Make Quarantine::Init slightly safer.
ASan Quarantine can be reinitialized at activation/deactivation.
Make max_size_/min_size_ atomic.

llvm-svn: 224613
2014-12-19 20:35:50 +00:00
Alexey Samsonov d6b24fa1e2 [ASan] Introduce AllocatorOptions to configure allocator behavior.
Summary:
Reduce the dependency of allocator code on runtime flags. Instead,
pass a bunch of options that configure allocator behavior at
initialization or re-initialization. That would allow us to
cleaner modify allocator behavior during a program execution
when ASan is activated or de-activated.

Test Plan: regression test suite

Reviewers: kcc

Subscribers: llvm-commits, eugenis

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

llvm-svn: 224605
2014-12-19 19:35:11 +00:00
Alexey Samsonov 1b64854574 [ASan] Restrict the set of flags overriden at activation.
Summary:
Change the way ASan flag parsing is performed at activation: instead
of overwriting all ASan and common flags from the activation string,
ASan will now only override a handful of whitelisted flags.
This is a first step towards making runtime flags immutable after
initialization. I plan to re-factor the activation stragegy to
the following one:

  - Parse commandline flags. Override the defaults from compile
    definition, env var, etc. Flags are immutable at this point.
  - Initiailize the runtime from commandline flags.
  - If ASan needs to be started deactivated, stash the runtime
    state in "asan_deactivated_flags" and deactivate the runtime.
  - When ASan is activated, override "asan_deactivated_flags" with
    activation flags, and use it to re-activate the runtime.

Test Plan: regression test suite

Reviewers: eugenis, kcc

Subscribers: llvm-commits

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

llvm-svn: 224601
2014-12-19 19:16:07 +00:00
Alexey Samsonov 583e9d29ad [ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().
llvm-svn: 224600
2014-12-19 19:16:02 +00:00
Saleem Abdulrasool 5bbc718539 builtins: rely on the compiler for user label prefix
clang does not like the definition of builtins.  In order to work around this,
we use a SUN CC to redefine the generated name.  However, this requires that we
account for the user label prefix.  Rather than hard coding that into the file,
rely on the compiler to tell us the information and use the preprocessor to
generate the name as we do in the assembly routines.  NFC.

llvm-svn: 224597
2014-12-19 18:54:13 +00:00
Sergey Matveev 5010b262aa [lsan] Add debug output to leak_check_before_thread_started.cc.
Trying to investigate why this test is flaky.

llvm-svn: 224580
2014-12-19 15:33:13 +00:00
Sergey Matveev 8cd909e749 [sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized.
llvm-svn: 224577
2014-12-19 14:45:19 +00:00
Dmitry Vyukov 7fe690ce12 tsan: intercept closedir
llvm-svn: 224575
2014-12-19 14:29:40 +00:00
Evgeniy Stepanov b01eee941d [asan] Test BB- and edge- level coverage on Android.
llvm-svn: 224572
2014-12-19 12:21:40 +00:00
Evgeniy Stepanov aa7daaef7e [asan] Add tests for direct (mmap-ed) mode for BB- and edge-level coverage.
llvm-svn: 224571
2014-12-19 11:49:46 +00:00
Evgeniy Stepanov fd454ec3d9 [asan] Resurrect sanitize-coverage test on Android.
The test got silently disabled because of a typo in the lit config.
Also, compiler flags have changed (asan-coverage -> fsanitize-coverage).

llvm-svn: 224569
2014-12-19 10:40:14 +00:00
Dmitry Vyukov 76d629744b tsan: add an additional test for signal handlers
the test passes now, but signal handling during thread creation
and shutdown is tricky

llvm-svn: 224532
2014-12-18 18:40:52 +00:00
Dmitry Vyukov f6fab7adcf tsan: disable __tls_get_addr interceptor
see the added comments for details, it's messy

llvm-svn: 224531
2014-12-18 18:39:55 +00:00
Dmitry Vyukov f7790012a5 tsan: fix data races between signal handler and sigaction
signal handler reads sa_sigaction when a concurrent sigaction call can modify it
as the result in could try to call SIG_DFL or a partially overwritten function pointer

llvm-svn: 224530
2014-12-18 18:31:47 +00:00
Filipe Cabecinhas 9fd326d4d6 Fix suppressions file usage
Summary:
Always quote suppressions files given to *_OPTIONS.
This will make it not break when given full Windows paths (otherwise,
parsing would stop after the drive's letter + ':').

Also fix one or two cases where the suppression files' extensions were
not *.supp.

Reviewers: samsonov, kcc

Subscribers: llvm-commits

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

llvm-svn: 224529
2014-12-18 18:25:18 +00:00
Jay Foad d348d7c757 [Sanitizer] Fix GetRSS on Linux with non-4k pages
Summary:
The numbers in /proc/self/statm are in pages, not in fixed 4k units.
This fixes Linux/hard_rss_limit_mb_test.cc on my PowerPC64 box which
has 64k pages.

Reviewers: kcc, willschm

Reviewed By: willschm

Subscribers: llvm-commits

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

llvm-svn: 224522
2014-12-18 16:24:01 +00:00
Dmitry Vyukov 84fa6b37f4 tsan: fix deadlock reporting
currently deadlock detector reports effectively random stacks in report after flush
because it looks at old edges with wrong stacks

llvm-svn: 224519
2014-12-18 14:05:34 +00:00
Dmitry Vyukov a8def72dd6 tsan: fix failing CHECK In deadlock detector
and re-enable the test

llvm-svn: 224518
2014-12-18 14:02:28 +00:00
Dmitry Vyukov 794771b08b tsan: disable the test even harder
currently it fails in cmake build with weird errors:

/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__clang_call_terminate':
/ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x12): undefined reference to `__cxa_begin_catch'
/ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x17): undefined reference to `std::terminate()'
/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `std::vector<int, std::allocator<int> >::_M_check_len(unsigned long, char const*) const':
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:1339: undefined reference to `std::__throw_length_error(char const*)'
/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
/tmp/real_deadlock_detector_stress_test-68a5ae.o:(.eh_frame+0x63): undefined reference to `__gxx_personality_v0'
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

llvm-svn: 224511
2014-12-18 10:55:41 +00:00
Dmitry Vyukov 8c7baa4abc tsan: add a stress test for deadlock detector
currently disabled because fails

llvm-svn: 224509
2014-12-18 10:32:48 +00:00
Dmitry Vyukov e1881269f8 tsan: don't crash with NULL deref during reporting
tctx==NULL crash observed during deadlock reporting.
There seems to be some bugs in the deadlock detector,
but it is still useful to be more robust during reporting.

llvm-svn: 224508
2014-12-18 10:19:32 +00:00
Dmitry Vyukov a4cd69217b tsan: disable flaky debug check
see the comment for details

llvm-svn: 224507
2014-12-18 10:17:01 +00:00
Petar Jovanovic 7a6f5e47cf Do not define CRT_HAS_128BIT for MIPS64
Do not define it for MIPS64 until its backend supports it.
See the bug report [1] for more information.

[1] http://llvm.org/bugs/show_bug.cgi?id=20098

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

llvm-svn: 224488
2014-12-18 01:21:33 +00:00
Alexey Samsonov ae23ffb751 [ASan] Mark test for -fsized-delete as XFAIL for dynamic runtime.
-fsized-delete is implemented via weak symbols, and doesn't work
properly when malloc/free replacements are provided in shared
ASan runtime.

llvm-svn: 224474
2014-12-17 23:46:53 +00:00
Alexey Samsonov 658e2d274d [ASan] Add -ldl to linker invocation to lit tests that require it.
This fixes these tests under dynamic ASan runtime.

llvm-svn: 224473
2014-12-17 23:46:49 +00:00
Renato Golin 518a7b2585 Fix obvious cut&paste error on AArch64 Compiler-RT settings
llvm-svn: 224472
2014-12-17 23:43:39 +00:00
Alexey Samsonov 969902b43b [ASan] Always build shared ASan runtime on Linux.
This commit changes the strategy for building shared ASan runtime
and the way we test it:
  - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now
    always build shared ASan runtime (it is the default on Android,
    Windows and Mac, and not the default on Linux and FreeBSD).
  - Platforms, which use static runtime by default now have
    "check-asan-dynamic" testsuite. This testsuite contains instrumented
    unit tests, and ASan lit tests, and runs them with shared ASan
    runtime. This testsuite is *not* a part of "check-asan" and
    *not* a part of "check-all", as adding 1000 more test cases, which
    duplicate existing ones is costly. However, you're welcome to
    add this command to your buildbot.

llvm-svn: 224470
2014-12-17 23:14:01 +00:00
Kostya Serebryany 20f3a52249 [sanitizer] add CombinedAllocator::InitIfLinkerInitialized and use it in lsan: speeds up lsan start-up time by ~25%
llvm-svn: 224469
2014-12-17 23:06:36 +00:00
Kostya Serebryany 4de56ef736 [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, compiler-rt part
llvm-svn: 224464
2014-12-17 21:51:07 +00:00
Alexey Samsonov 9aca5e07ec [ASan] Move flag parsing logic to asan_flags.cc. NFC.
llvm-svn: 224450
2014-12-17 19:31:39 +00:00
David Blaikie c2e03a9c0d Revert "Fix test cases given Clang's improved location information."
The Clang improevments were reverted due to failures created in an asan
bootstrap.

This reverts commit r224387.

llvm-svn: 224446
2014-12-17 19:11:27 +00:00
Evgeniy Stepanov 372deb091e [msan] Stop calling pthread_getspecific in signal handlers.
pthread_getspecific is not async-signal-safe.

MsanThread pointer is now stored in a TLS variable, and the TSD slot
is used only for its destructor, and never from a signal handler.

This should fix intermittent CHECK failures in MsanTSDSet.

llvm-svn: 224423
2014-12-17 10:30:06 +00:00
Dmitry Vyukov 508dd9b94c tsan: add disabled test case for issue 87
llvm-svn: 224422
2014-12-17 10:19:20 +00:00
Alexey Samsonov b2dcac0bb7 [ASan] Re-structure the allocator code. NFC.
Introduce "Allocator" object, which contains all the bits and pieces
ASan allocation machinery actually use: allocator from sanitizer_common,
quarantine, fallback allocator and quarantine caches, fallback mutex.

This step is a preparation to adding more state to this object. We want
to reduce dependency of Allocator on commandline flags and be able to
"safely" modify its behavior (such as the size of the redzone) at
runtime.

llvm-svn: 224406
2014-12-17 01:55:03 +00:00
Alexey Samsonov 2c31cc3cf1 Rename asan_allocator2.cc to asan_allocator.cc
llvm-svn: 224396
2014-12-17 00:26:50 +00:00
Alexey Samsonov 91bb25f515 [ASan] Introduce SetCanPoisonMemory() function.
SetCanPoisonMemory()/CanPoisonMemory() functions are now used
instead of "poison_heap" flag to determine if ASan is allowed
to poison the shadow memory. This allows to hot-patch this
value in runtime (e.g. during ASan activation) without introducing
a data race.

llvm-svn: 224395
2014-12-17 00:01:02 +00:00
David Blaikie 5413abf88f Fix test cases given Clang's improved location information.
llvm-svn: 224387
2014-12-16 23:07:55 +00:00
Kostya Serebryany 5f5bc4abd3 [asan] trying to fix Mac build
llvm-svn: 224370
2014-12-16 21:06:07 +00:00
Hans Wennborg 7dd94570b0 Fix Win build after r224353: void function returning zero.
llvm-svn: 224366
2014-12-16 20:46:05 +00:00
Renato Golin 398e9ccf8b Fixes wrong -march=aarch64 option in compiler-rt
llvm-svn: 224362
2014-12-16 20:31:37 +00:00
Kostya Serebryany 43eb7735f2 [asan] new flag: hard_rss_limit_mb
llvm-svn: 224353
2014-12-16 19:13:01 +00:00
Mohit K. Bhakkad a94a037528 internal_stat for mips64
llvm-svn: 224326
2014-12-16 07:11:08 +00:00
Kuba Brecka 731089bbce Add an MACOS_VERSION_UNKNOWN_NEWER enum value for OS X versions above 10.10.
We recently had a broken version check because an newer OS X version is treated as MACOS_VERSION_UNKNOWN which is less than all the defined values. Let's have a separate enum value for unknown but newer versions, so the ">=" and "<=" version checks still work even in upcoming OS X releases.

Reviewed at http://reviews.llvm.org/D6137

llvm-svn: 224315
2014-12-16 04:46:15 +00:00
Alexey Samsonov 1c65001e5e Fix data symbolization with libbacktrace. Patch by Jakub Jelinek!
llvm-svn: 224308
2014-12-16 01:52:55 +00:00
Alexey Samsonov bba821b5b1 [ASan] Allow to atomically modify malloc_context_size at runtime.
Summary:
Introduce __asan::malloc_context_size atomic that is used to determine
required malloc/free stack trace size. It is initialized with
common_flags()->malloc_context_size flag, but can later be overwritten
at runtime (e.g. when ASan is activated / deactivated).

Test Plan: regression test suite

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 224305
2014-12-16 01:23:03 +00:00
Kostya Serebryany 42102b110e [asan] introduce __sanitizer_set_death_callback, deprecate __asan_set_death_callback
llvm-svn: 224286
2014-12-15 23:02:57 +00:00
Duncan P. N. Exon Smith 4a7fddca0d Update lib/profile tests for metadata assembly change
Running the upgrade script from PR21532.  Hopefully this will unstick
compiler-rt bots [1] after r224257.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_check/181/

llvm-svn: 224276
2014-12-15 21:34:19 +00:00
Justin Bogner 42be29f748 profile: Add the relevant parts of lib/profile to cc_kext on darwin
Patch by Lawrence D'Anna. Thanks!

llvm-svn: 224270
2014-12-15 20:44:05 +00:00
Kumar Sukhani 3176f9b65d [ubsan][arm] supporting misaligned testcase
After previous commit: http://reviews.llvm.org/rL224242, misaligned testcase is now supported on ARM also

llvm-svn: 224243
2014-12-15 12:16:36 +00:00
Kumar Sukhani fef606cf0a [UBSan][MIPS] Adding support of MIPS64 in UBSan testing
On mips64 addresses are 40-bit. Where as a 48 bit address is used in TypeCheck/misaligned.cpp.
Using regular expression for that address.

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224242
2014-12-15 10:52:06 +00:00
Kumar Sukhani 79c79e3e8a [UBSan][MIPS] Adding support for MIPS64
No MIPS64 architecture dependant code

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224239
2014-12-15 09:20:06 +00:00
David Blaikie c4fbfee4ff Update test case with more accurate column information now that Clang produces same
llvm-svn: 224222
2014-12-14 18:49:31 +00:00
Justin Bogner efa6197ab7 Use the newer python syntax for exceptions
We've dropped support for python 2.5, so now we can use the forward
compatible "except ... as" syntax.

llvm-svn: 224181
2014-12-13 02:46:56 +00:00