[PATCH] D46517: [sanitizer] Don't miss threads by ThreadSuspender

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 11:46:02 PDT 2018


eugenis added a comment.

Nice!



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_file.cc:169
+  return true;
+}
+
----------------
I don't like this code duplication at all.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:954
   }
-  return true;
+}
+
----------------
Would it be better to resize the buffer and start from scratch until we get the entire directory in one go? Otherwise we can still miss a thread that was added before the current directory cursor, I guess - or is that impossible?


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:222
+      case ThreadLister::Incomplete:
         added_threads = true;
+        break;
----------------
Is this because you want to suspend threads even when you've got an incomplete response? If would be cleaner to just loop while(Incomplete) ListThreads() and then handle the other two return codes.


Repository:
  rL LLVM

https://reviews.llvm.org/D46517





More information about the llvm-commits mailing list