Commit Graph

1927 Commits

Author SHA1 Message Date
Kostya Kortchinsky e3be61c139 [scudo] ARM32 support
Summary:
With the previous modifications, the code works on ARM32. The random shuffle
test is unsupported on 32-bit platforms for the moment and being marked as
such. There is no hardware support for the checksum computation yet, this will
come at a later point.

Reviewers: kcc, alekseyshl

Subscribers: llvm-commits, aemerson, rengolin, mgorny

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

llvm-svn: 290201
2016-12-20 21:17:58 +00:00
Chandler Carruth 6db6efd40c Make this REQUIRES match the other REQUIRES lines that mention requiring
a darwin system.

llvm-svn: 290152
2016-12-20 01:57:31 +00:00
Kuba Mracek 0722cd0815 Fixup for r290119: Only run debug_alloc_stack.cc on Darwin until I figure out how to make it work on Linux.
llvm-svn: 290129
2016-12-19 18:54:34 +00:00
Kuba Mracek 05bf3ec4c4 More fixup for r290119: Make the ifdef work.
llvm-svn: 290126
2016-12-19 18:27:26 +00:00
Kuba Mracek 7384738362 Another fix-up for r290119: Include stdint.h so we have uint64_t on Linux.
llvm-svn: 290124
2016-12-19 18:09:18 +00:00
Kuba Mracek 866310fcbc Fix-up for r290119 - don't check global size, it might not be available when using atos
llvm-svn: 290123
2016-12-19 18:06:49 +00:00
Kuba Mracek 1187cbd20f [tsan] Implement __tsan_get_alloc_stack and __tsan_locate_address to query pointer types and allocation stacks of heap pointers
In ASan, we have __asan_locate_address and __asan_get_alloc_stack, which is used in LLDB/Xcode to show the allocation backtrace for a heap memory object. This patch implements the same for TSan.

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

llvm-svn: 290119
2016-12-19 17:52:20 +00:00
Kuba Mracek 79b4f0ad9c Follow-up for r289831: Lower the unjoined thread count to 100 in the libcxx-future.mm testcase.
Turns out 1000 unjoined threads are a bit too rough in certain environments.

llvm-svn: 289971
2016-12-16 18:44:01 +00:00
Evgeniy Stepanov 40f05dcec9 [msan] Intercept getutent and friends.
Differential Revision: https://reviews.llvm.org/D27791

llvm-svn: 289878
2016-12-15 22:00:14 +00:00
Hans Wennborg 603679849d Revert r289690 "[sanitizer] intercept bstring functions, patch by Kuang-che Wu (https://reviews.llvm.org/D27659)"
It breaks programs on Mac. See comments on the code review for details.

llvm-svn: 289864
2016-12-15 20:11:12 +00:00
Mike Aizatsky 94752697ee [sanitizers] dont dump coverage if not asked to
llvm-svn: 289835
2016-12-15 17:30:58 +00:00
Kuba Mracek 659949cb03 [tsan] Add interceptor for libcxx __shared_count::__release_shared()
We already have an interceptor for __shared_weak_count::__release_shared, this patch handles __shared_count::__release_shared in the same way. This should get rid of TSan false positives when using std::future.

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

llvm-svn: 289831
2016-12-15 16:45:28 +00:00
Kostya Serebryany 6bca8423c9 [sanitizer] intercept bstring functions, patch by Kuang-che Wu (https://reviews.llvm.org/D27659)
llvm-svn: 289690
2016-12-14 19:10:17 +00:00
Dmitry Vyukov 963f5490e2 tsan: allow Java VM iterate over allocated objects
Objects may move during the garbage collection, and JVM needs
to notify ThreadAnalyzer about that. The new function
__tsan_java_find eliminates the need to maintain these
objects both in ThreadAnalyzer and JVM.

Author: Alexander Smundak (asmundak)
Reviewed in https://reviews.llvm.org/D27720

llvm-svn: 289682
2016-12-14 18:20:18 +00:00
Kostya Kortchinsky a37860acee [scudo] Relax the memalign test
Summary:
Now that we are not rounding up the sizes passed to the secondary allocator,
the memalign test could run out of aligned addresses to return for larger
alignments. We now reduce the size of the quarantine for that test, and
allocate less chunks for the larger alignments.

Subscribers: llvm-commits

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

llvm-svn: 289665
2016-12-14 16:38:11 +00:00
Mike Aizatsky f775dbb5f4 [sanitizers] -DAG is order-independent check
llvm-svn: 289606
2016-12-13 22:26:04 +00:00
Ulrich Weigand 50d4ec66d4 [sancov] Disable failing test on SystemZ as well
This doesn't work at all on big-endian systems, even just reading in the
magic bytes in the binary .sancov file header gets byte order wrong.

llvm-svn: 289539
2016-12-13 14:44:25 +00:00
Renato Golin 08c2563cb1 [sancov] Mark as unstable on ARM, not XFAIL, since it does pass on some config
llvm-svn: 289526
2016-12-13 10:22:49 +00:00
Mike Aizatsky f723811972 [sanitizers] dso order is random, test shouldnt depend on it
llvm-svn: 289516
2016-12-13 05:24:57 +00:00
Mike Aizatsky b67efec03b [sanitizers] powerpc4 is also unsupported platform
llvm-svn: 289515
2016-12-13 05:21:19 +00:00
Mike Aizatsky df80572d1f [sanitizers] disabling dso test as well where appropriate
llvm-svn: 289508
2016-12-13 01:11:46 +00:00
Mike Aizatsky e20a4c8859 [sanitizers] trace-pc-guard doesn't work on mac as well
fatal error: error in backend: Global variable '__sancov_gen_' has an
invalid section specifier '__sancov_guards': mach-o section specifier
requires a segment and section separated by a comma.

llvm-svn: 289507
2016-12-13 01:10:21 +00:00
Mike Aizatsky 1e2f30e957 [sanitizers] sancov really works on x86 only
llvm-svn: 289505
2016-12-13 00:34:33 +00:00
Mike Aizatsky aaa637001a [sancov] __sanitizer_dump_coverage api
Subscribers: kubabrecka, mgorny

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

llvm-svn: 289498
2016-12-12 23:45:38 +00:00
Petr Hosek 627f686ffc [XRay][CMake] Check target for XRay Flight Data Recorder
This target doesn't currently do anything, but it is required by
the runtimes build.

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

llvm-svn: 289420
2016-12-12 05:18:36 +00:00
Kuba Mracek b93f78128f [sanitizer] Handle malloc_destroy_zone() on Darwin
We currently have a interceptor for malloc_create_zone, which returns a new zone that redirects all the zone requests to our sanitizer zone. However, calling malloc_destroy_zone on that zone will cause libmalloc to print out some warning messages, because the zone is not registered in the list of zones. This patch handles this and adds a testcase for that.

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

llvm-svn: 289375
2016-12-11 08:42:42 +00:00
Renato Golin 3bdc0f165b [DFSAN] Another unstable test in AArch64 breaking bots unnecessarily
llvm-svn: 289253
2016-12-09 19:02:04 +00:00
Vitaly Buka 6eead19ce4 [asan] Add test which detects bugs undetectable before r288563
Reviewers: kcc, eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 289090
2016-12-08 19:13:13 +00:00
Sagar Thakur 76a878b8f8 [MSAN][MIPS] Fix fork.cc test on MIPS
Summary: For platforms which support slow unwinder only, we restrict the store context size to 1, basically only storing the current pc. We do this because the slow unwinder which is based on libunwind is not async signal safe and causes random freezes in forking applications as well as in signal handlers.

Reviewed by eugenis.
Differential: D23107

llvm-svn: 289027
2016-12-08 06:30:58 +00:00
Serge Rogatch 3c265b55fc [XRay][AArch64] Disable the unstable test XRay-aarch64-linux::patching-unpatching.cc
Summary:
The test `XRay-aarch64-linux::patching-unpatching.cc` sometimes passes, sometimes fails on buildbots.
This patch disables test `patching-unpatching.cc` for AArch64 targets.

Reviewers: rengolin, dberris

Subscribers: llvm-commits, iid_iunknown, aemerson

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

llvm-svn: 288988
2016-12-07 22:00:02 +00:00
Renato Golin cb2443e80c [asan] Disable yet another unstable test under AArch64
llvm-svn: 288953
2016-12-07 18:37:49 +00:00
Evgeniy Stepanov 74cf034805 Replace "|&" with "2>&1 |" to support bash pre-4
Summary: Old bash release (3.2) on SLES11 chokes on new redirection shortcut.

Patch by Brian Cain.

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 288854
2016-12-06 22:02:21 +00:00
Dean Michael Berris 406200eae6 [XRay][compiler-rt] Only add unit tests if we're building XRay.
As constructed before this patch, in case we run into case where we
don't actually build the XRay library, we really ought to not be adding
the unit test runs. This should fix the bootstrap build failures.

This is a follow-up further to D26232.

llvm-svn: 288788
2016-12-06 09:43:44 +00:00
Dean Michael Berris dcd2748a34 [XRay][compiler-rt] CMake fixes for XRay -- take 2.
The bootstrap buildbot complains about not being able to find the
unittests for XRay, when the conditionals to include or not include
tests and unit tests don't match.

This is a follow-up to D26232.

llvm-svn: 288786
2016-12-06 08:40:16 +00:00
Dean Michael Berris d94c0bf4be [XRay][compiler-rt] Fix unit test adding logic.
Before this change we would add the unit tests potentially even if we
don't actually include the unit tests.

This is a follow-up on D26232.

llvm-svn: 288785
2016-12-06 08:22:31 +00:00
Dean Michael Berris abe04e3295 [XRay][compiler-rt] XRay Buffer Queue
This implements a simple buffer queue to manage a pre-allocated queue of
fixed-sized buffers to hold XRay records. We need this to support
Flight Data Recorder (FDR) mode. We also implement this as a sub-library
first to allow for development before actually using it in an
implementation.

Some important properties of the buffer queue:

- Thread-safe enqueueing/dequeueing of fixed-size buffers.
- Pre-allocation of buffers at construction.

This is a re-roll of the previous attempt to submit, because it caused
failures in arm and aarch64.

Reviewers: majnemer, echristo, rSerge

Subscribers: tberghammer, danalbert, srhines, modocache, mehdi_amini, mgorny, llvm-commits

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

llvm-svn: 288775
2016-12-06 06:24:08 +00:00
Mike Aizatsky 48ee418f88 [sanitizers] mac prints null differently
llvm-svn: 288726
2016-12-05 23:06:07 +00:00
Mike Aizatsky 0d98da7c1f [sanitizers] __sanitizer_get_module_and_offset_for_pc interface function
Summary: The function computes full module name and coverts pc into offset.

Reviewers: kcc

Subscribers: kubabrecka

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

llvm-svn: 288711
2016-12-05 21:45:14 +00:00
Filipe Cabecinhas 8c1c8e5d7c Revert "Compiler-rt part of D26230: Add (constant) masked load/store support (Try #2)"
This reverts commit r288504.

clang-bpf-build fails with no details:
******************** TEST 'AddressSanitizer-x86_64-linux ::
TestCases/masked-ops.cpp' FAILED ********************
Script:
--
/mnt/buildbot/slave-root/clang-bpf-build/stage1/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -o /mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp -mavx -O1
not /mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp l1 2>&1 | FileCheck -check-prefix=CHECK-L1 /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
/mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp l6 2>&1 | FileCheck -check-prefix=CHECK-L6 /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
/mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp la 2>&1 | FileCheck -check-prefix=CHECK-LA /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
not /mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp s1 2>&1 | FileCheck -check-prefix=CHECK-S1 /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
/mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp s6 2>&1 | FileCheck -check-prefix=CHECK-S6 /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
/mnt/buildbot/slave-root/clang-bpf-build/stage1/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/masked-ops.cpp.tmp sa 2>&1 | FileCheck -check-prefix=CHECK-SA /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '-' is empty.
FileCheck command line:  FileCheck -check-prefix=CHECK-L6 /mnt/buildbot/slave-root/clang-bpf-build/llvm/projects/compiler-rt/test/asan/TestCases/masked-ops.cpp

--

********************

llvm-svn: 288507
2016-12-02 16:19:14 +00:00
Filipe Cabecinhas 2f461bf24a Compiler-rt part of D26230: Add (constant) masked load/store support (Try #2)
Summary:
Unfortunately, there is no way to emit an llvm masked load/store in
clang without optimizations, and AVX enabled. Unsure how we should go
about making sure this test only runs if it's possible to execute AVX
code.

Reviewers: kcc, RKSimon, pgousseau

Subscribers: kubabrecka, dberris, llvm-commits

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

llvm-svn: 288504
2016-12-02 15:33:04 +00:00
NAKAMURA Takumi 5ce101a848 compiler-rt/test/profile/Linux/lit.local.cfg: [Py3] Use text mode (universal_newlines=True).
llvm-svn: 288490
2016-12-02 08:17:17 +00:00
Kostya Kortchinsky 1148dc5274 [scudo] 32-bit and hardware agnostic support
Summary:
This update introduces i386 support for the Scudo Hardened Allocator, and
offers software alternatives for functions that used to require hardware
specific instruction sets. This should make porting to new architectures
easier.

Among the changes:
- The chunk header has been changed to accomodate the size limitations
  encountered on 32-bit architectures. We now fit everything in 64-bit. This
  was achieved by storing the amount of unused bytes in an allocation rather
  than the size itself, as one can be deduced from the other with the help
  of the GetActuallyAllocatedSize function. As it turns out, this header can
  be used for both 64 and 32 bit, and as such we dropped the requirement for
  the 128-bit compare and exchange instruction support (cmpxchg16b).
- Add 32-bit support for the checksum and the PRNG functions: if the SSE 4.2
  instruction set is supported, use the 32-bit CRC32 instruction, and in the
  XorShift128, use a 32-bit based state instead of 64-bit.
- Add software support for CRC32: if SSE 4.2 is not supported, fallback on a
  software implementation.
- Modify tests that were not 32-bit compliant, and expand them to cover more
  allocation and alignment sizes. The random shuffle test has been deactivated
  for linux-i386 & linux-i686 as the 32-bit sanitizer allocator doesn't
  currently randomize chunks.

Reviewers: alekseyshl, kcc

Subscribers: filcab, llvm-commits, tberghammer, danalbert, srhines, mgorny, modocache

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

llvm-svn: 288255
2016-11-30 17:32:20 +00:00
Xinliang David Li 8b19a0a100 [Profile] Fix value profiler eviction bug
Differential Revision: https://reviews.llvm.org/D27224

llvm-svn: 288204
2016-11-29 22:00:54 +00:00
Kuba Mracek ff1bd20ded [sanitizer] Add macOS minimum deployment target to all compiler invocations in lit tests
The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden).

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

llvm-svn: 288186
2016-11-29 19:25:53 +00:00
Filipe Cabecinhas c707bbf081 Revert "Compiler-rt part of D26230: Add (constant) masked load/store support"
This reverts commit r288162. Buildbot clang-bpf-build fails running tests.

llvm-svn: 288173
2016-11-29 18:08:24 +00:00
Filipe Cabecinhas bca5fd4f81 Compiler-rt part of D26230: Add (constant) masked load/store support
Summary:
Unfortunately, there is no way to emit an llvm masked load/store in
clang without optimizations, and AVX enabled. Unsure how we should go
about making sure this test only runs if it's possible to execute AVX
code.

Reviewers: kcc, RKSimon, pgousseau

Subscribers: kubabrecka, dberris, llvm-commits

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

llvm-svn: 288162
2016-11-29 16:56:59 +00:00
Evgeniy Stepanov d3305afc75 Return memory to OS right after free (not in the async thread).
Summary:
In order to avoid starting a separate thread to return unused memory to
the system (the thread interferes with process startup on Android,
Zygota waits for all threads to exit before fork, but this thread never
exits), try to return it right after free.

Reviewers: eugenis

Subscribers: cryptoad, filcab, danalbert, kubabrecka, llvm-commits

Patch by Aleksey Shlyapnikov.

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

llvm-svn: 288091
2016-11-29 00:22:50 +00:00
Kuba Mracek 809dea2aeb [asan] Attempt to fix the debug_double_free.cc testcase on Windows after r288065.
llvm-svn: 288067
2016-11-28 21:28:41 +00:00
Kuba Mracek 48090f5b82 [asan] Provide bug descriptions for all reports (not just ErrorGeneric)
Differential Revision: https://reviews.llvm.org/D27012

llvm-svn: 288065
2016-11-28 21:18:15 +00:00
Marcin Koscielnicki b3d93889f5 [sanitizers] Get the proper printf/scanf version when long double transition is involved.
See D19555 for rationale.  As it turns out, this treatment is also necessary
for scanf/printf.

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

llvm-svn: 288064
2016-11-28 21:15:19 +00:00