[llvm] r292746 - [libFuzzer] AlrmHandler is executed in a different thread for Windows.
Marcos Pividori via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 21 17:58:59 PST 2017
Author: mpividori
Date: Sat Jan 21 19:58:59 2017
New Revision: 292746
URL: http://llvm.org/viewvc/llvm-project?rev=292746&view=rev
Log:
[libFuzzer] AlrmHandler is executed in a different thread for Windows.
Don't check for InFuzzingThread() on Windows, since the AlarmHandler() is
always executed by a different thread from a thread pool.
If we don't add these changes, the alarm handler will never execute.
Note that we decided to ignore possible problem in the synchronization.
Differential Revision: https://reviews.llvm.org/D28723
Modified:
llvm/trunk/lib/Fuzzer/FuzzerLoop.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerLoop.cpp?rev=292746&r1=292745&r2=292746&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerLoop.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerLoop.cpp Sat Jan 21 19:58:59 2017
@@ -296,7 +296,10 @@ void Fuzzer::InterruptCallback() {
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 =
More information about the llvm-commits
mailing list