[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
GitOrigin-RevId: 7a555958f111094df4336209fd05522d07c483b0
diff --git a/combined.h b/combined.h
index b44753a..66638e7 100644
--- a/combined.h
+++ b/combined.h
@@ -721,6 +721,7 @@
void disableMemoryTagging() { Primary.disableMemoryTagging(); }
void setTrackAllocationStacks(bool Track) {
+ initThreadMaybe();
Options.TrackAllocationStacks = Track;
}