diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2021-12-20 14:03:13 +0100 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2021-12-20 18:52:48 +0100 |
commit | 2eb3e204618209a7f3bd9fa9f6e98c38984997b2 (patch) | |
tree | 8bbb9b65733814dd2b3de66cfc47fe103aa9b5ef /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | ac719d7c9ae6a20a6ae530e308331b3d51b3d70e (diff) | |
download | llvm-2eb3e204618209a7f3bd9fa9f6e98c38984997b2.zip llvm-2eb3e204618209a7f3bd9fa9f6e98c38984997b2.tar.gz llvm-2eb3e204618209a7f3bd9fa9f6e98c38984997b2.tar.bz2 |
tsan: fix deadlock during race reporting
SlotPairLocker calls SlotLock under ctx->multi_slot_mtx.
SlotLock can invoke global reset DoReset if we are out of slots/epochs.
But DoReset locks ctx->multi_slot_mtx as well, which leads to deadlock.
Resolve the deadlock by removing SlotPairLocker/multi_slot_mtx
and only lock one slot for which we will do RestoreStack.
We need to lock that slot because RestoreStack accesses the slot journal.
But it's unclear why we need to lock the current slot.
Initially I did it just to be on the safer side (but at that time
we dit not lock the second slot, so it was easy just to lock the current slot).
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D116040
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions