summaryrefslogtreecommitdiff
path: root/test/lsan/TestCases
AgeCommit message (Collapse)Author
2016-03-03[LSan] Enable use_registers test for MIPSMohit K. Bhakkad
Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17797 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11[LSan] Test case fix: mode debug output, synchronization instead of sleep().Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260564 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11[LSan] Fix a crash when LSan hits a guard page while scanning thread stack ↵Alexey Samsonov
for pointers. Summary: In some cases stack pointer register (SP) doesn't point into the thread stack: e.g. if one is using swapcontext(). In this case LSan conservatively tries to scan the whole thread stack for pointers. However, thread stack (at least in glibc implementation) may also include guard pages, causing LSan to crash when it's reading from them. One of the solutions is to use a pthread_attr_getguardsize() to adjust the calculated stack boundaries. However, here we're just using IsAccessibleMemoryRange to skip guard pages and make the code (slightly) less platform-specific. Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17116 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16[LSan] Ignore all allocations made inside pthread_create.Alexey Samsonov
Thread stack/TLS may be stored by libpthread for future reuse after thread destruction, and the linked list it's stored in doesn't even hold valid pointers to the objects, the latter are calculated by obscure pointer arithmetic. With this change applied, LSan test suite passes with "use_ld_allocations" flag defaulted to "false". It still requires more testing to check if the default can be switched. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[LSan] Add "use_ld_allocations" flag to disable old way of DTLS handling.Alexey Samsonov
This flag allows to disable old way of determining dynamic TLS by filtering out allocations from dynamic linker. This will be eventually superseded by __tls_get_addr interceptor (see r257785), after we: 1) Test it in several supported environments 2) Deal with existing problems (currently we can't find a pointer to DTV which is calloc()-ed in pthread_create). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-19[LSan] Fix tests with some libstdc++ implementations.Alexey Samsonov
Summary: Newer libstdc++ has global pool, which is filled with objects allocated during libstdc++ initialization, and never released. Using use_globals=0 in the lit tests results in these objects being treated as leaks. Fix this by porting several tests to plain C, and introducing a simple sanity test case for __lsan::ScopedDisabler. Reviewers: kcc, ygribov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14798 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253576 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17[Sanitizer] Teach ReadFileToBuffer to distinguish empty file from ↵Alexey Samsonov
inaccessible file. Summary: This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=399 (sanitizers crash with empty suppression files). Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11284 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242594 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24[lsan] Add an interface function for on-demand leak checking.Sergey Matveev
Summary: Add an interface function which can be used to periodically trigger leak detection in a long-running process. NB: The meaning of the kIgnored tag has been changed to allow easy clean-up between subsequent leak checks. Previously, this tag was applied to explicitly ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any chunks only reachable from those. With this change, it's only applied to explicitly ignored chunks. Reviewers: samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9159 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@235728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Flag parser rewrite.Evgeniy Stepanov
The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[lsan] Fix a typo in a test.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226168 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-19[lsan] Add debug output to leak_check_before_thread_started.cc.Sergey Matveev
Trying to investigate why this test is flaky. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-18Fix suppressions file usageFilipe Cabecinhas
Summary: Always quote suppressions files given to *_OPTIONS. This will make it not break when given full Windows paths (otherwise, parsing would stop after the drive's letter + ':'). Also fix one or two cases where the suppression files' extensions were not *.supp. Reviewers: samsonov, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6680 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224529 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[LSan] Rewrite the test from r223419 to not use C++11.Sergey Matveev
This was causing build failures on llvm-clang-lld-x86_64-centos-6.5 for some reason. Anyway, the new way is better because we no longer rely on std::thread implementation details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223480 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[ASan, LSan] Improve tracking of thread creation.Sergey Matveev
In the current scheme of things, the call to ThreadStart() in the child thread is not synchronized with the parent thread. So, if a pointer is passed to pthread_create, there may be a window of time during which this pointer will not be discoverable by LSan. I.e. the pthread_create interceptor has already returneed and thus the pointer is no longer on the parent stack, but we don't yet know the location of the child stack. This has caused bogus leak reports (see http://llvm.org/bugs/show_bug.cgi?id=21621/). This patch makes the pthread_create interceptor wait until the child thread is properly registered before returning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[asan] Fix stale_stack_leak.cc test in ASan-UAR mode.Evgeniy Stepanov
This test does an intentional use-after-return, but this is not the focus of the test, so ignore it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18[LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined withAlexey Samsonov
another sanitizer. A user may run both LSan and LSan+ASan. It is weird to pass path to leak suppression file (or other common sanitizer flags, like "verbosity") in "LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215949 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30[Sanitizer] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214343 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25[lsan] Follow-up for r213518: replace MAP_ANONYMOUS with MAP_ANONAlexander Potapenko
(despite it's deprecated on Linux) to remove the ifdefs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213929 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-21[lsan] Allow using ucontext.h in the test on OSX.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213523 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-21[lsan] Define MAP_ANONYMOUS as MAP_ANON for OSX in the test.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-21[lsan] Use a more standard-conformant sched_yield() instead of pthread_yield().Alexander Potapenko
There's no pthread_yield() on OSX (only sched_yield() and pthread_yield_np()). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30Add %run to all lit testsGreg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move LSan test suite under test/Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201408 91177308-0d34-0410-b5e6-96231b3b80d8