HomePhabricator

[libFuzzer] Fix minimizing timeouts

Authored by iii on Aug 11 2020, 1:16 PM.

Description

[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

Details

Committed
iiiAug 11 2020, 1:16 PM
Reviewer
morehouse
Differential Revision
D85359: [libFuzzer] Fix minimizing timeouts
Parents
rG06d567059e5a: [InstSimplify] Respect CanUseUndef in more places
Branches
Unknown
Tags
Unknown