Commit Graph

1963 Commits

Author SHA1 Message Date
Renato Golin 8f03fbe678 Revert "[XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests"
This reverts commit r292211, as it broke the Thumb buldbot with:

clang-5.0: error: the clang compiler does not support '-fxray-instrument
on thumbv7-unknown-linux-gnueabihf'

llvm-svn: 292356
2017-01-18 09:07:35 +00:00
Michal Gorny 7b97bf233f [test] [builtins] Remove obsolete/UB tests in __fixuns?fdi based
Remove the failing tests for __fixunssfdi() and __fixunsdfdi() that
relied on undefined (and most likely obsolete in terms of compiler-rt
implementation behavior).

Both tests presumed that 0x1.p+64 would be converted to
0xFFFFFFFFFFFFFFFFLL, that is the largest value in uint64 range.
However, the C/C++ standards do not specify the behavior for converting
a floating-point value to an integer of smaller range, and in this case
both libgcc and compiler-rt implementations return 0 instead.

Since the current behavior is correct with regards to standards
and there is no good way of expressing 0xFFFFFFFFFFFFFFFFLL in single-
or double-precision float, I've removed the failing test altogether.

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

llvm-svn: 292257
2017-01-17 21:08:25 +00:00
Kuba Mracek 5da6f6db9a Revert r292232.
llvm-svn: 292236
2017-01-17 18:06:07 +00:00
Kuba Mracek a802a50963 [lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.

This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.

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

llvm-svn: 292232
2017-01-17 17:18:18 +00:00
Serge Rogatch 1bcd53f0e7 [XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests
Summary:
Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail.
This patch is one of a series: see also
- https://reviews.llvm.org/D28624

Reviewers: dberris, rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown

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

llvm-svn: 292211
2017-01-17 11:53:38 +00:00
Alex Shlyapnikov c4427a3976 ASAN activate/deactive controls thread_local_quarantine_size_kb option.
Summary:
Bypass quarantine altogether when quarantine size is set ot zero.
Also, relax atomic load/store of quarantine parameters, the
release/acquire semantics is an overkill here.

Reviewers: eugenis

Subscribers: kubabrecka, llvm-commits, mehdi_amini

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

llvm-svn: 291791
2017-01-12 18:51:25 +00:00
Alex Shlyapnikov c83efa85e2 Repoison the entire ASan chunk if it is not in active use.
Summary:
Repoisoning just the minimal redzones might leave an unpoisoned
gap of the size of the actual redzone minus minimal redzone size.
After ASan activation the actual redzone might be bigger than the minimal
size and ASan allocator assumes that the chunk returned by the common
allocator is either entirely poisoned or entirely not poisoned (it's too
expensive to check the entire chunk or always poison one).

Reviewers: eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 291714
2017-01-11 22:10:35 +00:00
Kuba Mracek e7709560ea [tsan] Implement a 'ignore_noninstrumented_modules' flag to better suppress false positive races
On Darwin, we currently use 'ignore_interceptors_accesses', which is a heavy-weight solution that simply turns of race detection in all interceptors. This was done to suppress false positives coming from system libraries (non-instrumented code), but it also silences a lot of real races. This patch implements an alternative approach that should allow us to enable interceptors and report races coming from them, but only if they are called directly from instrumented code.

The patch matches the caller PC in each interceptors. For non-instrumented code, we call ThreadIgnoreBegin.

The assumption here is that the number of instrumented modules is low. Most likely there's only one (the instrumented main executable) and all the other modules are system libraries (non-instrumented).

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

llvm-svn: 291631
2017-01-11 00:54:26 +00:00
Rong Xu af2f1dbde8 [PGO] Update the test cases after r291588.
llvm-svn: 291594
2017-01-10 20:07:01 +00:00
Serge Rogatch 4ab7a30538 [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification
Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime.

Reviewers: dberris, rengolin, pelikan, rovka

Subscribers: rovka, llvm-commits, iid_iunknown, aemerson

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

llvm-svn: 291568
2017-01-10 16:16:33 +00:00
Diana Picus c1e2ab3626 Revert r291509, 291510 and 291511
Revert "ASAN activate/deactive controls thread_local_quarantine_size_kb option."
Revert "Bypass quarantine when quarantine size is set ot zero."
Revert "ASAN activate/deactive controls thread_local_quarantine_size_kb option."

One of these commits broke some of the ARM / AArch64 buildbots:
TEST 'AddressSanitizer-aarch64-linux :: TestCases/Posix/start-deactivated.cc' FAILED

Command Output (stderr):
--
/home/buildslave/buildslave/clang-cmake-aarch64-42vma/llvm/projects/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc:85:12: error: expected string not found in input
 // CHECK: WARNING: AddressSanitizer failed to allocate 0xfff{{.*}} bytes
           ^
<stdin>:1:1: note: scanning from here
start-deactivated.cc.tmp: /home/buildslave/buildslave/clang-cmake-aarch64-42vma/llvm/projects/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc:40: void test_malloc_shadow(char *, size_t, bool): Assertion `(char *)__asan_region_is_poisoned(p - 1, sz + 1) == (expect_redzones ? p - 1 : nullptr)' failed.
^
<stdin>:2:1: note: possible intended match here
Error: Aborted (core dumped)
^

llvm-svn: 291560
2017-01-10 11:14:44 +00:00
Francis Ricci 17781c71b0 Make cmake link flag naming consistent
Summary:
The build system was inconsistent in its naming conventions for
link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS,
for consistency with cmake's LINK_FLAGS property.

This patch should make it easier to search the source code for
uses of link flags, as well as providing the benefit of improved
style and consistency.

Reviewers: compnerd, beanz

Subscribers: kubabrecka, llvm-commits, mgorny

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

llvm-svn: 291539
2017-01-10 04:33:04 +00:00
Alex Shlyapnikov 0e93c3932a ASAN activate/deactive controls thread_local_quarantine_size_kb option.
Summary: Also, bypass quarantine altogether when quarantine size is set ot zero.

Reviewers: eugenis

Subscribers: kubabrecka, llvm-commits, mehdi_amini

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

llvm-svn: 291511
2017-01-09 23:49:17 +00:00
Kuba Mracek 3f499b6825 Follow-up for r291277: Redirect otool output to stderr.
Tests need to output everything into a single stream, or FileCheck is sometimes confused (buffering can cause stdout/stderr to be interleaved randomly).

llvm-svn: 291339
2017-01-07 07:41:47 +00:00
Kuba Mracek b81857a9e0 Follow-up for r291277: Increase buffer size in uuid.cc testcase.
2048 should be enough for everyone.

llvm-svn: 291305
2017-01-06 23:39:29 +00:00
Kuba Mracek b38f1ca2d5 [sanitizer] Use architecture/slice information when symbolizing fat Mach-O files on Darwin
This patch starts passing architecture information about a module to llvm-symbolizer and into text reports. This fixes the longstanding x86_64/x86_64h mismatch issue on Darwin.

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

llvm-svn: 291287
2017-01-06 21:45:05 +00:00
Kuba Mracek b6c6eaf226 [sanitizer] Add a 'print_module_map' flag which prints modules with UUIDs on Darwin
This patch add a new sanitizer flag, print_module_map, which enables printing a module map when the process exits, or after each report (for TSan). The output format is very similar to what Crash Reporter produces on Darwin (e.g. the format of module UUIDs). This enables users to use the existing symbol servers to offline symbolicate and aggregate reports.

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

llvm-svn: 291277
2017-01-06 20:57:47 +00:00
Mike Aizatsky fb96e04efb [sancov] introducing SANCOV_OPTIONS
Reintroducing https://reviews.llvm.org/rL291068
Define options function everywhere but linux.

llvm-svn: 291267
2017-01-06 19:22:50 +00:00
Michal Gorny 42af8da4c8 [builtins] Implement __floattitf() & __floatuntitf()
Implement the missing __floattitf() and __floatuntitf() functions, to
convert 128-bit (unsigned) integers to quad-precision floating-point
types. This is needed e.g. on AArch64 where 'long double' is
a quad-precision type.

The code is based on the existing code for __floattixf()
and __floatuntixf(), updated to account for different bit field lengths
of quad-precision float. The tests are also copied, with the rounding
tests adjusted for longer significand.

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

llvm-svn: 291259
2017-01-06 18:46:35 +00:00
Mike Aizatsky dc58a7d618 Revert "[sancov] introducing SANCOV_OPTIONS"
and related changes

https://llvm.org/svn/llvm-project/compiler-rt/trunk@291068

llvm-svn: 291141
2017-01-05 16:55:56 +00:00
Mike Aizatsky 2ced0edd1c [sancov] enabling tests on ppc and s390
The reason they should have failed: absent sancov.
In this test (vs the trace_pc_guard test) sancov is not
yet called (not implemented).

llvm-svn: 291080
2017-01-05 04:46:19 +00:00
Mike Aizatsky 4ae2e0c386 [sancov] introducing SANCOV_OPTIONS
Summary:
At this point SANCOV_OPTIONS are not functional but it is our intent
to move here sanitizer coverage flags from various sanitizers _OPTIONS.

Reviewers: kcc

Subscribers: kubabrecka, mgorny

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

llvm-svn: 291068
2017-01-05 03:14:35 +00:00
Dean Michael Berris 7c030a2d91 [XRay] [compiler-rt] Include argv[0] in the log file name.
Summary:
If you decide to recompile parts of your Linux distro with XRay, it may
be useful to know which trace belongs to which binary.  While there, get
rid of the incorrect strncat() usage; it always returns a pointer to the
start which makes that if() always true.  Replace with snprintf which is
bounded so that enough from both strings fits nicely.

Reviewers: dberris

Subscribers: danalbert, srhines, kubabrecka, mgorny, llvm-commits

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

llvm-svn: 290861
2017-01-03 04:35:24 +00:00
Dean Michael Berris 0aba35710f Revert "[XRay][compiler-rt] XRay Flight Data Recorder Mode"
This reverts rL290852 as it breaks aarch64 and arm.

llvm-svn: 290854
2017-01-03 04:04:00 +00:00
Dean Michael Berris 33d305b54b [XRay][compiler-rt] XRay Flight Data Recorder Mode
Summary:
In this change we introduce the notion of a "flight data recorder" mode
for XRay logging, where XRay logs in-memory first, and write out data
on-demand as required (as opposed to the naive implementation that keeps
logging while tracing is "on"). This depends on D26232 where we
implement the core data structure for holding the buffers that threads
will be using to write out records of operation.

This implementation only currently works on x86_64 and depends heavily
on the TSC math to write out smaller records to the inmemory buffers.

Also, this implementation defines two different kinds of records with
different sizes (compared to the current naive implementation): a
MetadataRecord (16 bytes) and a FunctionRecord (8 bytes). MetadataRecord
entries are meant to write out information like the thread ID for which
the metadata record is defined for, whether the execution of a thread
moved to a different CPU, etc. while a FunctionRecord represents the
different kinds of function call entry/exit records we might encounter
in the course of a thread's execution along with a delta from the last
time the logging handler was called.

While this implementation is not exactly what is described in the
original XRay whitepaper, this one gives us an initial implementation
that we can iterate and build upon.

Reviewers: echristo, rSerge, majnemer

Subscribers: mehdi_amini, llvm-commits, mgorny

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

llvm-svn: 290852
2017-01-03 03:38:17 +00:00
Evgeniy Stepanov 8988ebb435 Fix unit test broken by D27873.
Summary:
Reduce RSS size treshold in the unit test to accomodate for the smaller
ASAN quarantine size on Android (see D27873).

Reviewers: eugenis

Patch by Alex Shlyapnikov.

Subscribers: danalbert, kubabrecka, llvm-commits

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

llvm-svn: 290643
2016-12-28 01:41:24 +00:00
Evgeniy Stepanov ddf0c26b6a [asan] Mark printf-m test as unsupported on windows.
llvm-svn: 290635
2016-12-27 22:22:32 +00:00
Evgeniy Stepanov f787cf7ee6 [asan] Fix handling of %m in printf interceptor.
llvm-svn: 290632
2016-12-27 22:14:03 +00:00
Saleem Abdulrasool c1861d86e1 test: filter out -fPIE/-pie on Windows
Use some new substitutions to avoid duplicating the tests for just
dropped flags.  -fPIC/-fPIE/-fpic/-fpie do not make sense on Windows as
they can cause ELF-style PIC.  Substitute away the flag on Windows.
This should repair the windows buildbots.

llvm-svn: 290571
2016-12-27 03:16:20 +00:00
Renato Golin ece8de7c23 Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification"
This reverts commit r290452, not quite there yet. We need to test this
offline.

llvm-svn: 290453
2016-12-23 21:58:39 +00:00
Serge Rogatch 4ee228bf73 [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification
Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime.

Reviewers: dberris, rengolin

Subscribers: llvm-commits, iid_iunknown, aemerson

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

llvm-svn: 290452
2016-12-23 21:21:01 +00:00
Kostya Kortchinsky 524c035a4a [scudo] Use the macro get_test_cc_for_arch for the tests
Summary: The macro was introduced with D26929, use it in Scudo as well.

Reviewers: kcc, alekseyshl, kubabrecka

Subscribers: llvm-commits, danalbert, srhines, mgorny

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

llvm-svn: 290439
2016-12-23 18:40:47 +00:00
Michal Gorny f344a51369 [tests] Add missing "int_lib.h" includes and extend guards
Fix missing "int_lib.h" includes in ARM negdf2vfp and subdf3vfp tests.
Additionally, extend the __arm__ guard to cover the builtin definition
in the former. This is mostly intended to prevent build failures
and allow those tests to be properly skipped on other targets.

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

llvm-svn: 290422
2016-12-23 11:18:24 +00:00
Evgeniy Stepanov 37db58e9eb Expose thread local quarantine size as ASAN option.
Summary: Make thread local quarantine size an option so it can be turned off to save memory.

Reviewers: eugenis

Patch by Alex Shlyapnikov.

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 290373
2016-12-22 21:43:22 +00:00
Renato Golin fe8bbb2333 Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification"
This reverts commit r290354, as it broke the build. We need to make sure
this builds on AArch64 before committing again.

llvm-svn: 290362
2016-12-22 19:38:04 +00:00
Serge Rogatch 93fb15788a [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification
Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime.

Reviewers: dberris, rengolin

Subscribers: llvm-commits, iid_iunknown, aemerson

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

llvm-svn: 290354
2016-12-22 18:48:36 +00:00
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