summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
* Relax stack check as on some platforms demanglers failVitaly Buka2016-05-021-1/+1
| | | | | | | | | | | | | | Summary: On Windows (already fixed) and FreeBSD we have stacks traces without operator(). Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19427 llvm-svn: 268332
* Add another failing use-after-scope testVitaly Buka2016-05-021-0/+15
| | | | | | | | | | | Summary: Use after scope is not detected if array larger then 8 bytes. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19572 llvm-svn: 268330
* [sanitizer] Fix a crash in SizeClassAllocator32 with an out-of-range pointerKuba Brecka2016-05-021-0/+15
| | | | | | | | This happens on a 64-bit platform that uses SizeClassAllocator32 (e.g. ASan on AArch64). When querying a large invalid pointer, `__sanitizer_get_allocated_size(0xdeadbeefdeadbeef)`, an assertion will fail. This patch changes PointerIsMine to return false if the pointer is outside of [kSpaceBeg, kSpaceBeg + kSpaceSize). Differential Revision: http://reviews.llvm.org/D15008 llvm-svn: 268243
* [ASan] Add shadow offset for SystemZ.Marcin Koscielnicki2016-04-301-1/+1
| | | | | | | | This is the compiler-rt counterpart to D19650. Differential Revision: http://reviews.llvm.org/D19652 llvm-svn: 268162
* Finally fix invalid-pointer-pairs.cc. This time the demangle on the Windows ↵Filipe Cabecinhas2016-04-301-3/+3
| | | | | | buildbot. llvm-svn: 268160
* [tsan] Return 0 from malloc_size for non-malloc'd pointersKuba Brecka2016-04-301-11/+43
| | | | | | | | In http://reviews.llvm.org/D19100, I introduced a bug: On OS X, existing programs rely on malloc_size() to detect whether a pointer comes from heap memory (malloc_size returns non-zero) or not. We have to distinguish between a zero-sized allocation (where we need to return 1 from malloc_size, due to other binary compatibility reasons, see http://reviews.llvm.org/D19100), and pointers that are not returned from malloc at all. Differential Revision: http://reviews.llvm.org/D19653 llvm-svn: 268157
* Fix test's memory leaks.Filipe Cabecinhas2016-04-291-9/+15
| | | | llvm-svn: 268138
* Try to fix clang-cmake-aarch64-42vma by removing a memory leak (have a ↵Filipe Cabecinhas2016-04-291-1/+2
| | | | | | global var capture it). llvm-svn: 268114
* [asan] Assert in __sanitizer_ptr_{sub,cmp} if one of the pointers was freed.Filipe Cabecinhas2016-04-291-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This (partially) implements the check mentioned at http://kristerw.blogspot.co.uk/2016/04/dangling-pointers-and-undefined-behavior.html (via John Regehr) Quoting: "That the behavior is undefined follows from C11 6.2.4 "Storage durations of objects" The lifetime of an object is the portion of program execution during which storage is guaranteed to be reserved for it. An object exists, has a constant address, and retains its last-stored value throughout its lifetime. If an object is referred to outside of its lifetime, the behavior is undefined. The value of a pointer becomes indeterminate when the object it points to (or just past) reaches the end of its lifetime. and 7.22.3 "Memory management functions" that says that free ends the lifetime of objects The lifetime of an allocated object extends from the allocation until the deallocation. " We can probably implement this for stack variables too, but I think this is a good start to see if there's interest in this check. We can also hide this behind a flag, too. Reviewers: samsonov, kcc, rsmith, regehr Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D19691 llvm-svn: 268097
* [ASan] [SystemZ] Mark segv_read_write.c as UNSUPPORTED.Marcin Koscielnicki2016-04-291-1/+1
| | | | | | | | | | On s390*-linux, sigcontext just doesn't contain any information that could be used to recover the type of access, so there's no way to fix this, short of emulating the faulting instruction. Differential Revision: http://reviews.llvm.org/D19655 llvm-svn: 267960
* [test/asan] Update a test case to work with old Darwin SDK'sVedant Kumar2016-04-281-1/+1
| | | | | | | | | On Darwin, MAP_ANONYMOUS is a synonym for MAP_ANON. However, some SDK's don't define MAP_ANONYMOUS. Use MAP_ANON to work around this. (As a point of interest, the situation is exactly reversed on Linux.) llvm-svn: 267907
* Update visibility flags for CFI tests.Peter Collingbourne2016-04-281-10/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D18813 llvm-svn: 267902
* [sanitizers] read/write page fault detection on mac.Mike Aizatsky2016-04-271-0/+26
| | | | | | | | | | Summary: Resubmit of http://reviews.llvm.org/D19495 enabled only on intel. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19561 llvm-svn: 267750
* Un-XFAIL tests on Windows after fixing PR27492Reid Kleckner2016-04-272-5/+1
| | | | | | | Private symbols in PDBs do not have parameter types in their names so we have to drop the parens from the lambda call operator. llvm-svn: 267735
* [sanitizers] rewriting test assuming assert() changes coverage.Mike Aizatsky2016-04-261-19/+43
| | | | | | | | | | | | | Summary: On windows platform assert() call creates two distinct CFG edges which are coverage-instrumented. Simply calling assert would change coverage numbers on the platform. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19514 llvm-svn: 267610
* [sanitizer] [SystemZ] Add ptrace support bits.Marcin Koscielnicki2016-04-262-0/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D19134 llvm-svn: 267548
* Revert "[sanitizers] read/write page fault detection on mac."Mehdi Amini2016-04-261-0/+0
| | | | | | | | | This reverts commit r267477. It broke our bots that enables the AArch64 backends, it seems that this code is using a Darwin *X86 specific* field. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267526
* [MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.Marcin Koscielnicki2016-04-251-5/+0
| | | | | | | | | | | This fixes fails in test/msan/dlerror.cc - when real dlerror calls strcmp, our strcmp interceptor now skips poison checking, since it's called in interceptor context. Strictly speaking, only the dlerror change is necessary to fix the fail, but let's also change the other two just in case. Differential Revision: http://reviews.llvm.org/D19499 llvm-svn: 267486
* [sanitizers] read/write page fault detection on mac.Mike Aizatsky2016-04-251-0/+0
| | | | | | | | Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19495 llvm-svn: 267477
* [esan] EfficiencySanitizer libc interceptorsDerek Bruening2016-04-232-2/+20
| | | | | | | | | | | | | | | | Summary: Adds libc interceptors to the runtime library for the new EfficiencySanitizer ("esan") family of tools. The interceptors cover the memory operations in most common library calls and will be shared among all esan tools. Reviewers: aizatsky Subscribers: zhaoqin, tberghammer, danalbert, srhines, llvm-commits, vitalybuka, eugenis, kcc Differential Revision: http://reviews.llvm.org/D19411 llvm-svn: 267293
* [asan] Disable one test on windows.Evgeniy Stepanov2016-04-221-0/+1
| | | | | | Patch by Vitaly Buka. llvm-svn: 267088
* Enable stack-use-after-scope tests.Evgeniy Stepanov2016-04-2210-32/+93
| | | | | | | | | | | Fix and enable working stack-use-after-scope tests. Add more failing tests for the feature, for fix later. PR27453. Patch by Vitaly Buka. llvm-svn: 267084
* [esan] EfficiencySanitizer base runtime libraryDerek Bruening2016-04-215-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the initial version of a runtime library for the new EfficiencySanitizer ("esan") family of tools. The library includes: + Slowpath code via callouts from the compiler instrumentation for each memory access. + Registration of atexit() to call finalization code. + Runtime option flags controlled by the environment variable ESAN_OPTIONS. The common sanitizer flags are supported such as verbosity and log_path. + An initial simple test. Still TODO: common code for libc interceptors and shadow memory mapping, and tool-specific code for shadow state updating. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19168 llvm-svn: 267060
* [asan] Mark strdup test as unsupported on arm/linux.Evgeniy Stepanov2016-04-211-0/+3
| | | | llvm-svn: 267028
* [tsan] Rename ReportThread->pid to ReportThread->os_idKuba Brecka2016-04-211-4/+4
| | | | | | | | The field "pid" in ReportThread is used to store the OS-provided thread ID (pthread_self or gettid). The name "pid" suggests it's a process ID, which it isn't. Let's rename it. Differential Revision: http://reviews.llvm.org/D19365 llvm-svn: 266994
* [asan] Add __strdup interceptor.Evgeniy Stepanov2016-04-201-1/+5
| | | | | | This happens on Linux when building as C (not C++) with optimization. llvm-svn: 266931
* [compiler-rt] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang2016-04-192-2/+2
| | | | | | | | | | | | | | | Summary: Removed unwanted --check-prefix=CHECK from the following unit tests: test/asan/TestCases/Posix/start-deactivated.cc test/tsan/Darwin/ignored-interceptors.mm Patch by: Mandeep Singh Grang (mgrang) Reviewers: samsonov, kcc, dvyukov, eugenis Differential Revision: http://reviews.llvm.org/D19281 llvm-svn: 266813
* Additional test for use-after-scopeKostya Serebryany2016-04-181-0/+14
| | | | | | | | | | | | Summary: Test that asan detects access to the dead variable captured by lambda. Reviewers: aizatsky, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19238 llvm-svn: 266676
* Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov2016-04-1615-24/+18
| | | | | | | | | | | | At the moment almost every lit.site.cfg.in contains two lines comment: ## Autogenerated by LLVM/Clang configuration. # Do not edit! The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information. llvm-svn: 266520
* [TSAN] Make tsan tests more portable (take 3)Renato Golin2016-04-1551-73/+73
| | | | | | | | Some tests didn't merge stderr with stdout. Patch by Maxim Kuvyrkov. llvm-svn: 266426
* Revert "Make tsan tests more portable (take 2)"Renato Golin2016-04-1451-63/+63
| | | | | | This reverts commit r266294, as it broke some buildbots again. :/ llvm-svn: 266300
* Make tsan tests more portable (take 2)Renato Golin2016-04-1451-63/+63
| | | | | | | | | Using stderr more uniformily, avoiding potential races when scanning stdout and stderr output. Patch by Maxim Kuvyrkov. llvm-svn: 266294
* [tsan] Fix size reporting for OS X zone allocator with 0-sized allocationsKuba Brecka2016-04-141-0/+23
| | | | | | | | The custom zone implementation for OS X must not return 0 (even for 0-sized allocations). Returning 0 indicates that the pointer doesn't belong to the zone. This can break existing applications. The underlaying allocator allocates 1 byte for 0-sized allocations anyway, so returning 1 in this case is okay. Differential Revision: http://reviews.llvm.org/D19100 llvm-svn: 266283
* [asan] Prefer alloc-dealloc-mismatch to new-delete-type-mismatch.Evgeniy Stepanov2016-04-131-0/+16
| | | | | | | | With -fsized-deallocation, new[] vs delete mismatch is reported as new-delete-type-mismatch. This is technically true, but alloc-dealloc-mismatch describes it better. llvm-svn: 266246
* [PGO] Fix the buildbots for r266229. Betul Buyukkurt2016-04-131-2/+11
| | | | llvm-svn: 266240
* [safestack] Fix stack canary test on Mac.Evgeniy Stepanov2016-04-121-2/+2
| | | | | | | Disable FORTIFY_SOURCE and explicitly disable stack protector in the no-stack-protector run. llvm-svn: 266106
* [safestack] A test for stackprotector canaries.Evgeniy Stepanov2016-04-111-0/+37
| | | | llvm-svn: 266006
* [tsan] Replace 'not' with '%deflake' in gcd-apply-race.mm Darwin test.Kuba Brecka2016-04-111-1/+1
| | | | llvm-svn: 265919
* [sanitizer] Fix sem_init_glibc.cc test on __HAVE_64B_ATOMIC arches.Evgeniy Stepanov2016-04-071-4/+15
| | | | | | | | | | | | | | | | | | | | | glibc can use one of 2 layouts for semaphores: architectures that don't HAVE_64B_ATOMIC use an uint32_t field with semaphore value, then a private field, then a waiting thread count field - this is the layout currently assumed by the test. However, HAVE_64B_ATOMIC arches use a fused uint64_t field that contains the value in low bits and waiting thread count in high bits, followed by a private field. This resulted in taking private field from the wrong offset on 64-bit atomic platforms (the test still passed, but didn't actually test the private field). On big-endian platforms, this resulted in a fail, since the first 4 bytes overlay the thread count field, and not the value field. Found while porting ASan to s390x. Patch by Marcin Kościelnicki. llvm-svn: 265715
* [sancov] updaing android test after enabling cc edge pruningMike Aizatsky2016-04-071-1/+1
| | | | llvm-svn: 265714
* [sancov] updaing android testMike Aizatsky2016-04-071-1/+1
| | | | llvm-svn: 265692
* [tsan] Remove long sleeps from fork testsKuba Brecka2016-04-072-10/+2
| | | | | | | | On one of our testing machines, we're running the tests under heavy load, and especially in the fork-based TSan tests, we're seeing timeouts when a test uses sleep(10), assuming that calling fork() on another thread will finish sooner than that. This patch removes a timeout and makes another one longer. Differential Revision: http://reviews.llvm.org/D18476 llvm-svn: 265666
* [tsan] Add support for OS X OSAtomic* functionsKuba Brecka2016-04-072-0/+91
| | | | | | | | OS X provides atomic functions in libkern/OSAtomic.h. These provide atomic guarantees and they have alternatives which have barrier semantics. This patch adds proper TSan support for the functions from libkern/OSAtomic.h. Differential Revision: http://reviews.llvm.org/D18500 llvm-svn: 265665
* [tsan] Add interceptors for dispatch_applyKuba Brecka2016-04-072-0/+70
| | | | | | | | Adding an interceptor with two more release+acquire pairs to avoid false positives with dispatch_apply. Differential Revision: http://reviews.llvm.org/D18722 llvm-svn: 265662
* [tsan] Add XPC support (OS X)Kuba Brecka2016-04-072-0/+153
| | | | | | | | XPC APIs have async callbacks, and we need some more happen-before edges to avoid false positives. This patch add them, plus a test case (sorry for the long boilerplate code, but XPC just needs all that). Differential Revision: http://reviews.llvm.org/D18493 llvm-svn: 265661
* [tsan] Add support for dispatch event sourcesKuba Brecka2016-04-076-0/+214
| | | | | | | | GCD has APIs for event sources, we need some more release-acquire pairs to avoid false positives in TSan. Differential Revision: http://reviews.llvm.org/D18515 llvm-svn: 265660
* [tsan] Fix synchronization in dispatch_syncKuba Brecka2016-04-071-0/+34
| | | | | | | | In the interceptor for dispatch_sync, we're currently missing synchronization between the callback and the code *after* the call to dispatch_sync. This patch fixes this by adding an extra release+acquire pair to dispatch_sync() and similar APIs. Added a testcase. Differential Revision: http://reviews.llvm.org/D18502 llvm-svn: 265659
* [tsan] Fix Darwin tests (missing FileCheck's)Kuba Brecka2016-04-0711-16/+16
| | | | | | | | A little embarrassing, but we're missing the call to FileCheck in several Darwin tests. Let's fix this. Differential Revision: http://reviews.llvm.org/D18503 llvm-svn: 265658
* [sancov] removing flaky test case (win)Mike Aizatsky2016-04-071-8/+1
| | | | llvm-svn: 265627
* [sancov] enabling coverage edge pruning by default.Mike Aizatsky2016-04-065-12/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D18845 llvm-svn: 265614
OpenPOWER on IntegriCloud