OSDN Git Service

Generate error reports when a fuzz target exits.
authorMatt Morehouse <mascasa@google.com>
Thu, 20 Jul 2017 20:43:39 +0000 (20:43 +0000)
committerMatt Morehouse <mascasa@google.com>
Thu, 20 Jul 2017 20:43:39 +0000 (20:43 +0000)
commit5187ebbe875b67efe7e7ca4dff799beec13719c0
treed26794332836b8ee2e260da5334fc4b1baf7e8bb
parentebb6c958cec89ae46443ab890c69040260e2c725
Generate error reports when a fuzz target exits.

Summary:
Implements https://github.com/google/sanitizers/issues/835.

Flush stdout before exiting in test cases.

Since the atexit hook is used for exit reports, pending prints to
stdout can be lost if they aren't flushed before calling exit().

Expect tests to have non-zero exit code if exit() is called.

Reviewers: vitalybuka, kcc

Reviewed By: kcc

Subscribers: eraman, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308669 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
lib/Fuzzer/FuzzerDriver.cpp
lib/Fuzzer/FuzzerInternal.h
lib/Fuzzer/FuzzerLoop.cpp
lib/Fuzzer/test/AbsNegAndConstant64Test.cpp
lib/Fuzzer/test/AbsNegAndConstantTest.cpp
lib/Fuzzer/test/BufferOverflowOnInput.cpp
lib/Fuzzer/test/CustomCrossOverTest.cpp
lib/Fuzzer/test/CustomMutatorTest.cpp
lib/Fuzzer/test/NthRunCrashTest.cpp
lib/Fuzzer/test/RepeatedBytesTest.cpp
lib/Fuzzer/test/SimpleDictionaryTest.cpp
lib/Fuzzer/test/SimpleTest.cpp
lib/Fuzzer/test/SimpleThreadedTest.cpp
lib/Fuzzer/test/exit-report.test [new file with mode: 0644]
lib/Fuzzer/test/fuzzer-flags.test
lib/Fuzzer/test/fuzzer-printcovpcs.test
lib/Fuzzer/test/fuzzer.test
lib/Fuzzer/test/inline-8bit-counters.test
lib/Fuzzer/test/repeated-bytes.test
lib/Fuzzer/test/trace-pc.test
lib/Fuzzer/test/ulimit.test