[libFuzzer] communicate through pipe to subprocess for MinimizeCrashInput
authorYuanfang Chen <yuanfang.chen@sony.com>
Mon, 10 Feb 2020 22:31:47 +0000 (14:31 -0800)
committerYuanfang Chen <yuanfang.chen@sony.com>
Tue, 11 Feb 2020 00:45:10 +0000 (16:45 -0800)
commit85515c7fd53c0cb77ccf46eaa5246ac61ae08ee8
tree37b9edb1c61c6c5aa76531126662cbdf71841c8b
parent09d26b79d295f1d2efb94c0ebc5db9d0d881454e
[libFuzzer] communicate through pipe to subprocess for MinimizeCrashInput

For CleanseCrashInput, discards stdout output anyway since it is not used.

These changes are to defend against aggressive PID recycle on windows to reduce the chance of contention on files.

Using pipe instead of file also workaround the problem that when the
process is spawned by llvm-lit, the aborted process keeps a handle to the
output file such that the output file can not be removed. This will
cause random test failures.

https://devblogs.microsoft.com/oldnewthing/20110107-00/?p=11803

Reviewers: kcc, vitalybuka

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D73329
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
compiler-rt/lib/fuzzer/FuzzerUtil.h
compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp