From c904c32b9c9243b11ffc18e46b7350f000e9c088 Mon Sep 17 00:00:00 2001 From: Kostya Kortchinsky Date: Tue, 1 Dec 2020 11:46:23 -0800 Subject: [PATCH] [GWP-ASan] Fix flaky test on Fuchsia The LateInit test might be reusing some already initialized thread specific data if run within the main thread. This means that there is a chance that the current value will not be enough for the 100 iterations, hence the test flaking. Fix this by making the test run in its own thread. Differential Revision: https://reviews.llvm.org/D92415 --- compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index a895032c7c8f..13888cbbe3c3 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -148,6 +148,7 @@ void GuardedPoolAllocator::uninitTestOnly() { State.PageSize)); FreeSlots = nullptr; } + *getThreadLocals() = ThreadLocalPackedVariables(); } void *GuardedPoolAllocator::allocate(size_t Size) {