llvm-project/compiler-rt/lib/tsan
Kuba Brecka 11d8c1f8dd [tsan] Fix an assertion failure in FindThreadByUidLocked with recycled threads
When a race on file descriptors is detected, `FindThreadByUidLocked()` is called to retrieve ThreadContext with a specific unique_id. However, this ThreadContext might not exist in the thread registry anymore (it may have been recycled), in which case `FindThreadByUidLocked` will cause an assertion failure in `GetThreadLocked`. Adding a test case that reproduces this, producing:

    FATAL: ThreadSanitizer CHECK failed: sanitizer_common/sanitizer_thread_registry.h:92 "((tid)) < ((n_contexts_))" (0x34, 0x34)

This patch fixes this by replacing the loop with `FindThreadContextLocked`.

Differential Revision: http://reviews.llvm.org/D14984

llvm-svn: 254223
2015-11-28 09:16:34 +00:00
..
benchmarks [tsan] ThreadSanitizer tests and micro benchmarks. No makefiles yet. 2012-05-10 14:18:22 +00:00
dd [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime into a single function 2015-08-25 19:53:09 +00:00
go Reapply: [asan] On OS X, log reports to syslog and os_trace 2015-11-20 18:41:44 +00:00
rtl [tsan] Fix an assertion failure in FindThreadByUidLocked with recycled threads 2015-11-28 09:16:34 +00:00
tests [tsan] Fix CallocOverflow unit test on OS X 2015-11-24 13:27:33 +00:00
.clang-format Tell clang-format that (most) sanitizers are written using Google style guide. 2015-11-19 22:11:10 +00:00
CMakeLists.txt [tsan] Handle dispatch_once on OS X 2015-11-19 10:35:35 +00:00
Makefile.old [TSan] Attempt to fix old Makefile build. 2015-04-28 01:27:17 +00:00
analyze_libtsan.sh tsan: add interface functions for unaligned access, e.g. __sanitizer_unaligned_load16 2013-04-30 11:56:56 +00:00
check_analyze.sh [TSan] Fix custom scripts that validate TSan on non-standard buildbot. 2015-11-20 18:13:03 +00:00
check_cmake.sh tsan: use a different dir for llvm build 2014-10-15 08:56:15 +00:00
check_memcpy.sh tsan: refactor storage of meta information for heap blocks and sync objects 2014-05-29 13:50:54 +00:00