summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][compiler-rt] Fixup: require x86_64 for profiling mode testsDean Michael Berris2018-07-122-2/+4
| | | | | | | This constrains the build environments we are testing/supporting for the runtime tests until we can be sure xray works in more platforms. llvm-svn: 336878
* [FileCheck] Add -allow-deprecated-dag-overlap to another compiler-rt testJoel E. Denny2018-07-111-1/+1
| | | | | | See https://reviews.llvm.org/D47106 for details. llvm-svn: 336859
* [FileCheck] Add -allow-deprecated-dag-overlap to failing compiler-rt testsJoel E. Denny2018-07-111-2/+2
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47326 llvm-svn: 336845
* Remove ppc64 BE XFAILs now that gcov profiling works, after starting a cleanZaara Syeda2018-07-113-8/+2
| | | | | | build this time. llvm-svn: 336839
* Link to the correct bug number about the Mac failure for ↵Marco Castelluccio2018-07-111-1/+1
| | | | | | instrprof-shared-gcov-flush.test. llvm-svn: 336820
* Revert 336811, there are still some problems with the tests.Zaara Syeda2018-07-113-2/+8
| | | | llvm-svn: 336819
* Remove ppc64 BE XFAILs now that gcov profiling works.Zaara Syeda2018-07-113-8/+2
| | | | llvm-svn: 336811
* Fix reading 32 bit gcov tag values on little-endian machinesMarco Castelluccio2018-07-111-1/+1
| | | | | | | | | | | | | | | | | Summary: The write buffer contains signed chars, which means the shift operations caused values such as the arc tag value (0x01a10000) to be read incorrectly (0xffa10000). This fixes a regression from https://reviews.llvm.org/D49132. Reviewers: uweigand, davidxl Reviewed By: uweigand Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49161 llvm-svn: 336775
* [XRay] basic mode PID and TID always fetchDean Michael Berris2018-07-113-9/+112
| | | | | | | | | | | | | | Summary: XRayRecords now includes a PID field. Basic handlers fetch pid and tid each time they are called instead of caching the value. Added a testcase that calls fork and checks if the child TID is different from the parent TID to verify that the processes' TID are different in the trace. Reviewers: dberris, Maknee Reviewed By: dberris, Maknee Subscribers: kpw, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49025 llvm-svn: 336769
* Add libcxxabi option back for sanitizer use.Stephen Hines2018-07-111-0/+2
| | | | | | | | | | | | | | | | | | Summary: A prior refactoring accidentally dropped the case for using libc++abi as the out-of-tree C++ runtime library for sanitizers. This patch restores that functionality, which is used by Android, which can't depend on the full libc++ for these libraries. Reviewers: phosek, EricWF Reviewed By: phosek Subscribers: meikeb, kongyi, chh, mgorny, delcypher, llvm-commits, #sanitizers, pirama Differential Revision: https://reviews.llvm.org/D49157 llvm-svn: 336749
* [libFuzzer] Disable dataflow.test on AArch64.Matt Morehouse2018-07-101-0/+1
| | | | | | | | | | | | | | | | | | | Summary: After my recent change to allow MSan + libFuzzer, the ExplodeDFSanLabelsTest.cpp test started to overflow the stack with recursive function SetBytesForLabel() on an AArch64 bot. Perhaps that bot has a smaller stack size, or maybe AArch64 has larger stack frames for this particular function. Reviewers: kcc, javed.absar Reviewed By: kcc Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D49150 llvm-svn: 336725
* Revert "[Fuzzer] Afl driver changing iterations handling"Matt Morehouse2018-07-102-28/+7
| | | | | | | | | | | This reverts rL334510 due to breakage of afl_driver's command line interface. Patch By: Jonathan Metzman Differential Revision: https://reviews.llvm.org/D49141 llvm-svn: 336719
* Limit ASan non-executable-pc test case to x86 botsVlad Tsyrklevich2018-07-101-10/+4
| | | | | | | | The test case fails on the big-endian PPC bot, probably because PowerPC uses function descriptors. More over other architectures don't support NX mappings. (This test case was not being exercised prior to r336633.) llvm-svn: 336714
* [gcov] Fix fallout from r336693Ulrich Weigand2018-07-101-1/+2
| | | | | | | Fix building GCDAProfiling.c with pre-C99 compilers. This caused a build bot failure. llvm-svn: 336706
* [asan] Disable non-execute test on s390Ulrich Weigand2018-07-101-0/+3
| | | | | | | | Processors before z14 don't support non-execute protection, so they will start execution random memory contents, causing the test to randomly fail or succeed. llvm-svn: 336705
* Try to fix broken build due to r336663.Dan Liew2018-07-101-9/+9
| | | | | | | | | | It turns out that the `${XRAY_HEADERS}` CMake variable was already in use and was used for public headers. It seems that `lib/xray/tests/CMakeLists.txt` was depending on this. To fix rename the new `${XRAY_HEADERS}` to `${XRAY_IMPL_HEADERS}`. llvm-svn: 336699
* Remove s390x XFAILs now that gcov profiling works.Ulrich Weigand2018-07-103-6/+6
| | | | llvm-svn: 336695
* [gcov] Fix gcov profiling on big-endian machinesUlrich Weigand2018-07-101-8/+21
| | | | | | | | | | | | | | | | | | | | | | | Two fixes required to handle big-endian systems: - 64-bit counter values are stored in a mixed-endian format in the gcov files: a 32-bit low-part followed by a 32-bit high part. Note that this is already implemented correctly on the LLVM side, see GCOVBuffer::readInt64. - The tag values (e.g. arcs tag, object summary tag, ...) are aways written as the same sequence of bytes independent of byte order. But when *reading* them back in, the code reads them as 32-bit values in host byte order. For the comparisons to work correctly, this should instead always read them as little-endian values. Fixes PR 38121. Reviewed By: marco-c Differential Revision: https://reviews.llvm.org/D49132 llvm-svn: 336693
* Reapply "Make __gcov_flush flush counters for all shared libraries"Marco Castelluccio2018-07-1020-85/+687
| | | | | | | This reapplies r336365, after marking tests as failing on various configurations. llvm-svn: 336678
* [scudo] Use mkdir -p when creating directories for a testFilipe Cabecinhas2018-07-101-1/+1
| | | | llvm-svn: 336673
* [LibFuzzer] Disable MSan test on Darwin which was added by r336619. The ↵Dan Liew2018-07-102-0/+9
| | | | | | | | | MemorySanitizer is not supported on Darwin currently and so Clang refuses to compile with `-fsanitize=memory`. llvm-svn: 336669
* [CMake] Add compiler-rt header files to the list of sources for targetsDan Liew2018-07-1017-29/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when building with an IDE so that header files show up in the UI. This massively improves the development workflow in IDEs. To implement this a new function `compiler_rt_process_sources(...)` has been added that adds header files to the list of sources when the generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no changes are made to the list of source files. The function can be passed a list of headers via the `ADDITIONAL_HEADERS` argument. For each runtime library a list of explicit header files has been added and passed via `ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of headers was already present but it was stale and has been updated to reflect the current state of the source tree. The original version of this patch used file globbing (`*.{h,inc,def}`) to find the headers but the approach was changed due to this being a CMake anti-pattern (if the list of headers changes CMake won't automatically re-generate if globbing is used). The LLVM repo contains a similar function named `llvm_process_sources()` but we don't use it here for several reasons: * It depends on the `LLVM_ENABLE_OPTION` cache variable which is not set in standalone compiler-rt builds. * We would have to `include(LLVMProcessSources)` which I'd like to avoid because it would include a bunch of stuff we don't need. Differential Revision: https://reviews.llvm.org/D48422 llvm-svn: 336663
* [compiler-rt] Get rid of "%T" expansionsFilipe Cabecinhas2018-07-1025-105/+133
| | | | | | | | | | | | | | | | | | | Summary: Original patch by Kuba Mracek The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in compiler-rt. Differential Revision: https://reviews.llvm.org/D48618 llvm-svn: 336661
* [XRay][compiler-rt] Fixup build breakageDean Michael Berris2018-07-102-3/+1
| | | | | | | | | | | | | | Changes: - Remove static assertion on size of a structure, fails on systems where pointers aren't 8 bytes. - Use size_t instead of deducing type of arguments to `nearest_boundary`. Follow-up to D48653. llvm-svn: 336648
* [XRay][compiler-rt] xray::Array Freelist and Iterator UpdatesDean Michael Berris2018-07-109-150/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We found a bug while working on a benchmark for the profiling mode which manifests as a segmentation fault in the profiling handler's implementation. This change adds unit tests which replicate the issues in isolation. We've tracked this down as a bug in the implementation of the Freelist in the `xray::Array` type. This happens when we trim the array by a number of elements, where we've been incorrectly assigning pointers for the links in the freelist of chunk nodes. We've taken the chance to add more debug-only assertions to the code path and allow us to verify these assumptions in debug builds. In the process, we also took the opportunity to use iterators to implement both `front()` and `back()` which exposes a bug in the iterator decrement operation. In particular, when we decrement past a chunk size boundary, we end up moving too far back and reaching the `SentinelChunk` prematurely. This change unblocks us to allow for contributing the non-crashing version of the benchmarks in the test-suite as well. Reviewers: kpw Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D48653 llvm-svn: 336644
* Add lowercase OS name featureVlad Tsyrklevich2018-07-101-1/+3
| | | | | | | | | | | | | | | | Summary: Some tests already make use of OS feature names, e.g. 'linux' and 'freebsd', but they are not actually currently set by lit. Reviewers: pcc, eugenis Reviewed By: eugenis Subscribers: emaste, krytarowski, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49115 llvm-svn: 336633
* [libFuzzer] Make -fsanitize=memory,fuzzer work.Matt Morehouse2018-07-098-12/+116
| | | | | | | | | | | This patch allows libFuzzer to fuzz applications instrumented with MSan without recompiling libFuzzer with MSan instrumentation. Fixes https://github.com/google/sanitizers/issues/958. Differential Revision: https://reviews.llvm.org/D48891 llvm-svn: 336619
* Revert "[libFuzzer] Mutation tracking and logging implemented"Matt Morehouse2018-07-097-66/+22
| | | | | | This reverts r336597 due to bot breakage. llvm-svn: 336616
* [libFuzzer] Mutation tracking and logging implementedMatt Morehouse2018-07-097-22/+66
| | | | | | | | | | | | Code now exists to track number of mutations that are used in fuzzing in total and ones that produce new coverage. The stats are currently being dumped to the command line. Patch By: Kode Williams Differntial Revision: https://reviews.llvm.org/D48054 llvm-svn: 336597
* [ASan] Minor ASan error reporting cleanupAlex Shlyapnikov2018-07-093-100/+84
| | | | | | | | | | | | | | Summary: - use proper Error() decorator for error messages - refactor ASan thread id and name reporting Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49044 llvm-svn: 336573
* Revert "Make __gcov_flush flush counters for all shared libraries"Michael Zolotukhin2018-07-0720-678/+85
| | | | | | | This reverts r336365: the added tests are failing on various configurations (e.g. on green-dragon). llvm-svn: 336474
* libFuzzer: always print line-break for NEW_FUNC/PC outputKostya Serebryany2018-07-061-3/+6
| | | | | | | | | | | | | | Summary: This is a minor cosmetic change. When function/path exceed ~1000 characters, the output is truncated before the line-break. I noticed this for NEW_FUNC. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48799 llvm-svn: 336461
* Recommit "[CMake] Run libFuzzer tests with check-all."Yvan Roux2018-07-061-2/+0
| | | | | | Since problematic tests on AArch64 were disabled at r336446. llvm-svn: 336449
* [MSan] Add functions to enable/disable interceptor checks.Matt Morehouse2018-07-064-0/+69
| | | | | | | | | | | | | | | | | | Summary: The motivation for this change is to make libFuzzer+MSan possible without instrumenting libFuzzer. See https://github.com/google/sanitizers/issues/958. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48890 llvm-svn: 336447
* [libFuzzer] Disable hanging tests on AArch64Yvan Roux2018-07-063-0/+3
| | | | | | | | | Disable problematic tests which broke AArch64 bots. Details available in Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=38034 Differential Revision: https://reviews.llvm.org/D49011 llvm-svn: 336446
* [scudo] Add some logs for AndroidKostya Kortchinsky2018-07-061-0/+3
| | | | | | | | | | | | | | | | Summary: Namely, set the abort message, and allow to write the message to syslog if the option is enabled. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48902 llvm-svn: 336445
* Make __gcov_flush flush counters for all shared librariesMarco Castelluccio2018-07-0520-85/+678
| | | | | | | | | | | | | | | | | Summary: This will make the behavior of __gcov_flush match the GCC behavior. I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons. Reviewers: davidxl Reviewed By: davidxl Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48538 llvm-svn: 336365
* Revert "[CMake] Run libFuzzer tests with check-all."Yvan Roux2018-07-051-0/+2
| | | | | | | Revert due to AArch64 bots breakage, upstream PR raised to track the issue: https://bugs.llvm.org/show_bug.cgi?id=38034 llvm-svn: 336341
* [libFuzzer] [NFC] Inline static variable to avoid the linker warning.George Karpenkov2018-07-041-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D48650 llvm-svn: 336238
* [libFuzzer] add one more value profile metric, under a flag (experimental)Kostya Serebryany2018-07-036-7/+22
| | | | llvm-svn: 336234
* [libFuzzer] remove stale code, as suggested in https://reviews.llvm.org/D48800Kostya Serebryany2018-07-031-7/+0
| | | | llvm-svn: 336230
* [libFuzzer] add a tiny and surprisingly hard puzzleKostya Serebryany2018-07-031-0/+14
| | | | llvm-svn: 336229
* [scudo] Get rid of builtin-declaration-mismatch warningsKostya Kortchinsky2018-07-031-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The C interceptors were using `SIZE_T` defined in the interception library as a `__sanitizer::uptr`. On some 32-bit platforms, this lead to the following warning: ``` warning: declaration of ‘void* malloc(SIZE_T)’ conflicts with built-in declaration ‘void* malloc(unsigned int)’ [-Wbuiltin-declaration-mismatch] INTERCEPTOR_ATTRIBUTE void *malloc(SIZE_T size) { ``` `__sanitizer::uptr` is indeed defined as an `unsigned long` on those. So just include `stddef.h` and use `size_t` instead. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48885 llvm-svn: 336221
* [scudo] Enable Scudo on PPC64Kostya Kortchinsky2018-07-031-1/+1
| | | | | | | | | | | | | | | | Summary: In conjunction with the clang side change D48833, this will enable Scudo on PPC64. I tested `check-scudo` on a powerpc64le box and everything passes. Reviewers: eugenis, alekseyshl Reviewed By: alekseyshl Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48834 llvm-svn: 336213
* [scudo] Enable Scudo memory hooks for Fuchsia.Kostya Kortchinsky2018-07-021-2/+6
| | | | | | | | | | | | | | | | | Summary: It would be useful for Flutter apps, especially, to be able to use malloc hooks to debug memory leaks on Fuchsia. They're not able to do this right now, so it'd be a nice bonus to throw in with the Scudo switchover. Reviewers: cryptoad, alekseyshl Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D48618 llvm-svn: 336139
* [asan] Fix deadlock issue on FreeBSD, caused by use of .preinit_array in ↵Fangrui Song2018-07-012-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | rL325240 Summary: Without this patch, clang -fsanitize=address -xc =(printf 'int main(){}') -o a; ./a => deadlock in __asan_init>AsanInitInternal>AsanTSDInit>...>__getcontextx_size>_rtld_bind>rlock_acquire(rtld_bind_lock, &lockstate) libexec/rtld-elf/rtld.c wlock_acquire(rtld_bind_lock, &lockstate); if (obj_main->crt_no_init) preinit_main(); // unresolved PLT functions cannot be called here lib/libthr/thread/thr_rtld.c uc_len = __getcontextx_size(); // unresolved PLT function in libthr.so.3 check-xray tests currently rely on .preinit_array so we special case in xray_init.cc Subscribers: srhines, kubamracek, krytarowski, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48806 llvm-svn: 336067
* [UBsan] Enable subset of unit tests for OpenBSDDavid Carlier2018-06-3010-3/+17
| | | | | | | | | | Reviewers: kubamracek, krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D48805 llvm-svn: 336053
* [asan] Use MADV_NOCORE for use_madv_dontdump on FreeBSD.Fangrui Song2018-06-301-1/+3
| | | | | | | | | | | | | | | | Currently in FreeBSD 12.0-CURRENT with trunk clang+compiler-rt, faulty -fsanitize=address executable hangs at 'urdlck' state. Ka Ho Ng has verified that by backporting this to llvm 6.0.1, with use_madv_dontdump=1, shadow memory is not dumped. ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:use_madv_dontdump=1 ./a Reviewers: dimitry, kcc, dvyukov, emaste, khng300 Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48257 llvm-svn: 336046
* [profile] Add llvm_gcov_flush to be called outside a shared libraryChih-Hung Hsieh2018-06-292-0/+40
| | | | | | | | | | __gcov_flush is hidden. For applications to dump profiling data of selected .so files, they can use dlsym to find and call llvm_gcov_flush in each .so file. Differential Revision: https://reviews.llvm.org/D45454 llvm-svn: 336019
* [cfi] Use __builtin version of __clear_cache.Evgeniy Stepanov2018-06-291-1/+1
| | | | | | __builtin___clear_cache is also present on X86 and does the right thing (i.e. nop) there. llvm-svn: 335997
OpenPOWER on IntegriCloud