We need something to keep arg and retval pointers for leak checking.
Pointers should keept alive even after thread exited, until the thread
is detached or joined.
We should not put this logic into ThreadRegistry as we need the the
same for the ThreadList of HWASAN.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@dvyukov ThreadArgRetval::Join is alternative to ThreadRegistry::ConsumeThreadUserId+ThreadRegistry::SetThreadUserId
BTW. I tried to extend ThreadRegistry::live_ but it didn't look good.
Also we need these functionality for HWASAN without Registry anyway.
We could make ThreadArgRetval track pthread -> Tids mapping as well.
However live_ is tsan only and ThreadArgRetval is asan/lsan/hwasan only, so I decided to keep them separated for now.
compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.cpp | ||
---|---|---|
21 | call CheckLocked(); in CreateLocked ? | |
66 | typo: Thread | |
compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.h | ||
55 | Please keep singular and plural consistent, "Mark", "stores" | |
69 | typo: thread | |
compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_arg_retval_test.cpp | ||
122 | typo: thread |
compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.h | ||
---|---|---|
88 | isn't that already done, in the form of Lock/Unlock? |
Please keep singular and plural consistent, "Mark", "stores"