summaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Posix
Commit message (Collapse)AuthorAgeFilesLines
* [compiler-rt][builtins][sanitizers] Update compiler-rt test cases forAmy Kwan2019-04-301-6/+8
| | | | | | | | | | | | | | | | compatibility with system's toolchain This patch aims to: - Guard ompiler-rt/test/builtins/Unit/compiler_rt_logb_test.c with macros, so the test runs on GLIBC versions >= 2.23. This is because the test relies on comparing its computed values to libm. Oolder versions might not compute to the same value as the compiler-rt value. - Update compiler-rt/test/sanitizer_common/TestCases/Posix/getpw_getgr.cc so that std::string is not used, since false positives may be detected. Differential Revision: https://reviews.llvm.org/D60644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359606 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[compiler-rt] Intercept the bcmp() function."Clement Courbet2019-03-011-1/+10
| | | | | | | Fix test issues on darwin: The REQUIRES for the test should be the same as the guard for whether we intercept bcmp. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355204 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354906 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354851 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354701 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354695 91177308-0d34-0410-b5e6-96231b3b80d8
* [LSan] Fix `__sanitizer_print_stack_trace` via fast unwinderJulian Lettner2019-02-201-1/+1
| | | | | | | | | | Summary: Quick follow-up to: https://reviews.llvm.org/D58156 Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58358 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354522 91177308-0d34-0410-b5e6-96231b3b80d8
* [LSan][Darwin][NFC] Add comment explaining test failureJulian Lettner2019-02-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354290 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354014 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353594 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Fix Android testsVitaly Buka2019-02-071-0/+2
| | | | | | On Android some fields can be null git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353377 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353366 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353351 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix sanitizer tool list used to generate sanitizer_common tests to be ↵Dan Liew2019-01-162-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351398 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert little bad rebasing.David Carlier2019-01-151-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351191 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351189 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350965 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL getusershell.cc on Android.Matt Morehouse2019-01-111-0/+2
| | | | | | Android does not implement [set|get|end]usershell(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350935 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350919 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350331 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Fix typo in funopen unit test.David Carlier2019-01-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350259 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350249 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable funopen on FreeBSDDavid Carlier2019-01-021-0/+91
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56209 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350248 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Add test for popen()Michal Gorny2019-01-021-0/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D56153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350230 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350229 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350227 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350225 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable getfsent api for DarwinDavid Carlier2018-12-291-1/+1
| | | | | | | | | | | Reviewers: vitalybuka, kubamracek Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D56138 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350138 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] arc4random unit test missing case.David Carlier2018-12-281-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350124 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350123 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350103 91177308-0d34-0410-b5e6-96231b3b80d8
* getfsent, unit test.David Carlier2018-12-271-0/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350100 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable FTS api on FreeBSDDavid Carlier2018-12-271-0/+42
| | | | | | | | | | | Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56097 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350090 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable POSIX regex api on FreeBSD.David Carlier2018-12-221-0/+71
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350002 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Move the unit test in the right place.David Carlier2018-12-211-0/+54
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@349917 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable vis api on FreeBSDDavid Carlier2018-12-201-0/+247
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55923 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@349762 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Expand FSEEK interception to FreeBSDDavid Carlier2018-12-111-0/+53
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55556 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348888 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] expand sysctl/getmntinfo/nl_langinfo to DarwinDavid Carlier2018-12-102-50/+2
| | | | | | | | | | | Reviewers: vitalybuka, krytarowski, kubamracek Reviewed By: vitalybuka, krytarowski Differential Revision: https://reviews.llvm.org/D55473 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348770 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] getmntinfo support in FreeBSDDavid Carlier2018-12-061-0/+35
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55354 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348500 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] expand nl_langinfo interception to FreeBSDDavid Carlier2018-12-051-0/+20
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55327 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348376 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix sanitizer unit testDavid Carlier2018-12-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348297 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] intercept part of sysctl ApiDavid Carlier2018-12-041-0/+112
| | | | | | | | | | | | | | - Distringuish what FreeBSD/NetBSD can and NetBSD specifics. - Fixing page size value collection. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55265 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348293 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in testsVitaly Buka2018-12-011-2/+0
| | | | | | | | | | Reviewers: eugenis, jfb Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D55152 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348061 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Adding setvbuf in supported platforms and other stream buffer ↵David Carlier2018-11-211-0/+81
| | | | | | | | | | | | | | | | | functions - Enabling setvbuf interceptions for non NetBSD platforms. - setbuf, setbuffer, setlinebuf as well. Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D54779 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347426 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Sanitizer] intercept setvbuf on other platforms where it is supported"David Carlier2018-11-201-75/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347358 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Unbreak non NetBSD builds.David Carlier2018-11-201-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347357 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] intercept setvbuf on other platforms where it is supportedDavid Carlier2018-11-201-0/+73
| | | | | | | | | | | | | Unit tests enabled only in platform tested. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski, vitalybuka Differential Revision: https://reviews.llvm.org/D54739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347355 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark breaking sanitizer_common tests on NetBSDKamil Rytarowski2018-10-302-0/+4
| | | | | | | | | | | Set XFAIL with appropriate configuration for: - NetBSD/getgroupmembership - Posix/dedup_token_length_test - Posix/readlinkat - get_module_and_offset_for_pc git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345651 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Posix/devname_r for NetBSDKamil Rytarowski2018-10-081-0/+5
| | | | | | | | | | | | | | | | | NetBSD returns a different type as a return value of devname_r(3) than FreeBSD and Darwin (int vs char*). This implies that checking for successful completion of this function has to be handled differently. This test used to work well, but was switched to fix Darwin, which broke NetBSD. Add a dedicated ifdef for NetBSD and make it functional again for this OS. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@343980 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-06-181-6/+22
| | | | | | | | | | | | | | | | | | | | | | Summary: Following up on and complementing D44404 and other sanitizer allocators. Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, no stack, no details, not too helpful nor informative. To improve the situation, detailed and structured common errors were defined and reported under the appropriate conditions. Common tests were generalized a bit to cover a slightly different TSan stack reporting format, extended to verify errno value and returned pointer value check is now explicit to facilitate debugging. Reviewers: dvyukov Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48087 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334975 91177308-0d34-0410-b5e6-96231b3b80d8