From 54a8456005fd4e1a0fbc660bf39d3e9f8201e1c5 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Thu, 9 Nov 2017 21:30:33 +0000 Subject: [PATCH] [libFuzzer] make sure to flush IO when done merging one file llvm-svn: 317835 --- compiler-rt/lib/fuzzer/FuzzerMerge.cpp | 1 + compiler-rt/test/fuzzer/sigusr.test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/fuzzer/FuzzerMerge.cpp b/compiler-rt/lib/fuzzer/FuzzerMerge.cpp index 59e34cf..9b21a09 100644 --- a/compiler-rt/lib/fuzzer/FuzzerMerge.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerMerge.cpp @@ -254,6 +254,7 @@ void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) { for (size_t F : UniqFeatures) OF << " " << std::hex << F; OF << "\n"; + OF.flush(); } } diff --git a/compiler-rt/test/fuzzer/sigusr.test b/compiler-rt/test/fuzzer/sigusr.test index fce244f..0c1ec4d 100644 --- a/compiler-rt/test/fuzzer/sigusr.test +++ b/compiler-rt/test/fuzzer/sigusr.test @@ -23,7 +23,7 @@ RUN: killall -SIGUSR2 %t/LFSIGUSR RUN: cat %t/log | FileCheck %s RUN: grep C2/g %t/MCF RUN: grep STARTED %t/MCF -RUN: grep DONE %t/MCF +RUN: tail -n 1 %t/MCF | grep DONE CHECK: INFO: signal received, trying to exit gracefully CHECK: INFO: libFuzzer: exiting as requested -- 2.7.4