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/sanitizer_common/sanitizer_stackdepot.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/sanitizer_common/sanitizer_stackdepot.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_stackdepot.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_stackdepot.cc b/lib/sanitizer_common/sanitizer_stackdepot.cc index 5b70dfcba..d4fa214dc 100644 --- a/lib/sanitizer_common/sanitizer_stackdepot.cc +++ b/lib/sanitizer_common/sanitizer_stackdepot.cc @@ -128,6 +128,14 @@ const uptr *StackDepotGet(u32 id, uptr *size) { return desc.stack; } +void StackDepotLockAll() { + theDepot.LockAll(); +} + +void StackDepotUnlockAll() { + theDepot.UnlockAll(); +} + bool StackDepotReverseMap::IdDescPair::IdComparator( const StackDepotReverseMap::IdDescPair &a, const StackDepotReverseMap::IdDescPair &b) { |