diff options
author | Evgenii Stepanov <eugenis@google.com> | 2021-08-13 17:09:10 -0700 |
---|---|---|
committer | Evgenii Stepanov <eugenis@google.com> | 2021-08-17 15:29:49 -0700 |
commit | 8a570a873b25af4c718a16caa214b4f7bc14e6d6 (patch) | |
tree | 72c6b6289780ef6fe591d68355c75cac9530cff3 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | |
parent | 4018d25da8ab7d2392ef444e1134fe262d47dad8 (diff) | |
download | llvm-8a570a873b25af4c718a16caa214b4f7bc14e6d6.zip llvm-8a570a873b25af4c718a16caa214b4f7bc14e6d6.tar.gz llvm-8a570a873b25af4c718a16caa214b4f7bc14e6d6.tar.bz2 |
[hwasan] Support malloc in atfork.
Before this change we were locking the StackDepot in the fork()
interceptor. This results in a deadlock when allocator functions are
used in a pthread_atfork() callback.
Instead, set up a pthread_atfork() callback at init that locks/unlocks
both StackDepot and the allocator. Since our callback is set up very
early, the pre-fork callback is executed late, and both post-fork ones
are executed early, which works perfect for us.
Differential Revision: https://reviews.llvm.org/D108063
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions