summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizers] Use proper substitution in common allocator test.Alex Shlyapnikov2018-06-082-8/+8
| | | | | | Use %env_tool_ops instead of %tool_options. llvm-svn: 334332
* [Sanitizers] Check alignment != 0 for aligned_alloc and posix_memalignAlex Shlyapnikov2018-06-082-0/+63
| | | | | | | | | | | | | | | Summary: Move the corresponding tests to the common folder (as all of the sanitizer allocators will support this feature soon) and add the checks specific to aligned_alloc to ASan and LSan allocators. Reviewers: vitalybuka Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47924 llvm-svn: 334316
* [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlockVitaly Buka2018-05-151-0/+34
| | | | | | | | | | Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46793 llvm-svn: 332320
* Revert "[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock"Vitaly Buka2018-05-141-34/+0
| | | | | | | | Tsan tests fail. This reverts commit r332268 llvm-svn: 332276
* [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlockVitaly Buka2018-05-141-0/+34
| | | | | | | | | | Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46793 llvm-svn: 332268
* [lsan] Try to fix test failure due to compiler optimizationPeter Wu2018-05-101-7/+4
| | | | | | | | | | | | | | Summary: The SanitizerCommon-lsan-x86_64-Linux test failed due to the address of the very first allocation ending up in the stack through "delete[]". Workaround this by performing another allocation. The issue was only present with optimization enabled, the test would pass with -O0. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46650 llvm-svn: 332020
* Add s390x to XFAIL for illegal_read/write_test.ccPetar Jovanovic2018-04-252-2/+2
| | | | | | | | | Follow up to r330840 and r330849. It seems that s390 is also not distinguishing illegal WRITE and READ memory access. Add s390x to XFAIL for the tests. llvm-svn: 330863
* Finetune supported arches for the tests added in r330840Petar Jovanovic2018-04-252-0/+2
| | | | | | | r330840 introduced two tests that may not be supported on all architectures. powerpc64 seems to be one of those. llvm-svn: 330849
* [mips] Implement GetWriteFlag() for mipsPetar Jovanovic2018-04-252-0/+27
| | | | | | | | | | | | | The read/write flag is set by manually decoding the instruction that caused the exception. It is implemented this way because the cause register which contains the needed flag was removed from the signal context structure which the user handler receives from the kernel. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D45768 llvm-svn: 330840
* [ASan] Report proper ASan error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-03-281-1/+1
| | | | | | | | | | | | | | | | | | Summary: Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, not stack, no details, not too helpful nor informative. To improve the situation, ASan detailed errors were defined and reported under the appropriate conditions. Issue: https://github.com/google/sanitizers/issues/887 Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44404 llvm-svn: 328722
* [sanitizer] Make test compatible with DarwinVitaly Buka2018-03-262-3/+3
| | | | llvm-svn: 328467
* Mmap interceptor providing mprotect supportVitaly Buka2018-03-241-2/+24
| | | | | | | | | | | | | | | | Summary: - Intercepting mprotect calls. - Fixing forgotten flag check. Patch by David CARLIER Reviewers: vitalybuka, vsk Subscribers: delcypher, srhines, kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44777 llvm-svn: 328415
* FreeBSD sanitizer common, intercept couple of more functionsVitaly Buka2018-03-238-2/+15
| | | | | | | | | | | | | | | Summary: Intercepts lstat, acct, access, faccessat and strlcpy/strlcat Patch by David CARLIER Reviewers: visa, vitalybuka Subscribers: krytarowski, fedor.sergeev, srhines, kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44432 llvm-svn: 328376
* Revert "Mmap interceptor providing mprotect support"Vitaly Buka2018-03-231-24/+2
| | | | | | | | Breaks Darwin. This reverts commit r328369. llvm-svn: 328375
* Mmap interceptor providing mprotect supportVitaly Buka2018-03-231-2/+24
| | | | | | | | | | | | | | | | | | Summary: - Intercepting mprotect calls. - Fixing forgotten flag check. Patch by David CARLIER Reviewers: vitalybuka, vsk Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44777 llvm-svn: 328369
* Mmap interceptor new option, Write Exec runtime detectorVitaly Buka2018-03-211-0/+15
| | | | | | | | | | | | | | | | | | Summary: Following-up the refactoring of mmap interceptors, adding a new common option to detect PROT_WRITE|PROT_EXEC pages request. Patch by David CARLIER Reviewers: vitalybuka, vsk Reviewed By: vitalybuka Subscribers: krytarowski, #sanitizers Differential Revision: https://reviews.llvm.org/D44194 llvm-svn: 328151
* Revert "Mmap interceptor new option, Write Exec runtime detector"Vitaly Buka2018-03-171-12/+0
| | | | | | | | Breaks Android bot. This reverts commit r327747. llvm-svn: 327762
* Mmap interceptor new option, Write Exec runtime detectorVitaly Buka2018-03-161-0/+12
| | | | | | | | | | | | | | | | Summary: Following-up the refactoring of mmap interceptors, adding a new common option to detect PROT_WRITE|PROT_EXEC pages request. Patch by David CARLIER Reviewers: vitalybuka, vsk Reviewed By: vitalybuka Subscribers: krytarowski, #sanitizers Differential Revision: https://reviews.llvm.org/D44194 llvm-svn: 327747
* Revert "Mmap interceptor new option, Write Exec runtime detector"Jonas Devlieghere2018-03-161-12/+0
| | | | | | | | | This reverts r327696 because it is failing on GreenDragon. http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/43605/ http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/10957/ llvm-svn: 327719
* Mmap interceptor new option, Write Exec runtime detectorVitaly Buka2018-03-161-0/+12
| | | | | | | | | | | | | | | | Summary: Following-up the refactoring of mmap interceptors, adding a new common option to detect PROT_WRITE|PROT_EXEC pages request. Patch by David CARLIER Reviewers: vitalybuka, vsk Reviewed By: vitalybuka Subscribers: krytarowski, #sanitizers Differential Revision: https://reviews.llvm.org/D44194 llvm-svn: 327696
* Disable tests from r326852 on DarwinAdam Nemet2018-03-072-0/+2
| | | | | | | | | | Darwin needs xlocale.h but I see no precedence in the code how non-Posix headers like this are handled and I am not experienced with this code. Just disable the tests for now to recover the bots. rdar://38208146 llvm-svn: 326874
* [sanitizer] Move strxfrm interceptors into sanitizer_commonVitaly Buka2018-03-071-0/+19
| | | | llvm-svn: 326853
* [sanitizer] Add interceptors for wcsxfrm, wcsxfrm_lVitaly Buka2018-03-071-0/+19
| | | | | | | | | | | | | | Patch by Oliver Chang Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44133 llvm-svn: 326852
* [sanitizer] Move mmap interceptors into sanitizer_commonVitaly Buka2018-03-072-0/+24
| | | | | | | | | | Reviewers: devnexen, krytarowski, eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44125 llvm-svn: 326851
* Add new interceptors: getnetent(3) familyKamil Rytarowski2018-02-271-0/+84
| | | | | | | | | | | | | | | | | | | | | Summary: getnetent, getnetbyaddr, getnetbyname - get network entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43543 llvm-svn: 326163
* Add new interceptors: getprotoent(3) familyKamil Rytarowski2018-02-271-0/+89
| | | | | | | | | | | | | | | | | | | | | Summary: getprotoent, getprotobynumber, getprotobyname - get protocol entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43541 llvm-svn: 326162
* Add new interceptors: getttyent(3) familyKamil Rytarowski2018-02-271-0/+70
| | | | | | | | | | | | | | | | | | | | | Summary: getttyent, getttynam, setttyentpath - get ttys file entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43539 llvm-svn: 326161
* Correct ctype(3) functions with NLS on NetBSDKamil Rytarowski2018-02-241-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The setlocale(3) function reloads the ctype(3) arrays from external files. This happens behind the scenes in the internals of libc (citrus library, runes functions etc). ctype(3) functions like isspace(3) can be provided with two variations on NetBSD: inlined or via a global symbol in libc: ``` #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \ !defined(__cplusplus) #include <sys/ctype_inline.h> #else #include <sys/ctype_bits.h> #endif ``` The in-lined versions are de-facto array lookup operations. ``` #define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S)) ``` After setting setlocale(3) the ctype(3) arrays (_ctype_tab_, _toupper_tab_, _tolower_tab_) are reload behind the scenes and they are required to be marked as initialized. Set them initialized inside the common setlocale(3) interceptor. The arrays are of size of 257 elements: 0..255 + 1 (EOF). This corrects errors on NetBSD/amd64 in applications prebuilt with MSan. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42020 llvm-svn: 326008
* Add new interceptor: strmode(3)Kamil Rytarowski2018-02-201-0/+20
| | | | | | | | | | | | | | | | | | | Summary: strmode - convert inode status information into a symbolic string Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43485 llvm-svn: 325588
* Add new interceptor: fgetln(3)Kamil Rytarowski2018-02-201-0/+23
| | | | | | | | | | | | | | | | | | | Summary: fgetln - get a line from a stream Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43482 llvm-svn: 325587
* Add new interceptor: lstat(2)Kamil Rytarowski2018-02-151-0/+16
| | | | | | | | | | | | | | | | | | | | | Summary: lstat - get file status Use it on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42909 llvm-svn: 325199
* [sanitizer] Fix flakiness in the testsVitaly Buka2018-02-152-7/+2
| | | | | | | Seems tests fails if link already exists. Also removed duplicated part of tests. llvm-svn: 325194
* Correct FileCheck usage in two newly added testsKamil Rytarowski2018-02-022-2/+2
| | | | llvm-svn: 324121
* Add new NetBSD interceptors: devname(3), devname_r(3)Kamil Rytarowski2018-02-022-0/+49
| | | | | | | | | | | | | | | | | | | Summary: devname, devname_r - get device name Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42053 llvm-svn: 324120
* Add new interceptors: strlcpy(3) and strlcat(3)Kamil Rytarowski2018-02-012-0/+104
| | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with strlcpy(3) and strlcat(3), a safe replacement of strcpy(3) and strcat(3). Hide both functions under SANITIZER_INTERCEPT_STRLCPY. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42061 llvm-svn: 324034
* [sanitizer] Fix array sizes used for path in testsVitaly Buka2018-02-012-17/+5
| | | | llvm-svn: 324022
* Update readlink.c and readlinkat.c to use larger buffers on Darwin.Kuba Mracek2018-02-012-5/+17
| | | | llvm-svn: 324016
* [sanitizer] Move readlinkat.c test from Linux to PosixVitaly Buka2018-01-311-0/+0
| | | | llvm-svn: 323837
* [sanitizer] Fix tests on Android and DarwinVitaly Buka2018-01-303-7/+8
| | | | llvm-svn: 323834
* [sanitizer] Add interceptors for readlinkat, name_to_handle_at, ↵Vitaly Buka2018-01-303-0/+77
| | | | | | | | | | | | | | | | | | | | | open_by_handle_at Summary: Also move existing readlink msan interceptor to sanitizer_common. Fixes google/sanitizers#908 Patch by Oliver Chang Reviewers: vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42630 llvm-svn: 323825
* Add a new interceptor: paccept(2)Kamil Rytarowski2018-01-231-0/+74
| | | | | | | | | | | | | | | | | | | Summary: paccept(2) is a NetBSD-specific variation of accept(2). Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42052 llvm-svn: 323273
* Enable sanitizer_common tests on NetBSDKamil Rytarowski2018-01-181-0/+9
| | | | | | | | | | | | | | | | | | Summary: NetBSD can handle asan, ubsan, msan, tsan tests on 64-bit and when applicable 32-bit X86 OS. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42236 llvm-svn: 322842
* Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)Kamil Rytarowski2018-01-182-0/+59
| | | | | | | | | | | | | | | | | | | Summary: getgrouplist, getgroupmembership -- calculate group access list Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42064 llvm-svn: 322836
* Add new interceptors: access(2), faccessat(2)Kamil Rytarowski2018-01-182-0/+11
| | | | | | | | | | | | | | | | | | | Summary: access, faccessat - check access permissions of a file or pathname Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42065 llvm-svn: 322831
* Add new interceptors for pwcache(3)-style functionsKamil Rytarowski2018-01-184-0/+66
| | | | | | | | | | | | | | | | | | | | | Summary: From <pwd.h>: user_from_uid, uid_from_user From <grp.h>: group_from_gid, gid_from_group Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42068 llvm-svn: 322829
* [Sanitizers] Export aligned new/delete from runtimes.Alex Shlyapnikov2017-12-231-3/+3
| | | | | | | | | | | | | | | | Summary: Export aligned new/delete to make dynamic runtimes work again. Remove all valid new/delete cases from ASan test, there's a test in common for that. Reviewers: eugenis Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41548 llvm-svn: 321394
* [Sanitizers] Disable new_delete_test.cc on Android until it's supported.Alex Shlyapnikov2017-12-221-2/+2
| | | | llvm-svn: 321374
* [MSan,TSan] Add aligned new/delete interceptors.Alex Shlyapnikov2017-12-221-0/+80
| | | | | | | | | | | | | | | Summary: Providing aligned new/delete implementations to match ASan. Unlike ASan, MSan and TSan do not perform any additional checks on overaligned memory, hence no sanitizer specific tests. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41532 llvm-svn: 321365
* [tsan] Fix sigaction implementation when it's called only to get handlerVitaly Buka2017-11-201-3/+12
| | | | | | | | | | Reviewers: eugenis Subscribers: kubamracek, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40272 llvm-svn: 318707
* [sanitizer] Relax stack check in assert.cc even moreVitaly Buka2017-11-131-1/+0
| | | | | | assert implementations can be very different llvm-svn: 318089
OpenPOWER on IntegriCloud