summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [hwasan] Fix tests after .cc->.cpp renaming.Evgeniy Stepanov2019-02-271-2/+2
| | | | llvm-svn: 355028
* [libFuzzer][Windows] Port fork mode to WindowsJonathan Metzman2019-02-272-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer's fork mode to Windows. Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this. Don't print error messages under new normal uses of FileSize (on a non-existent file). Implement portable way of piping output to /dev/null. Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win. Reviewers: zturner Reviewed By: zturner Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58513 llvm-svn: 355019
* [Darwin][NFC] Refactor throttling of 64bit sanitizer tests on DarwinJulian Lettner2019-02-276-22/+23
| | | | | | | | | | | | | | | | | | | Underlying condition for throttling is "has large mmap'd regions" (i.e., shadow memory) and not sanitizers in general (e.g., UBSan does not need to be throttled). Rename parallelism group `darwin-64bit-sanitizer` to `shadow-memory` and apply it unconditionally to all tests which require it. We can then have all the Darwin throttling logic in one place in the commen lit config. Throttle sanitizer_common unit tests. Configuration was previously missing from sanitizer_common/Unit/lit.site.cfg. Reviewed by: kubamracek Differential Revision: https://reviews.llvm.org/D58677 llvm-svn: 355018
* Fixed a minor merge error with this patch.Mitch Phillips2019-02-261-1/+1
| | | | llvm-svn: 354908
* [compiler-rt] Provide better llvm-lit failure when llvm-config fails.Mitch Phillips2019-02-261-1/+2
| | | | | | | | | | | | | | | | | | | Summary: The current error message can cause confusion if llvm-config can't be executed for reasons other than "not found". In my example, cross compiling generated an llvm-config binary for aarch64 which couldn't be executed natively. Instead of telling me that the error was with the file architecture, it reports the file as not being present. Reviewers: pcc Subscribers: dberris, javed.absar, kristof.beyls, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58647 llvm-svn: 354907
* Revert "[compiler-rt] Intercept the bcmp() function."Vlad Tsyrklevich2019-02-265-34/+5
| | | | | | | This reverts commits r354851, 354852, 354853 and r354888. They were causing build failures on the android sanitizer bot. llvm-svn: 354906
* [compiler-rt] Disable failing test on darwin during investigation.Clement Courbet2019-02-261-0/+1
| | | | | | | | | | | | | | /Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc:14:12: error: CHECK: expected string not found in input // CHECK: {{#1.*bcmp}} ^ <stdin>:2:57: note: scanning from here ==34677==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffee93777c4 at pc 0x0001068a7285 bp 0x7ffee9377770 sp 0x7ffee9376ef8 ^ <stdin>:6:20: note: possible intended match here #2 0x106888e77 in main bcmp_test.cc:12 ^ llvm-svn: 354888
* [compiler-rt] disable asan bcmp tests on android.Clement Courbet2019-02-261-0/+1
| | | | | | | | Android does not have bcmp. sanitizer-x86_64-linux-android: run instrumented asan tests [arm/aosp_marlin-userdebug/PI] - stdio llvm-svn: 354853
* [compiler-rt] Fix test broken by r354851.Clement Courbet2019-02-262-2/+2
| | | | | | | error: CHECK: expected string not found in input // CHECK: Uninitialized bytes in __interceptor_memcmp at offset 3 llvm-svn: 354852
* [compiler-rt] Intercept the bcmp() function.Clement Courbet2019-02-263-3/+30
| | | | | | | | | | | | | | | | | | | | | Summary: I have not introduced a separate hook for `bcmp()` as I don't think there should be any reason for a sanitizer to treat it differently from `memcmp()`. This is only enabled when building on POSIX with GNU extensions. Context: this is to avoid losing coverage when emitting `bcmp() == 0` instead of `memcmp() == 0` in llvm, see https://reviews.llvm.org/D56593. Reviewers: mgorny, krytarowski, vitalybuka, dvyukov Subscribers: kubamracek, dberris, delcypher, jdoerfert, #sanitizers, llvm-commits, jyknight Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58379 llvm-svn: 354851
* [llvm-cov] Fix llvm-cov on Windows and un-XFAIL testReid Kleckner2019-02-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The llvm-cov tool needs to be able to find coverage names in the executable, so the .lprfn and .lcovmap sections cannot be merged into .rdata. Also, the linker merges .lprfn$M into .lprfn, so llvm-cov needs to handle that when looking up sections. It has to support running on both relocatable object files and linked PE files. Lastly, when loading .lprfn from a PE file, llvm-cov needs to skip the leading zero byte added by the profile runtime. Reviewers: vsk Subscribers: hiraditya, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58661 llvm-svn: 354840
* [sanitizer] Re-disable a few tests on android.Evgeniy Stepanov2019-02-264-4/+6
| | | | | | Tests were accidentally enabled r354829. llvm-svn: 354834
* [sanitizer] Remove "-android" from test_arch.Evgeniy Stepanov2019-02-252-16/+2
| | | | | | | | | | | | | | | | | | Summary: ASan and Scudo tests are adding "-android" to test arch. There are no tests that depend on it as far as I can see. If necessary, do this instead: REQUIRES: aarch64-target-arch && android Reviewers: pcc, vitalybuka Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, cryptoad, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58532 llvm-svn: 354829
* [NFC][Sanitizer] Re-enable test on DarwinJulian Lettner2019-02-221-3/+0
| | | | | | | This unexpectedly passes on our CI, although it still fails on my machine. llvm-svn: 354701
* [Sanitizer] Fix uses of stack->Unwind(..., fast)Julian Lettner2019-02-221-2/+2
| | | | | | | | | | | Apply StackTrace::WillUseFastUnwind(fast) in a few more places missed by my previous patch (https://reviews.llvm.org/D58156). Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58550 llvm-svn: 354695
* Revert "[asan] Fix vfork handling.", +1Evgeniy Stepanov2019-02-212-63/+0
| | | | | | Revert r354625, r354627 - multiple build failures. llvm-svn: 354629
* [asan] Fix vfork handling.Evgeniy Stepanov2019-02-211-2/+2
| | | | | | | | __asan_handle_vfork was unpoisoning the wrong part of the stack. Adjust the test to catch this reliably (current failure is non-deterministic). llvm-svn: 354627
* [hwasan,asan] Intercept vfork.Evgeniy Stepanov2019-02-212-0/+63
| | | | | | | | | | | | | | Summary: AArch64 only for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, jdoerfert, #sanitizers, llvm-commits, kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58313 llvm-svn: 354625
* [LSan] Fix `__sanitizer_print_stack_trace` via fast unwinderJulian Lettner2019-02-203-5/+2
| | | | | | | | | | Summary: Quick follow-up to: https://reviews.llvm.org/D58156 Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58358 llvm-svn: 354522
* Fix license headersVitaly Buka2019-02-201-2/+3
| | | | llvm-svn: 354500
* [msan] Fix name_to_handle_at test on overlayfs.Evgeniy Stepanov2019-02-191-1/+1
| | | | | | Udev supports name_to_handle_at. Use /dev/null instead of /bin/cat. llvm-svn: 354402
* [msan] Remove cxa_atexit_race.ccVitaly Buka2019-02-191-35/+0
| | | | | | | | | | | | | | | | | | | | | Summary: The goal of the test to check that msan does not crash when code is racy on __cxa_atexit. Original crash was caused by race condition in the glibc. With the msan patch the msan does not crashes however the race is still there and the test triggers it. Because the test relies on triggering of undefined behavior results are not very predictable and it may occasionally crashes or hangs. I don't see how to reasonably improve the test, so I remove it. Reviewers: eugenis, peter.smith Subscribers: jfb, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58396 llvm-svn: 354377
* [LSan][Darwin][NFC] Add comment explaining test failureJulian Lettner2019-02-181-1/+1
| | | | llvm-svn: 354290
* [Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frameJulian Lettner2019-02-182-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In compiler-rt we have the notion of a `fast` and a `slow` stack unwinder. Darwin currently only supports the fast unwinder. From reading the code, my understanding is that `BufferedStackTrace::Unwind` can be called with `bp=0, stack_top=0, stack_bottom=0, request_fast_unwind=false`. If `request_fast_unwind=true`, then we alos need to supply bp, stack_top, and stack_bottom. However, `BufferedStackTrace::Unwind` uses `StackTrace::WillUseFastUnwind` which will adapt `request_fast_unwind` if the requested unwinder is not supported. On Darwin, the result is that we don't pass actual values for bp, stack_top, and stack_bottom, but end up using the fast unwinder. The tests then fail because we only print the topmost stack frame. This patch adds a check to `WillUseFastUnwind` at the point of usage to avoid the mismatch between `request_fast_unwind` and what `Unwind` actually does. I am also interested in cleaning up the `request_fast_unwind` machinery so this patch just the simplest thing possible so I can enable the tests. Reviewers: vitalybuka, vsk Differential Revision: https://reviews.llvm.org/D58156 llvm-svn: 354282
* [compiler-rt] Fix broken sanitizer bots (hopefully)Jonas Hahnfeld2019-02-1712-13/+15
| | | | | | | | | | | | | | | | | | | According to the logs and local debugging there were two issues: 1) tsan tests listed libc++.a before the source file. That's usually ok for shared libraries, but the linker will not add symbols from a static library unless needed at that time. As a result the tests that rely upon symbols from the library (and not only include the headers) had undefined references. To solve this I'm adding a new substitution %link_libcxx_tsan which expands to libc++.a if available. 2) The target Fuzzer-x86_64-Test linked in SANITIZER_TEST_CXX_LIBRARIES which defaults to -lstdc++. This resulted in error messages like hidden symbol '_ZdlPv' is not defined locally hidden symbol '_Znwm' is not defined locally when using GNU gold (ld.bfd and lld are fine). Removing the linkage is fine because we build a custom libc++ for that purpose. llvm-svn: 354231
* [compiler-rt] Build custom libcxx with libcxxabiJonas Hahnfeld2019-02-176-22/+11
| | | | | | | | | | | | | | | This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 llvm-svn: 354212
* [libFuzzer] make len_control less agressive: set the initial max len to the ↵Kostya Serebryany2019-02-161-0/+11
| | | | | | length of the largest seed. This was the original intent, but... Now, with a test, to ensure it stays this way llvm-svn: 354191
* [libFuzzer] fork mode: try harder to cleanup after itselfKostya Serebryany2019-02-161-0/+15
| | | | llvm-svn: 354186
* [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.configJulian Lettner2019-02-156-17/+3
| | | | | | | | | | | | | | | | | | | Serial execution on iOS devices is not specific to sanitizers. We want to throttle all on-device tests. Pull the setting of the parallelism_group up into the common lit configuration file. Rename `darwin-ios-device-sanitizer` to `ios-device`. This group is not specific to sanitizers and (theoretically) independent from the host OS. Note that we don't support running unit tests on-device (there are no configurations generated for that). If that ever changes, we also need this configuration in `unittests/lit.common.unit.cfg`. Reviewers: delcypher Differential Revision: https://reviews.llvm.org/D58209 llvm-svn: 354179
* [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time ↵Kostya Serebryany2019-02-151-0/+4
| | | | | | flag, print the number of ooms/timeouts/crashes, fix a typo llvm-svn: 354175
* Fix unsymbolized stack history printing.Evgeniy Stepanov2019-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | Summary: When symbols are unavailable, the current code prints sp: ... pc: ... (null) (null) instead of module name + offset. Change the output to include module name and offset, and also to match the regular sanitizer stack trace format so that it is recognized by symbolize.py out of the box. Reviewers: kcc, pcc Subscribers: kubamracek, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58267 llvm-svn: 354157
* Runtime flags for malloc bisection.Evgeniy Stepanov2019-02-151-0/+26
| | | | | | | | | | | | Reviewers: kcc, pcc Subscribers: kubamracek, mgorny, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58162 llvm-svn: 354156
* Fix false positive when tag_in_malloc=0,tag_in_free=1.Evgeniy Stepanov2019-02-151-0/+51
| | | | | | | | | | | | | | | | Summary: With tag_in_free=1, malloc() can not assume that the memory is untagged, and needs to retag is to 0. Reviewers: pcc, kcc Subscribers: kubamracek, jfb, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58158 llvm-svn: 354155
* [libFuzzer] when doing the merge, keep track of the coveraged edges, not ↵Kostya Serebryany2019-02-143-7/+8
| | | | | | just features llvm-svn: 354076
* Set hidden attribute on lprofMergeValueProfDataAna Pazos2019-02-142-0/+66
| | | | | | | | | | | | | | | | | | | | | Summary: The changes in https://reviews.llvm.org/D44847 cause load time failure due to lprofMergeValueProfData in Android libs enabled with profile generation: "dlopen failed: cannot locate symbol "lprofMergeValueProfData" referenced by..." Marking lprofMergeValueProfData as hidden so the correct in-module definition is picked by the linker. Reviewers: davidxl Reviewed By: davidxl Subscribers: efriedma, xur, davidxl, llvm-commits Differential Revision: https://reviews.llvm.org/D55893 llvm-svn: 354064
* Revert "Temporarily disable calls to getgrnam/getgrnam_r in test due to it ↵Douglas Yung2019-02-141-4/+2
| | | | | | | | | | hitting unrelated issues in EGLIBC 2.19." This reverts commit r353594. We have updated our internal build bot to a newer version of LIBC which does not have this problem. llvm-svn: 354014
* [msan] Don't delete MSanAtExitRecordVitaly Buka2019-02-141-0/+35
| | | | | | | | | | | | | | | | | | Summary: Pre 2.27 libc can run same atexit handler twice We will keep MSanAtExitRecord and reset fun to mark it as executed. Fix PR40162 Reviewers: eugenis Subscribers: jfb, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58221 llvm-svn: 354005
* Dmitry Vyukov2019-02-136-0/+348
| | | | | | | | | | | | | | | | | | | | | | | tsan: add fiber support This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 [The previous commit of this change was reverted, this is a resubmit with a squashed fix for check_analyze.sh and COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED] llvm-svn: 353947
* Revert "tsan: add fiber support"Diana Picus2019-02-136-348/+0
| | | | | | | This reverts commit r353817 because we think it broke AARch64 and PowerPC buildbots. llvm-svn: 353939
* [libFuzzer] a bit of refactoring of the fork modeKostya Serebryany2019-02-131-2/+3
| | | | llvm-svn: 353910
* [Sanitizer][NFC] Darwin: limit parallism for sanitizer_common testsJulian Lettner2019-02-131-0/+6
| | | | | | | Many sanitizer_common tests (ASan, TSan) run with a "sanitized process space" so we need to limit their parallism. llvm-svn: 353909
* tsan: add fiber supportDmitry Vyukov2019-02-126-0/+348
| | | | | | | | | | | | | | | | | This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 llvm-svn: 353817
* [CMake] Avoid internal dependencies in the runtimes buildPetr Hosek2019-02-121-1/+1
| | | | | | | When performing runtimes build, dependencies like clang and clang-headers aren't available. This was accidentally omitted in D57992. llvm-svn: 353796
* [libFuzzer] teach the fork mode to ignore OOMs and timeoutsKostya Serebryany2019-02-123-5/+35
| | | | llvm-svn: 353792
* [libFuzzer] Make coverage.test work on ARM64Julian Lettner2019-02-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This test instruments the following code with coverage, runs the fuzzer once, and asserts that there are uncovered PCs. The ARM64 backend optimizes this code using the `csel` (Conditional select) instruction, which removes all branching from the resulting machine code. The test then fails because we do not have any uncovered PCs. The easiest solution for now is to turn off optimization for the DSOs used in this test. ``` int DSO1(int a) { if (a < 123456) return 0; return 1; } ``` rdar://47646400 Reviewers: kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58087 llvm-svn: 353780
* [libFuzzer] run the -fork=1 tests only on linuxKostya Serebryany2019-02-122-1/+5
| | | | llvm-svn: 353777
* [libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany2019-02-121-1/+2
| | | | | | good enough for the first unit test llvm-svn: 353775
* [NFC] Re-enable XFAILed fuzzer test on iOSJulian Lettner2019-02-111-1/+0
| | | | llvm-svn: 353737
* [tsan] Remove debug logging and disable test on ppc64beVitaly Buka2019-02-091-1/+1
| | | | llvm-svn: 353624
* [tsan] Remove debug logging and disable test on ppc64beVitaly Buka2019-02-091-5/+5
| | | | llvm-svn: 353623
OpenPOWER on IntegriCloud