[asan] Remove confusing workaround
authorVitaly Buka <vitalybuka@google.com>
Thu, 2 Dec 2021 08:53:02 +0000 (00:53 -0800)
committerVitaly Buka <vitalybuka@google.com>
Thu, 2 Dec 2021 19:44:40 +0000 (11:44 -0800)
The goal is to identify the bot and try to fix it.

SetSoftRssLimitExceededCallback is AsanInitInternal as I assume
that only MaybeStartBackgroudThread needs to be delayed to constructors.
Later I want to move MaybeStartBackgroudThread call into sanitizer_common.

If it needs to be reverted please provide to more info, like bot, or details about setup.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D114934

compiler-rt/lib/asan/asan_rtl.cpp

index 5be8ef0..eb60661 100644 (file)
@@ -371,18 +371,10 @@ void PrintAddressSpaceLayout() {
           kHighShadowBeg > kMidMemEnd);
 }
 
-#if defined(__thumb__) && defined(__linux__)
-#define START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
-#endif
-
-#ifndef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
 static bool UNUSED __local_asan_dyninit = [] {
   MaybeStartBackgroudThread();
-  SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
-
   return false;
 }();
-#endif
 
 static void AsanInitInternal() {
   if (LIKELY(asan_inited)) return;
@@ -458,10 +450,7 @@ static void AsanInitInternal() {
   allocator_options.SetFrom(flags(), common_flags());
   InitializeAllocator(allocator_options);
 
-#ifdef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
-  MaybeStartBackgroudThread();
   SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
-#endif
 
   // On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
   // should be set to 1 prior to initializing the threads.