[all-commits] [llvm/llvm-project] 9df7ee: [libFuzzer] Fix minimizing timeouts

Ilya Leoshkevich via All-commits all-commits at lists.llvm.org
Tue Aug 11 13:16:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9df7ee34e1b557908c125e9036ad8c54da71a4ef
      https://github.com/llvm/llvm-project/commit/9df7ee34e1b557908c125e9036ad8c54da71a4ef
  Author: Ilya Leoshkevich <iii at linux.ibm.com>
  Date:   2020-08-11 (Tue, 11 Aug 2020)

  Changed paths:
    M compiler-rt/lib/fuzzer/FuzzerDriver.cpp
    M compiler-rt/lib/fuzzer/FuzzerOptions.h
    M compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
    M compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
    M compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
    A compiler-rt/test/fuzzer/minimize_timeout.test

  Log Message:
  -----------
  [libFuzzer] Fix minimizing timeouts

When one tries to minimize timeouts using -minimize_crash=1,
minimization immediately fails. The following sequence of events is
responsible for this:

[parent] SIGALRM occurs
[parent] read() returns -EINTR (or -ERESTARTSYS according to strace)
[parent] fgets() returns NULL
[parent] ExecuteCommand() closes child's stdout and returns
[child ] SIGALRM occurs
[child ] AlarmCallback() attempts to write "ALARM: ..." to stdout
[child ] Dies with SIGPIPE without calling DumpCurrentUnit()
[parent] Does not see -exact_artifact_path and exits

When minimizing, the timer in parent is not necessary, so fix by not
setting it in this case.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D85359




More information about the All-commits mailing list