[PATCH] D40583: Defer StartBackgroundThread() and StopBackgroundThread() in TSan

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 11:38:12 PST 2017


krytarowski added a comment.

In https://reviews.llvm.org/D40583#939467, @eugenis wrote:

> Interesting. Did you see the same problem with ASan spawning its background thread (the one that does RSS limiting) too early as well? If not, then what's different between that and TSan?


Do you mean the code in sanitizer_common_libcdep.cc?

  void MaybeStartBackgroudThread() {
  #if SANITIZER_LINUX && \
      !SANITIZER_GO  // Need to implement/test on other platforms.
    // Start the background thread if one of the rss limits is given.
    if (!common_flags()->hard_rss_limit_mb &&
        !common_flags()->soft_rss_limit_mb &&
        !common_flags()->heap_profile) return;
    if (!&real_pthread_create) return;  // Can't spawn the thread anyway.
    internal_start_thread(BackgroundThread, nullptr);
  #endif
  }

It's Linux-only as of today.


Repository:
  rL LLVM

https://reviews.llvm.org/D40583





More information about the llvm-commits mailing list