From 7a555958f111094df4336209fd05522d07c483b0 Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Wed, 29 Apr 2020 14:41:48 -0700 Subject: [PATCH] [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 --- compiler-rt/lib/scudo/standalone/combined.h | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h index b44753a..66638e7 100644 --- a/compiler-rt/lib/scudo/standalone/combined.h +++ b/compiler-rt/lib/scudo/standalone/combined.h @@ -721,6 +721,7 @@ public: void disableMemoryTagging() { Primary.disableMemoryTagging(); } void setTrackAllocationStacks(bool Track) { + initThreadMaybe(); Options.TrackAllocationStacks = Track; } -- 2.7.4