summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [tsan] Debug failing test on PPC botVitaly Buka2019-02-091-1/+5
| | | | llvm-svn: 353617
* Temporarily disable calls to getgrnam/getgrnam_r in test due to it hitting ↵Douglas Yung2019-02-091-2/+4
| | | | | | unrelated issues in EGLIBC 2.19. llvm-svn: 353594
* [libFuzzer] remove two unused experimental flagsKostya Serebryany2019-02-082-27/+0
| | | | llvm-svn: 353573
* [InstrProf] Implement static profdata registrationReid Kleckner2019-02-082-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivating use case is eliminating duplicate profile data registered for the same inline function in two object files. Before this change, users would observe multiple symbol definition errors with VC link, but links with LLD would succeed. Users (Mozilla) have reported that PGO works well with clang-cl and LLD, but when using LLD without this static registration, we would get into a "relocation against a discarded section" situation. I'm not sure what happens in that situation, but I suspect that duplicate, unused profile information was retained. If so, this change will reduce the size of such binaries with LLD. Now, Windows uses static registration and is in line with all the other platforms. Reviewers: davidxl, wmi, inglorion, void, calixte Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57929 llvm-svn: 353547
* [libFuzzer] refactor the way we choose the element to cross-over with, NFC ↵Kostya Serebryany2019-02-081-0/+4
| | | | | | (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
* [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
* tsan: Implement pthread_exit() interceptor for Thread sanitizerDmitry Vyukov2019-02-071-0/+25
| | | | | | | | | | 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
* [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] Don't unpoison buffer in getpw/getgr functionsVitaly Buka2019-02-071-0/+112
| | | | | | | | | | | | | | | | | 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] Decorate /proc/self/maps better.Evgeniy Stepanov2019-02-061-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* gn build: Upgrade to NDK r19.Peter Collingbourne2019-02-053-2/+10
| | | | | | | | | | 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
* [scudo] Initial standalone skeleton check-inKostya Kortchinsky2019-02-043-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-011-1/+4
| | | | | | | | | | | 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
* [libFuzzer] make a test for exploding dfsan labels more agressiveKostya Serebryany2019-01-311-0/+2
| | | | llvm-svn: 352819
* [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-311-1/+1
| | | | | | | | | | | | | | | 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
* [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-311-0/+1
| | | | | | 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-315-5/+12
| | | | | | | | | | | | | | | | | | | | | 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-311-0/+4
| | | | | | default. Posix-only for now, tested on Linux llvm-svn: 352700
* [libFuzzer] refactor the handling of instrumentation counters so that they ↵Kostya Serebryany2019-01-301-0/+2
| | | | | | 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 deprecated support for -fsanitize-coverage=trace-pc[-guard]Kostya Serebryany2019-01-293-25/+4
| | | | llvm-svn: 352564
* Add 'REQUIRES: zlib' to a fuzzer testJeremy Morse2019-01-291-0/+1
| | | | | | Fixes tests on build environments that don't have zlib. See also r352483. llvm-svn: 352487
* Add zlib feature test to lit configurationJeremy Morse2019-01-292-0/+5
| | | | | | | | | | | Some new tests in libfuzzer have dependencies on zlib: add a feature test for zlib so that we can add a REQUIRES field to the relevant tests. Patch by Matthew Voss. Differential Revision: https://reviews.llvm.org/D57366 llvm-svn: 352483
* [fuzzer][afl] Remove AFL_DRIVER_EXTRA_STATS_FILENAMEJonathan Metzman2019-01-281-33/+0
| | | | | | | | | | | | | | Summary: Remove this feature as it is unused, buggy, and not worth correcting since the forkserver makes it difficult. Reviewers: morehouse, jfb Reviewed By: morehouse Differential Revision: https://reviews.llvm.org/D57308 llvm-svn: 352392
* [CMake] Quick-Fix FileCheck target does not exist when building against LLVM ↵Stefan Granitz2019-01-281-4/+0
| | | | | | | | | | install-tree with COMPILER_RT_INCLUDE_TESTS=ON The issue came up during release testing for LLVM 8: https://bugs.llvm.org/show_bug.cgi?id=40443 Differential Revision: https://reviews.llvm.org/D57224 llvm-svn: 352381
* [libFuzzer] add CompressedTest.cpp, a real-life-ish test for a custom mutatorKostya Serebryany2019-01-262-0/+67
| | | | llvm-svn: 352265
* [libFuzzer] print uncovered functions when doing -print_coverage=1Kostya Serebryany2019-01-261-0/+1
| | | | llvm-svn: 352263
* [scudo] Delay allocations in the RSS check testKostya Kortchinsky2019-01-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: D57116 fails on the armv7 bots, which is I assume due to the timing of the RSS check on the platform. While I don't have a platform to test that change on, I assume this would do. The test could be made more reliable by either delaying more the allocations, or allocating more large-chunks, but both those options have a somewhat non negligible impact (more memory used, longer test). Hence me trying to keep the additional sleeping/allocating to a minimum. Reviewers: eugenis, yroux Reviewed By: yroux Subscribers: javed.absar, kristof.beyls, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D57241 llvm-svn: 352220
* [hwasan] Implement print_module_map flag.Evgeniy Stepanov2019-01-251-0/+32
| | | | | | | | | | Reviewers: kcc, pcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D57130 llvm-svn: 352150
* [libFuzzer] more agressive value profiling and CMP tracing for switch statementsKostya Serebryany2019-01-242-0/+26
| | | | llvm-svn: 352107
* Revert "[Sanitizers] UBSan unreachable incompatible with ASan in the ↵Julian Lettner2019-01-241-16/+0
| | | | | | | | presence of `noreturn` calls" This reverts commit cea84ab93aeb079a358ab1c8aeba6d9140ef8b47. llvm-svn: 352069
* [scudo] Tuning changes based on feedback from current useKostya Kortchinsky2019-01-241-12/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: This tunes several of the default parameters used within the allocator: - disable the deallocation type mismatch on Android by default; this was causing too many issues with third party libraries; - change the default `SizeClassMap` to `Dense`, it caches less entries and is way more memory efficient overall; - relax the timing of the RSS checks, 10 times per second was too much, lower it to 4 times (every 250ms), and update the test so that it passes with the new default. Reviewers: eugenis Reviewed By: eugenis Subscribers: srhines, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D57116 llvm-svn: 352057
* Temporarily deactivate tests; it fails on certain botsJulian Lettner2019-01-241-1/+1
| | | | llvm-svn: 352020
* [ubsan] Fix test when isPICDefault() returns false after rCTE352003Fangrui Song2019-01-241-1/+1
| | | | llvm-svn: 352013
* [Sanitizers] UBSan unreachable incompatible with ASan in the presence of ↵Julian Lettner2019-01-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `noreturn` calls Summary: UBSan wants to detect when unreachable code is actually reached, so it adds instrumentation before every `unreachable` instruction. However, the optimizer will remove code after calls to functions marked with `noreturn`. To avoid this UBSan removes `noreturn` from both the call instruction as well as from the function itself. Unfortunately, ASan relies on this annotation to unpoison the stack by inserting calls to `_asan_handle_no_return` before `noreturn` functions. This is important for functions that do not return but access the the stack memory, e.g., unwinder functions *like* `longjmp` (`longjmp` itself is actually "double-proofed" via its interceptor). The result is that when ASan and UBSan are combined, the `noreturn` attributes are missing and ASan cannot unpoison the stack, so it has false positives when stack unwinding is used. Changes: # UBSan now adds the `expect_noreturn` attribute whenever it removes the `noreturn` attribute from a function # ASan additionally checks for the presence of this attribute Generated code: ``` call void @__asan_handle_no_return // Additionally inserted to avoid false positives call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable unreachable ``` The second call to `__asan_handle_no_return` is redundant. This will be cleaned up in a follow-up patch. rdar://problem/40723397 Reviewers: delcypher, eugenis Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56624 llvm-svn: 352003
* hwasan: Read shadow address from ifunc if we don't need a frame record.Peter Collingbourne2019-01-231-1/+2
| | | | | | | | | | | | | This saves a cbz+cold call in the interceptor ABI, as well as a realign in both ABIs, trading off a dcache entry against some branch predictor entries and some code size. Unfortunately the functionality is hidden behind a flag because ifunc is known to be broken on static binaries on Android. Differential Revision: https://reviews.llvm.org/D57084 llvm-svn: 351989
* [HWASAN] Improve tag mismatch diagnosticsEugene Leviant2019-01-211-5/+7
| | | | | | | | | Reports correct size and tags when either size is not power of two or offset to bad granule is not zero. Differential revision: https://reviews.llvm.org/D56603 llvm-svn: 351730
* [fuzzer] Fix test checks broken after license header updateVitaly Buka2019-01-218-8/+8
| | | | llvm-svn: 351717
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-19194-776/+582
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-19143-394/+429
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [hwasan] Madvise away unused shadow.Evgeniy Stepanov2019-01-191-0/+70
| | | | | | | | | | | | | | | | | | Summary: Whenever a large shadow region is tagged to zero, madvise(DONT_NEED) as much of it as possible. This reduces shadow RSS on Android by 45% or so, and total memory use by 2-4%, probably even more on long running multithreaded programs. CPU time seems to be in the noise. Reviewers: kcc, pcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56757 llvm-svn: 351620
* Fix sanitizer tool list used to generate sanitizer_common tests to be ↵Dan Liew2019-01-166-14/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | up-to-date. Summary: This replaces the sanitizer tool list (used for generating sanitizer_common configurations) with a tool list derived from existing build system information. Previously sanitizer_common had its own list of supported sanitizer tools. This was bad because it was out of sync with the rest of the build system. Notably it meant that the sanitizer_common runtime was only being tested on Darwin the ASan dylib and not the other sanitizer dylibs that are built for Darwin (LSan, TSan, and UBSan). Unfortunately enabling the tests against other sanitizer dylibs has lead to some test failures on Darwin. For now they've been marked as XFAIL until the failures can investigated properly. For Windows and Android we use the old sanitizer tool list to try avoid bot breakages. rdar://problem/47143078 Reviewers: kubamracek, george.karpenkov, yln, samsonov, vitalybuka, krytarowski Subscribers: srhines, mgorny, fedor.sergeev, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55740 llvm-svn: 351398
* compiler-rt tests: Unbreak cmake with LLVM_ENABLE_PIC=OFF on macNico Weber2019-01-162-18/+22
| | | | | | | | The LTO target doesn't exist with LLVM_ENABLE_PIC turned off. Differential Revision: https://reviews.llvm.org/D56800 llvm-svn: 351373
* compiler-rt/test: Bring back -pie on Android.Peter Collingbourne2019-01-151-1/+1
| | | | | | | | Looks like the sanitizer-x86_64-linux-android bot started failing because -pie is still needed when targeting API levels < 16 (which is the case by default for arm and i686). llvm-svn: 351270
OpenPOWER on IntegriCloud