summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [scudo][standalone] Correct cmake copy/paste errorKostya Kortchinsky2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: I mistakenly used a SCUDO variable instead of SCUDO_STANDALONE one. The net result was that there were more architecture supported than I intended. Correct that, I'll add more architectures once the bots are enabled and green for x86. Reviewers: eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57897 llvm-svn: 353528
* [libFuzzer] refactor the way we choose the element to cross-over with, NFC ↵Kostya Serebryany2019-02-087-19/+47
| | | | | | (expected1); add a flag -seed_inputs= to pass extra seed inputs as file paths, not dirs llvm-svn: 353494
* [libFuzzer] add a test for built-in CrossOver (there are unit tests for ↵Kostya Serebryany2019-02-082-0/+68
| | | | | | this, but it's worth having a full integration test like this) llvm-svn: 353488
* Silence -Wformat warnings about GetLastError returning ULONGReid Kleckner2019-02-071-7/+7
| | | | llvm-svn: 353485
* Commit macro intended to be included in r353483.Reid Kleckner2019-02-071-1/+1
| | | | llvm-svn: 353484
* [compiler rt] Win64 GetInstructionSize additional register MOV + stack ↵Reid Kleckner2019-02-072-2/+27
| | | | | | | | | | | | | | | | | | | | | | | alignment AND Current interception code does not cover all of the required registers on Windows for a specific flavor of MOV, so this patch adds cases to identify the following 5-byte instructions on 64-bit Windows: mov QWORD PTR [rsp + XX], rdx <- second integer argument mov QWORD PTR [rsp + XX], r9 <- third integer argument mov QWORD PTR [rsp + XX], r8 <- fourth integer argument The instruction for MOV [...] RCX is already covered in the previous version. Patch by Matthew McGovern! Reviewers: rnk Differential Revision: https://reviews.llvm.org/D57339 llvm-svn: 353483
* [safestack] Explain why tinfo at the end of the bufferVitaly Buka2019-02-071-0/+2
| | | | | | | | | | | | | | Reviewers: pcc, eugenis, vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, jfb, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57863 llvm-svn: 353482
* [safestack] Remove pageSizeVitaly Buka2019-02-071-9/+2
| | | | | | | | | | | | | | | | | Summary: 3rd party sysconf interceptor may crash if it's called before unsafe_stack_setup However pageSize is not useful here. mmap should round up on it's own, SFS_CHECK can be removed. Reviewers: eugenis, vlad.tsyrklevich Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57924 llvm-svn: 353481
* [safestack] Don't crash if stack size is not aligned as expectedVitaly Buka2019-02-071-1/+1
| | | | | | | | | | | | | | | | Summary: From runtime side looks it's OK to RoundUpTo to needed alignment as buffer is going to be RoundUpTo to page size anyway. Reviewers: eugenis, pcc Subscribers: #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57866 llvm-svn: 353475
* [InstrProf] Port test suite to WindowsReid Kleckner2019-02-0739-132/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, check-profile would run, but all tests would be marked unsupported on Windows. This is the new status of 'check-profile' after this change: Testing Time: 6.66s Expected Passes : 29 Expected Failures : 5 Unsupported Tests : 39 I moved many tests that exercise posix-y features like dlopen and DSOs into the Posix subdirectory, and ran the tests on Linux to validate my changes. These are the remaining tests that I handled on a case by case basis: - instrprof-path.c Passes, Fixed some path portability issues - instrprof-gcov-exceptions.test Passes, the FileCheck actually succeeds on Windows, so I RUNX'd it - instrprof-icall-promo.test XFAILed, probably due to C++ ABI differences in vtables - instrprof-merge-match.test - instrprof-merge.c - instrprof-merging.cpp XFAILed, These seem like real bugs that need fixing - instrprof-version-mismatch.c XFAILed, Overriding the weak version symbol doesn't work - instrprof-without-libc.c UNSUPPORTED, test needs an executable symbol table, Windows has none Reviewers: davidxl, wmi, void Subscribers: fedor.sergeev, #sanitizers, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57853 llvm-svn: 353435
* [scudo][standalone] Do not error out on spurious C(XX) flagsKostya Kortchinsky2019-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: The standalone Scudo version is being built with `-Werror` which can be tripped by extraneous command line arguments. We have little control over those as they can be passed down to us by `CMAKE_C(XX)_FLAGS`, the reported scenario involving `-stdlib=libc++` (see https://reviews.llvm.org/D57412#1384504). To work around this, disable `-Wunused-command-line-argument`. Reviewers: eugenis, vitalybuka, Eugene.Zelenko Reviewed By: eugenis Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57757 llvm-svn: 353418
* tsan: add more benchmarksDmitry Vyukov2019-02-072-0/+100
| | | | | | | | | func_entry_exit.cc is for __tsan_func_entry/exit (spends ~75% there), we don't yet have any. mop.cc is for memory access functions, as compared to mini_bench_local/shared.cc this benchmark passes through deduplication logic (ContainsSameAccess). llvm-svn: 353407
* tsan: Optimize performance of Thread sanitizer memory access functionsDmitry Vyukov2019-02-074-18/+41
| | | | | | | | | | | | | | | | - Manually unwind code in MemoryAccessImpl1() because clang do not optimize it - Check for .rodata section only in read operations - Place LIKELY/UNLIKELY on fast paths This speeds up synthetic memory access benchmarks by 10-20%. [dvyukov: fixed up consts in check_analyze.sh] Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57882 Context: https://reviews.llvm.org/D54889 llvm-svn: 353401
* sanitizers: Introduce ThreadType enumDmitry Vyukov2019-02-0718-35/+44
| | | | | | | | | | | | | Replace bool workerthread flag with ThreadType enum. This change is preparation for fiber support. [dvyukov: fixed build of sanitizer_thread_registry_test.cc] Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57839 Context: https://reviews.llvm.org/D54889 llvm-svn: 353390
* tsan: Implement pthread_exit() interceptor for Thread sanitizerDmitry Vyukov2019-02-072-0/+31
| | | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57876 Context: https://reviews.llvm.org/D54889 llvm-svn: 353385
* [sanitizer] Fix Android testsVitaly Buka2019-02-071-0/+2
| | | | | | On Android some fields can be null llvm-svn: 353377
* [CMake] Mark runtime library link libraries as privatePetr Hosek2019-02-071-1/+1
| | | | | | | | | There's no need to expose these dependencies to consumers. This matches the change made to other runtimes in D57456. Differential Revision: https://reviews.llvm.org/D57873 llvm-svn: 353376
* [sanitizer] Re-enabled getpw_getgr.cc on AndroidVitaly Buka2019-02-071-1/+1
| | | | | | | | | | | | Reviewers: eugenis Subscribers: srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57785 llvm-svn: 353366
* [sanitizer] Remove unneeded pointer checkVitaly Buka2019-02-071-16/+16
| | | | | | | | | | | | | | Summary: unpoison_passwd and unpoison_group support nullptrs Reviewers: eugenis Subscribers: kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57784 llvm-svn: 353365
* [sanitizer] Don't unpoison buffer in getpw/getgr functionsVitaly Buka2019-02-073-65/+148
| | | | | | | | | | | | | | | | | Summary: Buffer should be referenced by results so used parts will be unpoisoned with unpoison_group and unpoison_passwd. This fixes TSAN performance issue made us to disable this interceptors. Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, krytarowski, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57731 llvm-svn: 353351
* [sanitizer] Fix fuchsia and windows build.Evgeniy Stepanov2019-02-062-4/+7
| | | | llvm-svn: 353261
* [sanitizer] Decorate /proc/self/maps better.Evgeniy Stepanov2019-02-0610-93/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Refactor the way /proc/self/maps entries are annotated to support most (all?) posix platforms, with a special implementation for Android. Extend the set of decorated Mmap* calls. Replace shm_open with internal_open("/dev/shm/%s"). Shm_open is problematic because it calls libc open() which may be intercepted. Generic implementation has limits (max number of files under /dev/shm is 64K on my machine), which can be conceivably reached when sanitizing multiple programs at once. Android implemenation is essentially free, and enabled by default. The test in sanitizer_common is copied to hwasan and not reused directly because hwasan fails way too many common tests at the moment. Reviewers: pcc, vitalybuka Subscribers: srhines, kubamracek, jfb, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D57720 llvm-svn: 353255
* Update the ioctl(2) list in sanitizers with NetBSD 8.99.34Kamil Rytarowski2019-02-054-16/+3
| | | | llvm-svn: 353224
* [InstrProf] Merge COFF .lprof* and .lcovmap sections into .data/.rdataReid Kleckner2019-02-051-0/+9
| | | | | | | | | | | There is no reason for these sections to remain separate in the final DLL or EXE. I have not yet added a InstrProfilingPlatformWindows.c for these, since avoiding dynamic profile data registration is a larger project for later. llvm-svn: 353221
* [sanitizer] Fix unused function 'unpoison_passwd'Vitaly Buka2019-02-051-12/+4
| | | | llvm-svn: 353205
* gn build: Upgrade to NDK r19.Peter Collingbourne2019-02-054-2/+13
| | | | | | | | | | NDK r19 includes a sysroot that can be used directly by the compiler without creating a standalone toolchain, so we just need a handful of flags to point Clang there. Differential Revision: https://reviews.llvm.org/D57733 llvm-svn: 353139
* [tsan] Disable fgetpwent_r to work around performance issuesVitaly Buka2019-02-041-0/+1
| | | | | | This was missed from D54041 when SANITIZER_INTERCEPT_FGETPWENT_R was branched from SANITIZER_INTERCEPT_GETPWENT_R llvm-svn: 353110
* [libFuzzer][Windows] Clean up RawPrintJonathan Metzman2019-02-041-2/+1
| | | | | | | | | | | | | | | | Summary: Use `_write` instead of the deprecated alias `write` on Windows. Also, remove comment saying RawPrint is untested on Windows. Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka Differential Revision: https://reviews.llvm.org/D57589 llvm-svn: 353108
* [scudo] Initial standalone skeleton check-inKostya Kortchinsky2019-02-0415-0/+961
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the initial check-in for the Standalone version of Scudo. The project is initially going to live in scudo/standalone then will replace scudo. See http://lists.llvm.org/pipermail/llvm-dev/2019-January/129113.html for details. This initial CL is meant to lay out the project structure, of both code & tests, providing a minimal amount of functionalities, namely various definitions, some atomic helpers and an intrusive list. (empty.cc is just here to have a compilation unit, but will go away in the upcoming CLs). Initial support is restricted to Linux i386 & x86_64 in make files and will be extended once things land & work. We will grow organically from here, adding functionalities in limited amounts. Reviewers: morehouse, eugenis, vitalybuka, kcc, mcgrathr, flowerhack Reviewed By: morehouse, vitalybuka Subscribers: srhines, mgorny, krytarowski, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57412 llvm-svn: 353055
* [libFuzzer][Windows] Reenable passing testsJonathan Metzman2019-02-038-11/+3
| | | | | | | | | | | | | | | | Summary: Enable tests that were previously disabled because they didn't work on Windows. Reviewers: morehouse Reviewed By: morehouse Subscribers: morehouse Differential Revision: https://reviews.llvm.org/D57563 llvm-svn: 353000
* [ubsan] Make suppressions.cpp test pass for me on WindowsReid Kleckner2019-02-012-2/+11
| | | | | | | | | | | The test seems to be failing because the module suppression file contains a colon. I found that it was sufficient to just use the basename of the suppression file. While I was here, I noticed that we don't implement IsAbsolutePath for Windows, so I added it. llvm-svn: 352921
* Mark __rela_iplt_{start,end} as weak.Peter Collingbourne2019-02-011-1/+1
| | | | | | Should fix non-lld links. llvm-svn: 352823
* [libFuzzer] make a test for exploding dfsan labels more agressiveKostya Serebryany2019-01-311-0/+2
| | | | llvm-svn: 352819
* hwasan: Add __hwasan_init_static() function.Peter Collingbourne2019-01-319-23/+72
| | | | | | | | | | | This function initializes enough of the runtime to be able to run instrumented code in a statically linked executable. It replaces __hwasan_shadow_init() which wasn't doing enough initialization for instrumented code that uses either TLS or IFUNC to work. Differential Revision: https://reviews.llvm.org/D57490 llvm-svn: 352816
* [libFuzzer][Windows] Temporarily disable value-profile-cmp2.test on WinJonathan Metzman2019-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: Temporarily disable value-profile-cmp2.test on Win. https://reviews.llvm.org/D57465 causes the test to fail on Win. However, it seems that the behavior of libFuzzer on Win was broken before that patch. It crashes in the exit handler when not used with ASAN. Prior to the patch, the crash handler would run, tricking the test into thinking libFuzzer on Win had exited properly. Reviewers: morehouse, vitalybuka Reviewed By: morehouse Subscribers: yln Differential Revision: https://reviews.llvm.org/D57551 llvm-svn: 352815
* [fuzzer] Use RawPrint instead of Printf for instrumentation warningJonathan Metzman2019-01-313-8/+12
| | | | | | | | | | | | | | | Summary: Use RawPrint instead of Printf for instrumentation warning because Printf doesn't work on Win when instrumentation is being initialized (since OutputFile is not yet initialized). Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D57531 llvm-svn: 352789
* [libFuzzer] relax a flaky testKostya Serebryany2019-01-311-1/+0
| | | | llvm-svn: 352778
* Revert r352732: [libFuzzer] replace slow std::mt19937 with a much faster ↵Jeremy Morse2019-01-311-3/+3
| | | | | | | | | | std::minstd_rand This causes a failure on the following bot as well as our internal ones: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/23103 llvm-svn: 352747
* [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_randKostya Serebryany2019-01-311-3/+3
| | | | llvm-svn: 352732
* [CMake][compiler-rt] Enable statically linking unwinder and c++abiPetr Hosek2019-01-311-6/+25
| | | | | | | | | | Rather than guessing whether to use static or shared version of unwinder and c++abi when using linking against the in-tree versions, provide a CMake option to control this. Differential Revision: https://reviews.llvm.org/D57492 llvm-svn: 352723
* [libFuzzer] Update Darwin testJulian Lettner2019-01-311-13/+3
| | | | | | | | | | | Support for -fsanitize-coverage=trace-pc[-guard] was removed from libFuzzer, which makes this currently fail. This commit aligns this Darwin-specific test with its Linux counterpart which changed in this commit: https://github.com/llvm/llvm-project/commit/3a94519a777b9ac407a1d5ff5c31ec48b3768eec llvm-svn: 352721
* [libFuzzer] set libFuzzer's own SEGV handler even one is already present, ↵Kostya Serebryany2019-01-315-13/+19
| | | | | | but call that handler from ours (unless we are unprotecting lazy counters). Call ProtectLazyCounters later, so that it runs after the initialization code in the target. llvm-svn: 352713
* [libFuzzer] Set default sanitizer options in fuzzer testsJulian Lettner2019-01-316-7/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Set default `ASAN_OPTIONS` when running libFuzzer tests. This allows us to remove special casing in code for Darwin where we usually pass `abort_on_error=0` to override platform defaults for tests. A previous commit changed the code to make the tests pass: https://github.com/llvm/llvm-project/commit/7764a04af007eca68eafcf5caaea560ed05e35a9 Adapted a few tests to use `%env_asan_opts=` instead of directly setting the environment variable. rdar://problem/47515276 Reviewers: kcc, george.karpenkov Differential Revision: https://reviews.llvm.org/D57465 llvm-svn: 352711
* [libFuzzer] experimental performance optimization -lazy_counters, off by ↵Kostya Serebryany2019-01-3112-1/+82
| | | | | | default. Posix-only for now, tested on Linux llvm-svn: 352700
* [libFuzzer] remove stale code, NFCKostya Serebryany2019-01-309-346/+0
| | | | llvm-svn: 352604
* [libFuzzer] refactor the handling of instrumentation counters so that they ↵Kostya Serebryany2019-01-304-47/+109
| | | | | | are grouped in regions one full page each. Needed for future optimization. NFC llvm-svn: 352603
* [libFuzzer] update a test Kostya Serebryany2019-01-301-8/+0
| | | | llvm-svn: 352577
* [libFuzzer] remove stale code Kostya Serebryany2019-01-296-113/+3
| | | | llvm-svn: 352571
* [libFuzzer] revert an accidental commitKostya Serebryany2019-01-291-3/+35
| | | | llvm-svn: 352567
* [libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]Kostya Serebryany2019-01-291-35/+3
| | | | llvm-svn: 352566
OpenPOWER on IntegriCloud