diff options
author | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:58:59 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:58:59 +0000 |
commit | 15fbf682a1f4c1c18dcbd5f7e23b07124b15613d (patch) | |
tree | 2a73c284e195b3f075864652bc07beafc4e9f5b0 /llvm/lib/Fuzzer/FuzzerLoop.cpp | |
parent | 5bd35b4d3d448ef67810b60fa6543731c2f6dc17 (diff) | |
download | bcm5719-llvm-15fbf682a1f4c1c18dcbd5f7e23b07124b15613d.tar.gz bcm5719-llvm-15fbf682a1f4c1c18dcbd5f7e23b07124b15613d.zip |
[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
llvm-svn: 292746
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index 63dd7315572..861ab13e686 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -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 = |