[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 15:03:28 PDT 2018
    
    
  
vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
Herald added a subscriber: kubamracek.
I will investigate after unblocking compiler roll.
Repository:
  rL LLVM
https://reviews.llvm.org/D46852
Files:
  compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
Index: compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+++ compiler-rt/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.146699.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180514/df120d23/attachment.bin>
    
    
More information about the llvm-commits
mailing list