diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-09-04 10:36:14 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-09-04 10:36:14 +0000 |
commit | a8f5a36445cb4e264c4d650c2e40e638b1270e9a (patch) | |
tree | afbb90907969aace870eca9bf19f58962cbda4c1 /lib/msan/msan_chained_origin_depot.cc | |
parent | 3482b7ad38e8fcd0262d109c6e8c130696837972 (diff) |
[msan] Make origin tracking fork-safe.
Chained origins make plain memory stores async-signal-unsafe.
We already disable it inside signal handlers.
This change grabs all origin-related locks before fork() and releases
them after fork() to avoid a deadlock in the child process.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_chained_origin_depot.cc')
-rw-r--r-- | lib/msan/msan_chained_origin_depot.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/msan/msan_chained_origin_depot.cc b/lib/msan/msan_chained_origin_depot.cc index 8e5decd76..8bc139809 100644 --- a/lib/msan/msan_chained_origin_depot.cc +++ b/lib/msan/msan_chained_origin_depot.cc @@ -116,4 +116,12 @@ u32 ChainedOriginDepotGet(u32 id, u32 *other) { return desc.here_id; } +void ChainedOriginDepotLockAll() { + chainedOriginDepot.LockAll(); +} + +void ChainedOriginDepotUnlockAll() { + chainedOriginDepot.UnlockAll(); +} + } // namespace __msan |