[compiler-rt] 7a55595 - [scudo] Initialize the allocator in setTrackAllocationStacks.
Evgenii Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 17:10:08 PDT 2020
Author: Evgenii Stepanov
Date: 2020-04-29T17:01:58-07:00
New Revision: 7a555958f111094df4336209fd05522d07c483b0
URL: https://github.com/llvm/llvm-project/commit/7a555958f111094df4336209fd05522d07c483b0
DIFF: https://github.com/llvm/llvm-project/commit/7a555958f111094df4336209fd05522d07c483b0.diff
LOG: [scudo] Initialize the allocator in setTrackAllocationStacks.
Summary:
If this is called before the malloc call in a thread (or in the whole
program), the lazy initialization of the allocation can overwrite
Options.
Reviewers: pcc, cryptoad
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D79130
Added:
Modified:
compiler-rt/lib/scudo/standalone/combined.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h
index b44753a4373a..66638e7dd5db 100644
--- a/compiler-rt/lib/scudo/standalone/combined.h
+++ b/compiler-rt/lib/scudo/standalone/combined.h
@@ -721,6 +721,7 @@ class Allocator {
void disableMemoryTagging() { Primary.disableMemoryTagging(); }
void setTrackAllocationStacks(bool Track) {
+ initThreadMaybe();
Options.TrackAllocationStacks = Track;
}
More information about the llvm-commits
mailing list