[PATCH] D28723: [libFuzzer] AlrmHandler is executed in a different thread for Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 20:00:11 PST 2017


mpividori created this revision.
mpividori added reviewers: kcc, zturner.
mpividori added a subscriber: llvm-commits.
mpividori set the repository for this revision to rL LLVM.
Herald added a subscriber: aemerson.

I don't check for `InFuzzingThread()`  in Windows, since the `AlarmHandler()` is executed by a thread from a thread pool.
I continue thinking that it would be better to take the same approach for both Windows and Linux and execute that callbacks in a different thread in Linux too, instead of relying on asynchronous execution (as mentioned in https://reviews.llvm.org/D27240). We would avoid this kind of problems.
Thanks,


Repository:
  rL LLVM

https://reviews.llvm.org/D28723

Files:
  lib/Fuzzer/FuzzerLoop.cpp


Index: lib/Fuzzer/FuzzerLoop.cpp
===================================================================
--- lib/Fuzzer/FuzzerLoop.cpp
+++ lib/Fuzzer/FuzzerLoop.cpp
@@ -288,7 +288,10 @@
 NO_SANITIZE_MEMORY
 void Fuzzer::AlarmCallback() {
   assert(Options.UnitTimeoutSec > 0);
+  // In Windows Alarm callback is executed by a different thread.
+#if !LIBFUZZER_WINDOWS
   if (!InFuzzingThread()) return;
+#endif
   if (!RunningCB)
     return; // We have not started running units yet.
   size_t Seconds =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28723.84426.patch
Type: text/x-patch
Size: 501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170114/a0924ecf/attachment-0001.bin>


More information about the llvm-commits mailing list