[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
Loading
Please sign in to comment