[sanitizer] Don't miss threads by ThreadSuspender
Summary: Enumerating /proc/<pid>/task/ dir Linux may stop if thread is dead. In this case we miss some alive threads and can report false memory leaks. To solve this issue we repeat enumeration if the last thread is dead. Do detect dead threads same way as proc_task_readdir we use /proc/<pid>/task/<tid>/status. Similarly it also ends enumeration of if proc_fill_cache fails, but in this case Linux sets inode to 1 (Bad block). And just in case re-list threads if we had to call internal_getdents more than twice or result takes more than half of the buffer. Reviewers: eugenis, dvyukov, glider Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D46517 llvm-svn: 331953
Loading
Please sign in to comment