[PATCH] D46852: [asan] Workaround to avoid hangs in Chromium tests

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 18:43:09 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL332319: [asan] Workaround to avoid hangs in Chromium tests (authored by vitalybuka, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D46852?vs=146699&id=146734#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46852

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
@@ -209,10 +209,10 @@
 
 bool ThreadSuspender::SuspendAllThreads() {
   ThreadLister thread_lister(pid_);
-  bool retry;
+  bool retry = true;
   InternalMmapVector<tid_t> threads;
   threads.reserve(128);
-  do {
+  for (int i = 0; i < 30 && retry; ++i) {
     retry = false;
     switch (thread_lister.ListThreads(&threads)) {
       case ThreadLister::Error:
@@ -227,7 +227,7 @@
     for (tid_t tid : threads)
       if (SuspendThread(tid))
         retry = true;
-  } while (retry);
+  };
   return suspended_threads_list_.ThreadCount();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46852.146734.patch
Type: text/x-patch
Size: 867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180515/ba4ab793/attachment.bin>


More information about the llvm-commits mailing list