[compiler-rt] r358726 - [libFuzzer] in fork mode, make sure the child stats are always collected. This should fix the flakiness in fork-ubsan.test

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 18:39:14 PDT 2019


Author: kcc
Date: Thu Apr 18 18:39:14 2019
New Revision: 358726

URL: http://llvm.org/viewvc/llvm-project?rev=358726&view=rev
Log:
[libFuzzer] in fork mode, make sure the child stats are always collected. This should fix the flakiness in fork-ubsan.test

Modified:
    compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
    compiler-rt/trunk/lib/fuzzer/FuzzerFork.cpp

Modified: compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/CMakeLists.txt?rev=358726&r1=358725&r2=358726&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/fuzzer/CMakeLists.txt Thu Apr 18 18:39:14 2019
@@ -66,6 +66,7 @@ elseif(TARGET cxx-headers OR HAVE_LIBCXX
 endif()
 
 append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer LIBFUZZER_CFLAGS)
+append_list_if(True -fexceptions LIBFUZZER_CFLAGS)
 
 if (CMAKE_CXX_FLAGS MATCHES "fsanitize-coverage")
   list(APPEND LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters)

Modified: compiler-rt/trunk/lib/fuzzer/FuzzerFork.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerFork.cpp?rev=358726&r1=358725&r2=358726&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerFork.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerFork.cpp Thu Apr 18 18:39:14 2019
@@ -150,6 +150,9 @@ struct GlobalEnv {
   }
 
   void RunOneMergeJob(FuzzJob *Job) {
+    auto Stats = ParseFinalStatsFromLog(Job->LogPath);
+    NumRuns += Stats.number_of_executed_units;
+
     Vector<SizedFile> TempFiles, MergeCandidates;
     // Read all newly created inputs and their feature sets.
     // Choose only those inputs that have new features.
@@ -189,8 +192,6 @@ struct GlobalEnv {
           PrintPC("  NEW_FUNC: %p %F %L\n", "",
                   TPC.GetNextInstructionPc(TE->PC));
 
-    auto Stats = ParseFinalStatsFromLog(Job->LogPath);
-    NumRuns += Stats.number_of_executed_units;
     if (!FilesToAdd.empty() || Job->ExitCode != 0)
       Printf("#%zd: cov: %zd ft: %zd corp: %zd exec/s %zd "
              "oom/timeout/crash: %zd/%zd/%zd time: %zds\n", NumRuns,




More information about the llvm-commits mailing list