Skip to content

Commit

Permalink
[libFuzzer] AlrmHandler is executed in a different thread for Windows.
Browse files Browse the repository at this point in the history
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

llvm-svn: 292746
  • Loading branch information
Marcos Pividori committed Jan 22, 2017
1 parent 5bd35b4 commit 15fbf68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Fuzzer/FuzzerLoop.cpp
Expand Up @@ -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 =
Expand Down

0 comments on commit 15fbf68

Please sign in to comment.