[PATCH] D27179: LibFuzzer - Implement timers for Windows and improve synchronization.

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 13:47:47 PST 2016


amccarth added a comment.

I focused on the Windows-specific code, and it looks good to me as long as the signal callbacks are doing anything tricky.



================
Comment at: lib/Fuzzer/FuzzerUtilWindows.cpp:32
+
+LONG WINAPI ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo) {
   switch (ExceptionInfo->ExceptionRecord->ExceptionCode) {
----------------
Tiny little irrelevant nit:  s/WINAPI/CALLBACK/

In modern times, there is no practical distinction, as they both evaluate to __stdcall.  Technically, the exception handler is a callback rather than a Windows API.


================
Comment at: lib/Fuzzer/FuzzerUtilWindows.cpp:38
+      if (HandlerOpt.sigsegv_cb)
+        HandlerOpt.sigsegv_cb();
       break;
----------------
I'm not sure what these callbacks may be doing in lib fuzzer.  Be aware that exception handlers cannot acquire any synchronization objects and cannot allocate memory, presumably because that could cause a deadlock.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms681419(v=vs.85).aspx


Repository:
  rL LLVM

https://reviews.llvm.org/D27179





More information about the llvm-commits mailing list