summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizer] lit test config: Respect existing parallelism_groupJulian Lettner2019-02-281-1/+2
| | | | llvm-svn: 355128
* [Darwin][NFC] Refactor throttling of 64bit sanitizer tests on DarwinJulian Lettner2019-02-272-3/+4
| | | | | | | | | | | | | | | | | | | 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
* Revert "[compiler-rt] Intercept the bcmp() function."Vlad Tsyrklevich2019-02-261-11/+1
| | | | | | | This reverts commits r354851, 354852, 354853 and r354888. They were causing build failures on the android sanitizer bot. llvm-svn: 354906
* [compiler-rt] Intercept the bcmp() function.Clement Courbet2019-02-261-1/+11
| | | | | | | | | | | | | | | | | | | | | 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
* [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
* [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
* [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
* [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.configJulian Lettner2019-02-151-2/+0
| | | | | | | | | | | | | | | | | | | 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
* 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
* [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
* 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
* [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
* 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
* Revert little bad rebasing.David Carlier2019-01-151-1/+0
| | | | llvm-svn: 351191
* [Sanitizer] Intercept sl_add api on FreeBSD/NetBSDDavid Carlier2019-01-152-0/+27
| | | | | | | | | | Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56670 llvm-svn: 351189
* [asan] Add fallback for Thumb after r350139Diana Picus2019-01-141-1/+1
| | | | | | | | | | | | | | This reverts r350806 which marked some tests as UNSUPPORTED on ARM and instead reintroduces the old code path only for Thumb, since that seems to be the only target that broke. It would still be nice to find the root cause of the breakage, but with the branch point for LLVM 8.0 scheduled for next week it's better to put things in a stable state while we investigate. Differential Revision: https://reviews.llvm.org/D56594 llvm-svn: 351040
* [Sanitizer] Disable getusershell interception for AndroidDavid Carlier2019-01-111-1/+1
| | | | | | | | | | Reviewers: vitalybuka, pcc, eugenis Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D56583 llvm-svn: 350965
* XFAIL getusershell.cc on Android.Matt Morehouse2019-01-111-0/+2
| | | | | | Android does not implement [set|get|end]usershell(). llvm-svn: 350935
* [Sanitizer] Intercept getusershellDavid Carlier2019-01-111-0/+21
| | | | | | | | | | | | - If entries are properly copied (there were a bug in FreeBSD implementation in earlier version), or list properly reset. Reviewers: vitalybuka, krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56562 llvm-svn: 350919
* [asan] Mark tests as UNSUPPORTED on armDiana Picus2019-01-101-1/+1
| | | | | | | | | | Temporarily mark a couple of tests as UNSUPPORTED until we figure out why they fail on the thumb bots. The failure was introduced in r350139 - Add support for background thread on NetBSD in ASan. llvm-svn: 350806
* [Sanitizer] Intercept fdevname on FreeBSDDavid Carlier2019-01-081-0/+44
| | | | | | | | | | | | | - Is a file descriptor flavor FreeBSD's specific. - reentrant version included. Reviewers: vitalybuka, krytarowski, emaste Reviewed By: emaste Differential Revision: https://reviews.llvm.org/D56268 llvm-svn: 350658
* Re-disable the sanitizer_common/TestCases/Posix/getfsent.cc test. Recent ↵Kuba Mracek2019-01-031-1/+1
| | | | | | macOS versions don't have the /etc/fstab file any more so we cannot test getfsent/setfsent APIs on Darwin. llvm-svn: 350331
* [Sanitizer] Fix typo in funopen unit test.David Carlier2019-01-021-1/+1
| | | | llvm-svn: 350259
* [Sanitizer] Disable arc4random seeding apis on for Non NetBSD platforms.David Carlier2019-01-021-0/+6
| | | | | | | | | | | | - arc4random_stir / arc4random_addrandom had been made obsolete (and removed) from FreeBSD 12. Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56210 llvm-svn: 350249
* [Sanitizer] Enable funopen on FreeBSDDavid Carlier2019-01-021-0/+2
| | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56209 llvm-svn: 350248
* [sanitizer_common] Add tests for NetBSD funopen*() functionsMichal Gorny2019-01-022-0/+199
| | | | | | Differential Revision: https://reviews.llvm.org/D56154 llvm-svn: 350231
* [sanitizer_common] Add test for popen()Michal Gorny2019-01-021-0/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D56153 llvm-svn: 350230
* [sanitizer_common] Add tests for more *putc and *getc variantsMichal Gorny2019-01-023-0/+45
| | | | | | | | | | | Add tests for the more character-oriented functions, that is: - fputc(), putc() and putchar() - getc_unlocked() - putc_unlocked() and putchar_unlocked() Differential Revision: https://reviews.llvm.org/D56152 llvm-svn: 350229
* [sanitizer_common] Rewrite more Posix tests to use assertsMichal Gorny2019-01-026-46/+26
| | | | | | | | | | Rewrite the tests for Posix functions that silently 'return 1' or 'exit(1)' on error, to instead verbosely report the error using assert. This is based on requests made in review of D56136. Differential Revision: https://reviews.llvm.org/D56149 llvm-svn: 350227
* [sanitizer_common] Add tests for more stdio.h functionsMichal Gorny2019-01-022-0/+60
| | | | | | | | | | | | | | | Add two new test cases that test the following stdio.h functions: - clearerr() - feof() - ferror() - fileno() - fgetc() - getc() - ungetc() Differential Revision: https://reviews.llvm.org/D56136 llvm-svn: 350225
* Reenable hard_rss_limit_mb_test.cc for android-26Kamil Rytarowski2018-12-291-3/+0
| | | | | | Noted by eugenis@ in D55887. llvm-svn: 350140
* Add support for background thread on NetBSD in ASanKamil Rytarowski2018-12-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the point of calling MaybeStartBackgroudThread() from AsanInitInternal() that is too early on NetBSD to a constructor (with aid of C++11 lambda construct). Enable the code for background thread as is for NetBSD. Rename test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc to test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc and allow runs on NetBSD. This tests passes correctly. Reviewers: vitalybuka, joerg, eugenis Reviewed By: eugenis Subscribers: eugenis, kubamracek, fedor.sergeev, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55887 llvm-svn: 350139
* [Sanitizer] Enable getfsent api for DarwinDavid Carlier2018-12-291-1/+1
| | | | | | | | | | Reviewers: vitalybuka, kubamracek Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D56138 llvm-svn: 350138
* [Sanitizer] arc4random unit test missing case.David Carlier2018-12-281-0/+3
| | | | llvm-svn: 350124
* [Sanitizer] Intercept arc4random_buf / arc4random_addrandom on FreeBSD/NetBSDDavid Carlier2018-12-281-0/+62
| | | | | | | | | | | | | | | - Disabled on purpose on Android and Darwin platform (for now). - Darwin supports it, would need interception in its specific code before enabling it. - Linux does not support it but only via third party library. - Android supports it via bionic however it is known to have issue with older versions of the implementations. Can be enabled by an Android committer later on if necessary once there is more 'certainity'/been more tested. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56125 llvm-svn: 350123
* Enable posix regex interceptors on linux.Evgeniy Stepanov2018-12-271-1/+1
| | | | | | | | | | | | Summary: They happen to work out of the box. Reviewers: rtrieu, vitalybuka Subscribers: kubamracek, fedor.sergeev, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D56088 llvm-svn: 350103
* getfsent, unit test.David Carlier2018-12-271-0/+36
| | | | llvm-svn: 350100
* Adjust NetBSD/sha2.cc to be portable to more environmentsKamil Rytarowski2018-12-271-12/+12
| | | | | | | | | | | | | | | | Summary: By an accident part of the tests contained hardcoded checksums for external files that will differ between setups. Reviewers: mgorny Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56104 llvm-svn: 350097
* Adjust NetBSD/md2.cc to be portable to more environmentsKamil Rytarowski2018-12-271-4/+4
| | | | | | | | | | | | | | | | Summary: By an accident part of the tests contained hardcoded checksums for external files that will differ between setups. Reviewers: mgorny Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56105 llvm-svn: 350096
* Adjust NetBSD/md[45].cc to be portable to more environmentsKamil Rytarowski2018-12-272-6/+6
| | | | | | | | | | | | | | | | Summary: By an accident part of the tests contained hardcoded checksums for external files that will differ between setups. Reviewers: mgorny Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56106 llvm-svn: 350095
* [Sanitizer] Enable FTS api on FreeBSDDavid Carlier2018-12-271-0/+2
| | | | | | | | | | Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56097 llvm-svn: 350090
* [Sanitizer] Enable POSIX regex api on FreeBSD.David Carlier2018-12-221-36/+6
| | | | | | | | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56009 M lib/sanitizer_common/sanitizer_common_interceptors.inc M lib/sanitizer_common/sanitizer_platform_interceptors.h M lib/sanitizer_common/sanitizer_platform_limits_freebsd.cc M lib/sanitizer_common/sanitizer_platform_limits_freebsd.h D test/sanitizer_common/TestCases/NetBSD/regex.cc A + test/sanitizer_common/TestCases/Posix/regex.cc llvm-svn: 350002
* [Sanitizer] Move the unit test in the right place.David Carlier2018-12-211-0/+0
| | | | llvm-svn: 349917
* [Sanitizer] Enable strtonum in FreeBSDDavid Carlier2018-12-211-0/+2
| | | | | | | | | | Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55993 llvm-svn: 349916
* [CMake] Print out the list of sanitizers that the sanitizer_common tests ↵Dan Liew2018-12-211-0/+7
| | | | | | | | | | | | | | | | will run against. Summary: This is a change requested by Vitaly Buka as prerequisite to landing https://reviews.llvm.org/D55740. Reviewers: vitalybuka, kubamracek Subscribers: mgorny, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55939 llvm-svn: 349897
* [Sanitizer] Enable vis api on FreeBSDDavid Carlier2018-12-201-0/+2
| | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55923 llvm-svn: 349762
OpenPOWER on IntegriCloud