[PATCH] D27240: [libFuzzer] Diff 8 - Improve synchronization.

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 09:24:45 PST 2016


zturner added a comment.

It seems to me like the motivation for this change is that timers on Windows have their callback executed in an arbitrary thread context.  If we could fix that -- force the timer to execute its callback in the main thread -- then this problem would go away.  Is that right?  All other signals (posix) and exceptions (windows) happen on the main thread already, so those are not the problem, only the timer, and only on Windows.

So would it be possible to just implement the timer logic in the main fuzzer loop?  Use `std::chrono::high_resolution_clock` for example.  We wouldn't need to treat the callback specially either, when it fired you could use the Win32 API `RaiseException` which would still trigger the handler you've installed via `AddVectoredExceptionHandler`.

Thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D27240





More information about the llvm-commits mailing list