From d01720d46d9456fce63f58497f56e106d2311efc Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 16 Jun 2016 00:14:42 +0000 Subject: Enable libFuzzer's afl_driver to append stderr to a file. Summary: [libFuzzer] Enable afl_driver to append stderr to a user specified file. Append stderr of afl_driver to the file specified by the environmental variable AFL_DRIVER_STDERR_DUPLICATE_FILENAME if it is set. This lets users see outputs on crashes without rerunning crashing test cases (which won't work for crashes that are difficult to reproduce). Before this patch, stderr would only be sent to afl-fuzz and users would have no way of seeing it. Reviewers: llvm-commits, aizatsky, kcc, vitalybuka Subscribers: vitalybuka Differential Revision: http://reviews.llvm.org/D21194 llvm-svn: 272858 --- llvm/lib/Fuzzer/test/AFLDriverTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 llvm/lib/Fuzzer/test/AFLDriverTest.cpp (limited to 'llvm/lib/Fuzzer/test/AFLDriverTest.cpp') diff --git a/llvm/lib/Fuzzer/test/AFLDriverTest.cpp b/llvm/lib/Fuzzer/test/AFLDriverTest.cpp new file mode 100644 index 0000000..9ae18cb --- /dev/null +++ b/llvm/lib/Fuzzer/test/AFLDriverTest.cpp @@ -0,0 +1,12 @@ +#include +#include + +extern "C" void __afl_manual_init() {} + +extern "C" int __afl_persistent_loop(unsigned int) { + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + return 0; +} -- cgit v1.1