Commit Graph

7536 Commits

Author SHA1 Message Date
Akira Hatanaka 1164cae527 [asan] Mark asan-symbolize-sanity-test.cc as UNSUPPORTED on x86_64-apple
and x86_64h-apple.

Mark the test as UNSUPPORTED to fix a bot that is failing.

http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check

The bot is failing because asan_symbolize.py cannot tell whether the
reported address is from an x86_64 slice or an x86_64h slice by the
length of the address alone, so it ends up passing the wrong arch to
atos.

rdar://problem/27907889

llvm-svn: 279614
2016-08-24 06:49:28 +00:00
Kostya Serebryany 865a98d2ed [sanitizer] trying to fix the PPC bots
llvm-svn: 279595
2016-08-24 00:10:25 +00:00
Kostya Serebryany f46d50e360 [sanitizer] change the 64-bit allocator to use a single array for free-d chunks instead of a lock-free linked list of tranfer batches. This change simplifies the code, makes the allocator more 'hardened', and will allow simpler code to release RAM to OS. This may also slowdown malloc stress tests due to lock contension, but I did not observe noticeable slowdown on various real multi-threaded benchmarks.
llvm-svn: 279572
2016-08-23 21:19:47 +00:00
Kostya Serebryany 0549a39a17 [sanitizer] adding a threaded performance stress test for malloc (useful for manual analysis of malloc performance)
llvm-svn: 279570
2016-08-23 21:12:04 +00:00
Kostya Serebryany 6e3cda4dfc [asan] minor fix in the asan memory profile
llvm-svn: 279547
2016-08-23 18:13:51 +00:00
Chris Bieneman d470f434ab Delete remaining compiler-rt makefiles
Summary:
Since we can now build the builtins without a full toolchain these files should no longer be needed.

This is the last vestige of autoconf!

Reviewers: compnerd, iains, jroelofs

Subscribers: dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D23777

llvm-svn: 279539
2016-08-23 17:32:38 +00:00
Sagar Thakur 49280f6c59 [TSan][MIPS] Changes mips memory layout to support pie with address space randomization.
Reviewed by dvyukov
Differential: D23644

llvm-svn: 279505
2016-08-23 08:15:25 +00:00
Vitaly Buka 72ca69e403 [asan] Fix OOB_char on arm 32bit
Summary:
This does not actually fixes the test.
AddressSanitizer::OOB_char behavior is inconsistent but it somehow usually
works. On arm it runs more iterations than expected. And adding a new test with AddressSanitizerInterface prefix, even empty, somehow breaks OOB_char test.
So I will rename my test to make the bot green and will continue to investigate the test.

Reviewers: krasin

Subscribers: aemerson, rengolin, kubabrecka, llvm-commits, samparker

Differential Revision: https://reviews.llvm.org/D23790

llvm-svn: 279501
2016-08-23 02:58:12 +00:00
Francis Ricci f9153eb305 [builtins] Don't always use -ffreestanding when compiling builtins
This can break on some sysroots. Let the user define it if necessary.

llvm-svn: 279496
2016-08-23 00:49:03 +00:00
Kostya Serebryany ce2163459f [sanitizer] allocator: split the local cache class into two, one for 32-bit allocator and one for 64-bit one. NFC. The two imlementations will diverge in the following changes.
llvm-svn: 279495
2016-08-23 00:30:43 +00:00
Francis Ricci 0f488dc215 [compiler-rt] Use flags found when configuring builtins during compilation
Summary: This fixes the omission of -fPIC when building the builtins.

Reviewers: compnerd, beanz

Subscribers: dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D23729

llvm-svn: 279469
2016-08-22 20:33:47 +00:00
Francis Ricci 2582a11c4d [compiler-rt] Don't build ubsan cxxabi sources when unused
Summary:
On apple targets, when SANITIZER_CAN_USE_CXXABI is false,
the ubsan cxxabi sources aren't built, since they're unused.
Do this on non-apple targets as well.

This fixes errors when linking sanitizers if c++ abi is
unavailable.

Reviewers: pcc, kubabrecka, beanz

Subscribers: rnk, llvm-commits, kubabrecka, compnerd, dberris

Differential Revision: https://reviews.llvm.org/D23638

llvm-svn: 279467
2016-08-22 20:27:21 +00:00
Francis Ricci 9cf5e4fc00 [compiler-rt] Make cxxabi availability configurable in cmake
Summary:
Allow for use of cxxabi to be disabled from cmake.

This will make sanitizers usable when c++ abi is unavailable.

Reviewers: pcc, rnk, samsonov, beanz, compnerd

Subscribers: llvm-commits, compnerd, dberris

Differential Revision: https://reviews.llvm.org/D23639

llvm-svn: 279451
2016-08-22 18:31:37 +00:00
Filipe Cabecinhas e5914d82d2 [cmake] Fix append_rtti_flag macro and bad var name
llvm-svn: 279450
2016-08-22 18:30:37 +00:00
Vitaly Buka 8176ee9b5d [asan] Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas
Summary: Depends on D23707.

Subscribers: kubabrecka

Differential Revision: https://reviews.llvm.org/D23709

llvm-svn: 279377
2016-08-20 17:22:36 +00:00
Evgeniy Stepanov c49b00a249 [msan] Disable prlimit test on glibc < 2.13.
llvm-svn: 279352
2016-08-20 00:38:55 +00:00
Chris Bieneman 9b818ac5d9 [CMake] Support building on OS X without Xcode installation
This should resolve PR23162. This patch has two parts.

First we need to check the error code from xcodebuild when querying for SDKs, second if the OS X SDK is not discovered, we ensure that /usr/include exists and use / as the OS X sysroot.

llvm-svn: 279336
2016-08-19 22:22:35 +00:00
Chris Bieneman 5968c3ac1f [CMake] Add check-compiler-rt target for runtimes build
Durning standalone builds (which includes runtimes builds) we want to create a target named check-compiler-rt. Additionally we also create check-all if it doesn't already exist as a convienence target that depends on check-compiler-rt.

This allows us to generate a single check target that invokes lit for all test suites in the runtimes projects, while avoiding name collision of check-all and not breaking existing workflows.

llvm-svn: 279334
2016-08-19 22:17:48 +00:00
Chris Bieneman 83877ee6cc [CMake] Add top-level install-compiler-rt target
This is a wrapper target of all the component install targets. This wrapper target will be used by the new LLVM runtimes directory to connect top-level targets to the runtime project target.

llvm-svn: 279333
2016-08-19 22:17:46 +00:00
Vitaly Buka 8075b82322 [asan] Temporarily mark test as broken on Windows
llvm-svn: 279318
2016-08-19 20:48:09 +00:00
Saleem Abdulrasool b6ced621e8 build: allow building a specific set of sanitizers
Introduce a new CMake option `COMPILER_RT_SANITIZERS_TO_BUILD` which takes
either a special token `all` (default) which will preserve the current behaviour
or a CMake list of sanitizers to build.  It will still perform the normal checks
if the sanitizer is requested.  It only permits a further means to exclude a
particular sanitizer.  This gives finer grained control than
`COMPILER_RT_BUILD_SANITIZERS` which only gives an all or nothing control.

llvm-svn: 279253
2016-08-19 15:13:21 +00:00
Filipe Cabecinhas 53a45fa4e3 Cleanup: Move the *AddressDescription printing code to Print() members inside those structs.
Summary:
The Print() members might take optional access_size and bug_type
parameters to still be able to provide the same information

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23658

llvm-svn: 279237
2016-08-19 13:07:23 +00:00
Jonas Hahnfeld 2f230be0e2 Revert "[CMake] Fix ASM building in llvm/runtimes"
This reverts the TSAN parts of commit r279215.

llvm-svn: 279218
2016-08-19 08:03:26 +00:00
Jonas Hahnfeld ddbab7d982 [CMake] Fix ASM building in llvm/runtimes
When compiler-rt's CMake is not directly invoked, it will currently not call
project() and thus ASM will not be enabled.
We also don't need to put the .S files through the C compiler then.

Differential Revision: https://reviews.llvm.org/D23656

llvm-svn: 279215
2016-08-19 06:46:00 +00:00
Vitaly Buka 3efaaeb79d [asan] Add one more test for __asan_set_shadow_*
Reviewers: eugenis, filcab

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23676

llvm-svn: 279108
2016-08-18 18:15:15 +00:00
Chris Bieneman a8105c607b [CMake] Stop building eprintf library on Darwin
In r278988 clang stopped using the eprintf library, so we should stop generating it too.

llvm-svn: 279090
2016-08-18 17:10:55 +00:00
Oleg Ranevskyy 8a8b7b6df7 [compiler-rt][tests] cpu_model_test.c test fails to compile if X86 is not clang's default target
Summary:
test/builtins/Unit/cpu_model_test.c tests the X86 specific builtin `__builtin_cpu_supports`.
It fails if the clang's default target is not X86.

The proposed patch adds an additional requirement for the X86 target to the test, making lit ignore the test if the target is different.

Reviewers: asbirlea

Subscribers: dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D23633

llvm-svn: 279071
2016-08-18 14:39:39 +00:00
Filipe Cabecinhas 391438a08d Add header guards to asan_descriptions.h
llvm-svn: 279062
2016-08-18 13:22:00 +00:00
Daniel Sanders 93c0f382b4 [mips][msan] Fix all the XPASSes following r278793 and r278795
All msan tests are now passing for mipsel and mips64el except for
allocator_mapping.cc which is marked unsupported.

llvm-svn: 279048
2016-08-18 10:50:46 +00:00
Filipe Cabecinhas e86f80c45e Convert AsanLocateAddress to Get*AddressInformation functions.
llvm-svn: 279046
2016-08-18 10:31:19 +00:00
Kostya Serebryany 68f8cbd597 [asan] trying to fix the windows bot
llvm-svn: 279030
2016-08-18 02:04:03 +00:00
Kostya Serebryany 385b973ad3 [sanitizer-coverage] add __sanitizer_cov_trace_cmp[1248] to the sanitizer-coverage interface
llvm-svn: 279026
2016-08-18 01:23:27 +00:00
Vitaly Buka 1396b9f072 [asan] Add __asan_set_shadow_*
Summary:
We are poisoning small allocas using store instruction from instrumented code.
For larger allocas we'd like to insert function calls instead of multiple stores.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23616

llvm-svn: 279019
2016-08-18 00:56:11 +00:00
Vitaly Buka 334ac36e66 [asan] Remove "Stack partial redzone" from report
Summary: This value is never used.

Reviewers: kcc, eugenis

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23631

llvm-svn: 279010
2016-08-17 23:38:08 +00:00
Filipe Cabecinhas 41f41635f9 Split DescribeAddressIfGlobal between a function that gets all the information, and one that prints it.
Summary:
Replacement for part of D23518
This deals with global variable addresses.

(This commit is written on top of D23605, but can be applied by itself)

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23607

llvm-svn: 278959
2016-08-17 19:52:12 +00:00
Filipe Cabecinhas 2e767d1972 Split DescribeAddressIfStack between a function that gets all the information, and one that prints it.
Summary:
Replacement for part of D23518
This deals with stack addresses.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23605

llvm-svn: 278958
2016-08-17 19:52:06 +00:00
Filipe Cabecinhas 6b3f82dce2 Deal with buildbot fallout from r278917: s/AllocType()/GetAllocType()/ (had the same name as the enum)
llvm-svn: 278919
2016-08-17 09:24:33 +00:00
Filipe Cabecinhas e068de5137 Rename DescribeHeapAddress to DescribeAddressIfHeap and split it into a function to get all the information about the address, and one to print it.
Summary:
Replacement for part of D23518
This deals with heap addresses, and renames DescribeHeapAddress.
Requires D23520, which moves code around to make it accessible in asan_describers.cc (and still accessible in asan_report.cc if needed).

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23569

llvm-svn: 278917
2016-08-17 09:16:08 +00:00
Francis Ricci 39bc97a1ec Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit dbb6e905684e2e9488887b26c02ee8881849f09f.

llvm-svn: 278852
2016-08-16 20:52:22 +00:00
Francis Ricci 6802eb0868 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

Differential Revision: https://reviews.llvm.org/D23376

llvm-svn: 278848
2016-08-16 20:39:10 +00:00
Matthias Braun 0761b5253d sanitizer_common: Fix warning
Clang added warning that taking the address of a packed struct member
possibly yields an unaligned pointer. This case is benign because
the pointer gets casted to an uptr and not used for unaligned accesses.
Add an intermediate cast to char* until this warning is improved (see
also https://reviews.llvm.org/D20561)

llvm-svn: 278835
2016-08-16 18:28:55 +00:00
Filipe Cabecinhas a8c730c047 Move the Decorator, ThreadNameWithParenthesis, and DescribeThread to asan_descriptions.{h,cc}
Summary:
Replacement for part of D23518
Code refactoring to allow us to move some more DescribeAddressIf* functions to work by getting the structured information, and then printing it.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23520

llvm-svn: 278820
2016-08-16 16:38:46 +00:00
Francis Ricci 3d6aa8a475 Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit cd5fa595648378f38cdad8b07e18433639c28a9c.

llvm-svn: 278800
2016-08-16 13:58:56 +00:00
Sagar Thakur 49307c0297 [MSAN][MIPS] Changed memory mapping to support pie executable.
Reviewed by eugenis
Differential: D22993

llvm-svn: 278793
2016-08-16 12:49:54 +00:00
Sagar Thakur 19b84a0224 [TSan][MIPS] Implements setjmp assembly for MIPS64
Reviewed by dvyukov
Differential: https://reviews.llvm.org/D23494

llvm-svn: 278775
2016-08-16 05:06:56 +00:00
Francis Ricci fda072de97 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

    Reviewers: samsonov, beanz, pcc, rnk

    Subscribers: llvm-commits, kubabrecka, compnerd, dberris

    Differential Revision: https://reviews.llvm.org/D23376

llvm-svn: 278772
2016-08-16 02:15:51 +00:00
Francis Ricci 1185b4ae8d Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit 9528d86531b1289600e18c407b8e992d7fedb94f.

llvm-svn: 278769
2016-08-16 01:11:07 +00:00
Francis Ricci 13a5a9d7f1 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

Differential Revision: https://reviews.llvm.org/D23376

llvm-svn: 278764
2016-08-16 00:16:47 +00:00
Chris Bieneman 86412e56fb [CMake] Renaming test variable to be consistent
Based on post-commit review by compnerd.

llvm-svn: 278728
2016-08-15 20:12:43 +00:00
Filipe Cabecinhas f8a15c3b57 Split DescribeAddressIfShadow between a function that gets all the information, and one that prints it.
Summary:
Replacement for part of D23518
This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information.
It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23519

llvm-svn: 278718
2016-08-15 19:30:21 +00:00