summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan/lsan_thread.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/lsan to .cppNico Weber2019-08-011-162/+0
| | | | | | Like r367463, but for lsan. llvm-svn: 367561
* sanitizers: Introduce ThreadType enumDmitry Vyukov2019-02-071-2/+2
| | | | | | | | | | | | | Replace bool workerthread flag with ThreadType enum. This change is preparation for fiber support. [dvyukov: fixed build of sanitizer_thread_registry_test.cc] Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57839 Context: https://reviews.llvm.org/D54889 llvm-svn: 353390
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [lsan] Report unsuspended threadsVitaly Buka2018-05-091-0/+5
| | | | | | | | | | | | | | | Summary: Leak checker needs to suspend all process threads. If we have some running thread in registry but not suspended we can have false leak report. So we will report this case here for future debugging. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46663 llvm-svn: 331936
* Add lsan interceptors for libdispatch functions on darwinFrancis Ricci2017-06-191-2/+2
| | | | | | | | | | | | | | | | | 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-191-2/+2
| | | | | | This reverts r305695 llvm-svn: 305712
* Add lsan interceptors for libdispatch functions on darwinFrancis Ricci2017-06-191-2/+2
| | | | | | | | | | | | | | | 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
* [sanitizer] Introduce tid_t as a typedef for OS-provided thread IDsKuba Mracek2017-04-171-3/+3
| | | | | | | | We seem to assume that OS-provided thread IDs are either uptr or int, neither of which is true on Darwin. This introduces a tid_t type, which holds a OS-provided thread ID (gettid on Linux, pthread_threadid_np on Darwin, pthread_self on FreeBSD). Differential Revision: https://reviews.llvm.org/D31774 llvm-svn: 300473
* Don't delete lsan thread-local data until it's no longer requiredFrancis Ricci2017-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: The routines for thread destruction in the thread registry require the lsan thread index, which is stored in pthread tls on OS X. This means that we need to make sure that the lsan tls isn't destroyed until after the thread registry tls. This change ensures that we don't delete the lsan tls until we've finished destroying the thread in the registry, ensuring that the destructor for the lsan tls runs after the destructor for the thread registry tls. This patch also adds a check to ensure that the thread ID is valid before returning it in GetThreadID(), to ensure that the above behavior is working correctly. Reviewers: dvyukov, kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31884 llvm-svn: 299978
* Fix build breakage from moving kInvalidTid to lsan_commonFrancis Ricci2017-02-171-0/+1
| | | | llvm-svn: 295409
* Use pthreads to store current thread id on darwinFrancis Ricci2017-02-171-11/+0
| | | | | | | | | | | | | | Summary: __thread is not supported by all darwin versions and architectures, use pthreads instead to allow for building darwin lsan on iossim. Reviewers: kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29993 llvm-svn: 295405
* [tsan] Properly describe GCD worker threads in reportsKuba Mracek2017-02-021-1/+1
| | | | | | | | When dealing with GCD worker threads, TSan currently prints weird things like "created by thread T-1" and "[failed to restore the stack]" in reports. This patch avoids that and instead prints "Thread T3 (...) is a GCD worker thread". Differential Revision: https://reviews.llvm.org/D29103 llvm-svn: 293882
* [compiler-rt][lsan] Fix compiler error due to attribute (windows)Etienne Bergeron2016-09-231-1/+1
| | | | | | | | | | | | | | | | Summary: Window compiler is stricter for attributes location. This patch fixes a compilation error. ``` D:\src\llvm\llvm\projects\compiler-rt\lib\lsan\lsan_thread.cc(39): error C2144: syntax error: 'int' should be preceded by ';' ``` Reviewers: rnk, majnemer Subscribers: majnemer, llvm-commits, chrisha, dberris Differential Revision: https://reviews.llvm.org/D24810 llvm-svn: 282254
* [LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.Alexey Samsonov2016-01-141-9/+16
| | | | | | | | | | | | | | | | | | | | Summary: We have a way to keep track of allocated DTLS segments: let's use it in LSan. Although this code is fragile and relies on glibc implementation details, in some cases it proves to be better than existing way of tracking DTLS in LSan: marking as "reachable" all memory chunks allocated directly by "ld". The plan is to eventually get rid of the latter, once we are sure it's safe to remove. Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16164 llvm-svn: 257785
* [compiler-rt] Apply modernize-use-nullptr fixes in sanitizersVedant Kumar2015-10-011-5/+5
| | | | | | | | | | | | | | | | | | - Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. - Add blank lines to separate function definitions. - Add 'extern "C"' or 'namespace foo' comments after the appropriate closing brackets This is a continuation of work from 409b7b82. The focus here is on the various sanitizers (not sanitizer_common, as before). Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13225 llvm-svn: 248966
* [lsan] Support ASan's stack-use-after-return mode in LSan.Sergey Matveev2013-10-141-0/+4
| | | | | | Treat the fake stack as live memory. llvm-svn: 192593
* [lsan] Handle fork() correctly.Sergey Matveev2013-07-081-0/+5
| | | | | | | | Update the main thread's os_id on every pthread_create, and before initiating leak checking. This ensures that we have the correct os_id even if we have forked after Init(). llvm-svn: 185815
* [sanitizer] Move FindThreadByOSIdLocked from lsan to sanitizer_common.Sergey Matveev2013-05-271-15/+3
| | | | llvm-svn: 182728
* [lsan] Thread registry for standalone LSan.Sergey Matveev2013-05-201-0/+163
llvm-svn: 182246
OpenPOWER on IntegriCloud