2 Commits

Author SHA1 Message Date
Alexey Baturo
847fa84b3d [RISC-V][HWASAN] Adjust lit test support for RISC-V HWASAN feature
Reviewed by: vitalybuka

Differential Revision: https://reviews.llvm.org/D131344
2022-12-14 16:13:55 +03:00
Evgenii Stepanov
8a570a873b [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
2021-08-17 15:29:49 -07:00