summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/lsan/TestCases
Commit message (Collapse)AuthorAgeFilesLines
* [LSAN] Increase stack space for guard-page.c testAlex Richardson2019-12-131-2/+2
| | | | | | | | | | | | | | | | | | Summary: When running the tests on a Ubuntu 18.04 machine this test is crashing for me inside the runtime linker. My guess is that it is trying to save more registers (possibly large vector ones) and the current stack space is not sufficient. Reviewers: samsonov, kcc, eugenis Reviewed By: eugenis Subscribers: eugenis, merge_guards_bot, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71461
* [lsan] Fix deadlock in dl_iterate_phdr.Evgeniy Stepanov2019-09-191-0/+52
| | | | | | | | | | | | | | | | | Summary: Do not grab the allocator lock before calling dl_iterate_phdr. This may cause a lock order inversion with (valid) user code that uses malloc inside a dl_iterate_phdr callback. Reviewers: vitalybuka, hctim Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67738 llvm-svn: 372348
* Commit missing part of "Split many_tls_keys.cpp into two tests"Kamil Rytarowski2019-09-152-28/+8
| | | | | | | | https://reviews.llvm.org/D67428 This change was lost due to a file rename and modification. llvm-svn: 371941
* Split many_tls_keys.cpp into two testsKamil Rytarowski2019-09-122-0/+61
| | | | | | | | | | | | | | | | | | | | | Summary: many_tls_keys_pthread.cpp for TSD many_tls_keys_thread.cpp for TLS The TSD test is unsupported on NetBSD as it assumes TLS used internally. TSD on NetBSD does not use TLS. Reviewers: joerg, vitalybuka, mgorny, dvyukov, kcc Reviewed By: vitalybuka Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67428 llvm-svn: 371757
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-111-1/+1
| | | | llvm-svn: 371687
* compiler-rt: Rename .cc file in test/lsan to .cppFangrui Song2019-08-0536-0/+0
| | | | | | Like r367463, but for test/lsan. llvm-svn: 367803
* [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*Reid Kleckner2019-06-273-0/+0
| | | | | | | | | | | | | These lit configuration files are really Python source code. Using the .py file extension helps editors and tools use the correct language mode. LLVM and Clang already use this convention for lit configuration, this change simply applies it to all of compiler-rt. Reviewers: vitalybuka, dberris Differential Revision: https://reviews.llvm.org/D63658 llvm-svn: 364591
* [TSan] Support fiber API on macOSJulian Lettner2019-04-201-6/+1
| | | | | | | | | | | | | | Committing on behalf of Yuri Per (yuri). Reviewers: dvyukov, kubamracek, yln Reviewed By: kubamracek Authored By: yuri Differential Revision: https://reviews.llvm.org/D58110 llvm-svn: 358802
* [test] Detect glibc-2.27+ and XFAIL appropriate testsMichal Gorny2019-01-091-0/+5
| | | | | | | | | | | | XFAIL the tests known to fail with glibc-2.27+. This takes away the burden of handling known failures from users, and ensures that we will be verbosely informed when they actually start working again. Bug report: https://bugs.llvm.org/show_bug.cgi?id=37804 Differential Revision: https://reviews.llvm.org/D56062 llvm-svn: 350717
* [lsan] Check that leak sanitizer works in the forked processVitaly Buka2018-08-271-0/+23
| | | | | | Regression test for PR38698 llvm-svn: 340769
* Revert "[lsan] Do not check for leaks in the forked process"Vitaly Buka2018-08-271-35/+0
| | | | | | | | Users need leak reports in forks. This reverts commit r334036. llvm-svn: 340758
* [Sanitizers] Move allocator_returns_null.cc test to common.Alex Shlyapnikov2018-06-111-133/+0
| | | | | | | | | | | | | | | | Summary: Add allocator_returns_null.cc test to sanitizer_common and remove all sanitizer-specific ones except: - HWASan is not covered by sanitizer_common - TSan allocator does not have comprehensive error reporting yet Reviewers: vitalybuka Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47971 llvm-svn: 334433
* [Sanitizers] Check alignment != 0 for aligned_alloc and posix_memalignAlex Shlyapnikov2018-06-082-47/+0
| | | | | | | | | | | | | | | 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
* [lsan] Do not check for leaks in the forked processVitaly Buka2018-06-051-0/+35
| | | | | | | | | | | | | | | | Summary: If calling process had threads then forked process will fail to detect references from them. Fixes https://github.com/google/sanitizers/issues/836 Reviewers: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47751 llvm-svn: 334036
* [LSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-06-054-12/+64
| | | | | | | | | | | | | | | | | | Summary: Following up on and complementing D44404. 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, detailed and structured errors were defined and reported under the appropriate conditions. Reviewers: eugenis Subscribers: srhines, mgorny, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D47645 llvm-svn: 334034
* [ASan] Report proper ASan error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-03-281-8/+14
| | | | | | | | | | | | | | | | | | 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
* [PowerPC] Disable failing dynamic tls test casesNemanja Ivanovic2018-03-211-1/+1
| | | | | | | Due to recent kernel upgrades, these test case fail on PowerPC buildbots. This is a known problem on affected kernels. llvm-svn: 328091
* [lsan] Respect log_path option in standalone LSanMaxim Ostapenko2018-01-221-0/+26
| | | | | | Differential Revision: https://reviews.llvm.org/D42303 llvm-svn: 323083
* [LSan] Disable a couple of failing tests on PPC64 (pending investigation).Alex Shlyapnikov2017-10-272-2/+2
| | | | llvm-svn: 316720
* [LSan] Enable LSan tests on PPC64 Linux.Alex Shlyapnikov2017-10-261-0/+5
| | | | | | | | | | | | | | | Summary: LSan is functional on PPC64 Linux now, let's enable all tests. One test required ppc specific changes: use_registers.cc. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D39316 llvm-svn: 316698
* [lsan] Add __lsan_default_optionsVitaly Buka2017-09-221-0/+11
| | | | | | For consistency with asan, msan, tsan and ubsan. llvm-svn: 314048
* Revert "Prevent DCE on __lsan_is_turned_off and re-enable test case"Francis Ricci2017-09-081-0/+2
| | | | | | | | | This doesn't fix the failing test. Leave in the comment and the attribute, since the used attribute is still required. This partially reverts commit r312824 llvm-svn: 312827
* Prevent DCE on __lsan_is_turned_off and re-enable test caseFrancis Ricci2017-09-081-3/+1
| | | | | | | | | | | | | | | Summary: -dead_strip in ld64 strips weak interface symbols, which I believe is most likely the cause of this test failure. Re-enable after marking the interface function as used. Reviewers: alekseyshl, kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37635 llvm-svn: 312824
* Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311924
* Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-1/+1
| | | | | | | The required change in clang is being reverted because of the Android build bot failure. llvm-svn: 311859
* [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311842
* [Sanitizers] LSan allocator set errno on failure.Alex Shlyapnikov2017-07-141-1/+9
| | | | | | | Set proper errno code on alloction failures and change valloc and memalign implementations to satisfy their man-specified requirements. llvm-svn: 308063
* [LSan] Make LSan allocator allocator_may_return_null compliantAlex Shlyapnikov2017-06-301-0/+123
| | | | | | | | | | | | | | | | | | Summary: An attempt to reland D34786 (which caused bot failres on Mac), now with properly intercepted operators new() and delete(). LSan allocator used to always return nullptr on too big allocation requests (the definition of "too big" depends on platform and bitness), now it follows policy configured by allocator_may_return_null flag Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34845 llvm-svn: 306845
* Revert "[LSan] Make LSan allocator allocator_may_return_null compliant"Michael Zolotukhin2017-06-291-123/+0
| | | | | | | | This reverts commit r306624. The committed test failed on various bots (e.g. on green dragon). llvm-svn: 306644
* [LSan] Make LSan allocator allocator_may_return_null compliantAlex Shlyapnikov2017-06-291-0/+123
| | | | | | | | | | | | | | | Summary: LSan allocator used to always return nullptr on too big allocation requests (the definition of "too big" depends on platform and bitness), now it follows policy configured by allocator_may_return_null flag. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34786 llvm-svn: 306624
* Add lsan interceptors for libdispatch functions on darwinFrancis Ricci2017-06-192-0/+68
| | | | | | | | | | | | | | | | | Summary: This is required for standalone LSan to work with libdispatch worker threads, and is a slimmed down version of the functionality provided for ASan in asan_mac.cc. Re-commit of r305695 with use_stacks=0 to get around a racy lingering pointer. Reviewers: alekseyshl, kubamracek, glider, kcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D34247 llvm-svn: 305732
* Revert "Add lsan interceptors for libdispatch functions on darwin"Francis Ricci2017-06-192-68/+0
| | | | | | This reverts r305695 llvm-svn: 305712
* Add lsan interceptors for libdispatch functions on darwinFrancis Ricci2017-06-192-0/+68
| | | | | | | | | | | | | | | Summary: This is required for standalone LSan to work with libdispatch worker threads, and is a slimmed down version of the functionality provided for ASan in asan_mac.cc. Reviewers: alekseyshl, kubamracek, glider, kcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D34247 llvm-svn: 305695
* [LSAN-ARM] Marking new test unsupported on ARMHF due to bot failuresRenato Golin2017-05-261-0/+3
| | | | | | | | | The test was meant for Darwin anyway, so I'm not even sure it's supposed to run on Linux. If it was, then we need time to investigate, but since the test is new, there's no point in reverting the whole patch because of it. llvm-svn: 304010
* Implement tls scanning for darwin LSanFrancis Ricci2017-05-251-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This required for any users who call exit() after creating thread-specific data, as tls destructors are only called when pthread_exit() or pthread_cancel() are used. This should also match tls behavior on linux. Getting the base address of the tls section is straightforward, as it's stored as a section offset in %gs. The size is a bit trickier to work out, as there doesn't appear to be any official documentation or source code referring to it. The size used in this patch was determined by taking the difference between the base address and the address of the subsequent memory region returned by vm_region_recurse_64, which was 1024 * sizeof(uptr) on all threads except the main thread, where it was larger. Since the section must be the same size on all of the threads, 1024 * sizeof(uptr) seemed to be a reasonable size to use, barring a more programtic way to get the size. 1024 seems like a reasonable number, given that PTHREAD_KEYS_MAX is 512 on darwin, so pthread keys will fit inside the region while leaving space for other tls data. A larger size would overflow the memory region returned by vm_region_recurse_64, and a smaller size wouldn't leave room for all the pthread keys. In addition, the stress test added here passes, which means that we are scanning at least the full set of possible pthread keys, and probably the full tls section. Reviewers: alekseyshl, kubamracek Subscribers: krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D33215 llvm-svn: 303887
* Revert "Implement tls scanning for darwin LSan"Francis Ricci2017-05-171-94/+0
| | | | | | This reverts r303262, due to TSan buildbot breakages. llvm-svn: 303266
* Implement tls scanning for darwin LSanFrancis Ricci2017-05-171-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This required for any users who call exit() after creating thread-specific data, as tls destructors are only called when pthread_exit() or pthread_cancel() are used. This should also match tls behavior on linux. Getting the base address of the tls section is straightforward, as it's stored as a section offset in %gs. The size is a bit trickier to work out, as there doesn't appear to be any official documentation or source code referring to it. The size used in this patch was determined by taking the difference between the base address and the address of the subsequent memory region returned by vm_region_recurse_64, which was 1024 * sizeof(uptr) on all threads except the main thread, where it was larger. Since the section must be the same size on all of the threads, 1024 * sizeof(uptr) seemed to be a reasonable size to use, barring a more programtic way to get the size. 1024 seems like a reasonable number, given that PTHREAD_KEYS_MAX is 512 on darwin, so pthread keys will fit inside the region while leaving space for other tls data. A larger size would overflow the memory region returned by vm_region_recurse_64, and a smaller size wouldn't leave room for all the pthread keys. In addition, the stress test added here passes, which means that we are scanning at least the full set of possible pthread keys, and probably the full tls section. Reviewers: alekseyshl, kubamracek Subscribers: krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D33215 llvm-svn: 303262
* Disable two failing darwin lsan testsFrancis Ricci2017-05-122-2/+2
| | | | | | | | These tests don't fail consistently in all cases, but they fail most of the time on the buildbots. Mark as UNSUPPORTED for now to avoid buildbots failing due to XPASS. llvm-svn: 302920
* Disable two failing darwin lsan testsFrancis Ricci2017-05-122-0/+4
| | | | | | These are causing buildbot failures, disable for now. llvm-svn: 302912
* make detect_leaks=1 the default for the lsan test suiteFrancis Ricci2017-04-2026-28/+27
| | | | | | | | | | | | | | | | | | Summary: This already appears to be the case in all .cc test files, it was probably left out of the .c test files accidentally. Make it a global default, instead of manually adding it to each individual test. This is needed to force leak detection for Darwin tests, where leak detection is disabled by default. Reviewers: m.ostapenko, kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32297 llvm-svn: 300890
* Allow for setting of global platform-specific lsan options in the test suiteFrancis Ricci2017-04-1832-70/+70
| | | | | | | | | | Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32131 llvm-svn: 300592
* Move Linux-specific lsan tests into a new directoryFrancis Ricci2017-04-1310-0/+9
| | | | | | | | | | | | | | Summary: These tests aren't supported on other platforms, move them to their own directory. Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32034 llvm-svn: 300247
* Reapply "Enable LSan for arm Linux"Maxim Ostapenko2017-04-114-5/+12
| | | | | | This patch reapplies r299923 with typo fixed in BLX macros. llvm-svn: 299948
* Revert r299923, it doesn't build in bootstrap builds.Nico Weber2017-04-114-12/+5
| | | | | | | | | | | | | | | FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ llvm-svn: 299943
* [lsan] Enable LSan for arm LinuxMaxim Ostapenko2017-04-114-5/+12
| | | | | | | | This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 llvm-svn: 299923
* Disable use_tls_dynamic on 32-bit linuxFrancis Ricci2017-03-271-0/+1
| | | | | | | | | | | | | | | Summary: This test fails with a false negative due to an unrelated change. Since we expect a number of false negatives on 32-bit lsan, disable this test on linux-i386 and linux-i686. Reviewers: kubamracek, m.ostapenko, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31300 llvm-svn: 298847
* [test] Enable the strace_test only if strace is installedMichal Gorny2017-02-081-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D29628 llvm-svn: 294425
* [lsan] Fix typo in stale_stack_leak.cc testcaseMaxim Ostapenko2017-01-311-1/+1
| | | | llvm-svn: 293644
* [lsan] Disable stale_stack_leak.cc testcase on x86Maxim Ostapenko2017-01-311-0/+3
| | | | llvm-svn: 293621
* [lsan] Renable LSan for x86 LinuxMaxim Ostapenko2017-01-3125-25/+29
| | | | | | | | | The missed clang part was committed at https://reviews.llvm.org/rL293609 thus we can reenable LSan for x86 Linux. Differential Revision: https://reviews.llvm.org/D28609 llvm-svn: 293610
OpenPOWER on IntegriCloud