[compiler-rt] c904c32 - [GWP-ASan] Fix flaky test on Fuchsia

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 09:01:07 PST 2020


Author: Kostya Kortchinsky
Date: 2020-12-02T09:00:51-08:00
New Revision: c904c32b9c9243b11ffc18e46b7350f000e9c088

URL: https://github.com/llvm/llvm-project/commit/c904c32b9c9243b11ffc18e46b7350f000e9c088
DIFF: https://github.com/llvm/llvm-project/commit/c904c32b9c9243b11ffc18e46b7350f000e9c088.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp

Removed: 
    


################################################################################
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) {


        


More information about the llvm-commits mailing list