blob: e73feaf5cd88dcca75d9bd3d68f8a877b4aac0a2 [file] [log] [blame]
Kostya Serebryany016852c2015-02-19 18:45:37 +00001//===- FuzzerDriver.cpp - FuzzerDriver function and flags -----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9// FuzzerDriver and flag parsing.
10//===----------------------------------------------------------------------===//
11
12#include "FuzzerInterface.h"
13#include "FuzzerInternal.h"
14
15#include <cstring>
Kostya Serebryany83fd4862015-05-11 21:31:51 +000016#include <chrono>
Kostya Serebryany016852c2015-02-19 18:45:37 +000017#include <unistd.h>
Kostya Serebryany016852c2015-02-19 18:45:37 +000018#include <thread>
19#include <atomic>
20#include <mutex>
Kostya Serebryany52a788e2015-03-31 20:13:20 +000021#include <string>
22#include <sstream>
23#include <algorithm>
24#include <iterator>
Kostya Serebryany016852c2015-02-19 18:45:37 +000025
Kostya Serebryany4282d302016-01-15 00:17:37 +000026// This function should be present in the libFuzzer so that the client
27// binary can test for its existence.
28extern "C" __attribute__((used)) void __libfuzzer_is_present() {}
29
Kostya Serebryany016852c2015-02-19 18:45:37 +000030namespace fuzzer {
31
32// Program arguments.
33struct FlagDescription {
34 const char *Name;
35 const char *Description;
36 int Default;
Kostya Serebryany52a788e2015-03-31 20:13:20 +000037 int *IntFlag;
38 const char **StrFlag;
Mike Aizatskya1a5c692015-12-10 20:41:53 +000039 unsigned int *UIntFlag;
Kostya Serebryany016852c2015-02-19 18:45:37 +000040};
41
42struct {
Kostya Serebryany52a788e2015-03-31 20:13:20 +000043#define FUZZER_FLAG_INT(Name, Default, Description) int Name;
Mike Aizatskya1a5c692015-12-10 20:41:53 +000044#define FUZZER_FLAG_UNSIGNED(Name, Default, Description) unsigned int Name;
Kostya Serebryany52a788e2015-03-31 20:13:20 +000045#define FUZZER_FLAG_STRING(Name, Description) const char *Name;
Kostya Serebryany016852c2015-02-19 18:45:37 +000046#include "FuzzerFlags.def"
Kostya Serebryany52a788e2015-03-31 20:13:20 +000047#undef FUZZER_FLAG_INT
Mike Aizatskya1a5c692015-12-10 20:41:53 +000048#undef FUZZER_FLAG_UNSIGNED
Kostya Serebryany52a788e2015-03-31 20:13:20 +000049#undef FUZZER_FLAG_STRING
Kostya Serebryany016852c2015-02-19 18:45:37 +000050} Flags;
51
Craig Topper26260942015-10-18 05:15:34 +000052static const FlagDescription FlagDescriptions [] {
Kostya Serebryany52a788e2015-03-31 20:13:20 +000053#define FUZZER_FLAG_INT(Name, Default, Description) \
Mike Aizatskya1a5c692015-12-10 20:41:53 +000054 {#Name, Description, Default, &Flags.Name, nullptr, nullptr},
55#define FUZZER_FLAG_UNSIGNED(Name, Default, Description) \
56 {#Name, Description, static_cast<int>(Default), \
57 nullptr, nullptr, &Flags.Name},
Kostya Serebryany52a788e2015-03-31 20:13:20 +000058#define FUZZER_FLAG_STRING(Name, Description) \
Mike Aizatskya1a5c692015-12-10 20:41:53 +000059 {#Name, Description, 0, nullptr, &Flags.Name, nullptr},
Kostya Serebryany016852c2015-02-19 18:45:37 +000060#include "FuzzerFlags.def"
Kostya Serebryany52a788e2015-03-31 20:13:20 +000061#undef FUZZER_FLAG_INT
Mike Aizatskya1a5c692015-12-10 20:41:53 +000062#undef FUZZER_FLAG_UNSIGNED
Kostya Serebryany52a788e2015-03-31 20:13:20 +000063#undef FUZZER_FLAG_STRING
Kostya Serebryany016852c2015-02-19 18:45:37 +000064};
65
66static const size_t kNumFlags =
67 sizeof(FlagDescriptions) / sizeof(FlagDescriptions[0]);
68
Kostya Serebryanya938bcb2015-09-10 16:57:57 +000069static std::vector<std::string> *Inputs;
70static std::string *ProgName;
Kostya Serebryany016852c2015-02-19 18:45:37 +000071
72static void PrintHelp() {
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +000073 Printf("Usage: %s [-flag1=val1 [-flag2=val2 ...] ] [dir1 [dir2 ...] ]\n",
Kostya Serebryanya938bcb2015-09-10 16:57:57 +000074 ProgName->c_str());
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +000075 Printf("\nFlags: (strictly in form -flag=value)\n");
Kostya Serebryany016852c2015-02-19 18:45:37 +000076 size_t MaxFlagLen = 0;
77 for (size_t F = 0; F < kNumFlags; F++)
78 MaxFlagLen = std::max(strlen(FlagDescriptions[F].Name), MaxFlagLen);
79
80 for (size_t F = 0; F < kNumFlags; F++) {
81 const auto &D = FlagDescriptions[F];
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +000082 Printf(" %s", D.Name);
Kostya Serebryany016852c2015-02-19 18:45:37 +000083 for (size_t i = 0, n = MaxFlagLen - strlen(D.Name); i < n; i++)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +000084 Printf(" ");
85 Printf("\t");
86 Printf("%d\t%s\n", D.Default, D.Description);
Kostya Serebryany016852c2015-02-19 18:45:37 +000087 }
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +000088 Printf("\nFlags starting with '--' will be ignored and "
89 "will be passed verbatim to subprocesses.\n");
Kostya Serebryany016852c2015-02-19 18:45:37 +000090}
91
92static const char *FlagValue(const char *Param, const char *Name) {
93 size_t Len = strlen(Name);
94 if (Param[0] == '-' && strstr(Param + 1, Name) == Param + 1 &&
95 Param[Len + 1] == '=')
96 return &Param[Len + 2];
97 return nullptr;
98}
99
Kostya Serebryany4282d302016-01-15 00:17:37 +0000100// Avoid calling stol as it triggers a bug in clang/glibc build.
101static long MyStol(const char *Str) {
102 long Res = 0;
Kostya Serebryany311f27c2016-01-19 20:33:57 +0000103 long Sign = 1;
104 if (*Str == '-') {
105 Str++;
106 Sign = -1;
107 }
Kostya Serebryany4282d302016-01-15 00:17:37 +0000108 for (size_t i = 0; Str[i]; i++) {
109 char Ch = Str[i];
110 if (Ch < '0' || Ch > '9')
111 return Res;
112 Res = Res * 10 + (Ch - '0');
113 }
Kostya Serebryany311f27c2016-01-19 20:33:57 +0000114 return Res * Sign;
Kostya Serebryany4282d302016-01-15 00:17:37 +0000115}
116
Kostya Serebryany016852c2015-02-19 18:45:37 +0000117static bool ParseOneFlag(const char *Param) {
118 if (Param[0] != '-') return false;
Kostya Serebryany71e0feb2015-05-21 20:39:13 +0000119 if (Param[1] == '-') {
120 static bool PrintedWarning = false;
121 if (!PrintedWarning) {
122 PrintedWarning = true;
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000123 Printf("WARNING: libFuzzer ignores flags that start with '--'\n");
Kostya Serebryany71e0feb2015-05-21 20:39:13 +0000124 }
125 return true;
126 }
Kostya Serebryany016852c2015-02-19 18:45:37 +0000127 for (size_t F = 0; F < kNumFlags; F++) {
128 const char *Name = FlagDescriptions[F].Name;
129 const char *Str = FlagValue(Param, Name);
130 if (Str) {
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000131 if (FlagDescriptions[F].IntFlag) {
Kostya Serebryany4282d302016-01-15 00:17:37 +0000132 int Val = MyStol(Str);
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000133 *FlagDescriptions[F].IntFlag = Val;
134 if (Flags.verbosity >= 2)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000135 Printf("Flag: %s %d\n", Name, Val);;
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000136 return true;
Mike Aizatskya1a5c692015-12-10 20:41:53 +0000137 } else if (FlagDescriptions[F].UIntFlag) {
138 unsigned int Val = std::stoul(Str);
139 *FlagDescriptions[F].UIntFlag = Val;
140 if (Flags.verbosity >= 2)
141 Printf("Flag: %s %u\n", Name, Val);
142 return true;
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000143 } else if (FlagDescriptions[F].StrFlag) {
144 *FlagDescriptions[F].StrFlag = Str;
145 if (Flags.verbosity >= 2)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000146 Printf("Flag: %s %s\n", Name, Str);
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000147 return true;
148 }
Kostya Serebryany016852c2015-02-19 18:45:37 +0000149 }
150 }
151 PrintHelp();
152 exit(1);
153}
154
155// We don't use any library to minimize dependencies.
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000156static void ParseFlags(const std::vector<std::string> &Args) {
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000157 for (size_t F = 0; F < kNumFlags; F++) {
158 if (FlagDescriptions[F].IntFlag)
159 *FlagDescriptions[F].IntFlag = FlagDescriptions[F].Default;
Mike Aizatskya1a5c692015-12-10 20:41:53 +0000160 if (FlagDescriptions[F].UIntFlag)
161 *FlagDescriptions[F].UIntFlag =
162 static_cast<unsigned int>(FlagDescriptions[F].Default);
Kostya Serebryany52a788e2015-03-31 20:13:20 +0000163 if (FlagDescriptions[F].StrFlag)
164 *FlagDescriptions[F].StrFlag = nullptr;
165 }
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000166 Inputs = new std::vector<std::string>;
167 for (size_t A = 1; A < Args.size(); A++) {
168 if (ParseOneFlag(Args[A].c_str())) continue;
169 Inputs->push_back(Args[A]);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000170 }
171}
172
Kostya Serebryany83fd4862015-05-11 21:31:51 +0000173static std::mutex Mu;
174
175static void PulseThread() {
176 while (true) {
177 std::this_thread::sleep_for(std::chrono::seconds(600));
178 std::lock_guard<std::mutex> Lock(Mu);
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000179 Printf("pulse...\n");
Kostya Serebryany83fd4862015-05-11 21:31:51 +0000180 }
181}
182
Kostya Serebryany016852c2015-02-19 18:45:37 +0000183static void WorkerThread(const std::string &Cmd, std::atomic<int> *Counter,
184 int NumJobs, std::atomic<bool> *HasErrors) {
Kostya Serebryany016852c2015-02-19 18:45:37 +0000185 while (true) {
186 int C = (*Counter)++;
187 if (C >= NumJobs) break;
188 std::string Log = "fuzz-" + std::to_string(C) + ".log";
189 std::string ToRun = Cmd + " > " + Log + " 2>&1\n";
190 if (Flags.verbosity)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000191 Printf("%s", ToRun.c_str());
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000192 int ExitCode = ExecuteCommand(ToRun.c_str());
Kostya Serebryany016852c2015-02-19 18:45:37 +0000193 if (ExitCode != 0)
194 *HasErrors = true;
Kostya Serebryany83fd4862015-05-11 21:31:51 +0000195 std::lock_guard<std::mutex> Lock(Mu);
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000196 Printf("================== Job %d exited with exit code %d ============\n",
197 C, ExitCode);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000198 fuzzer::CopyFileToErr(Log);
199 }
200}
201
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000202static int RunInMultipleProcesses(const std::vector<std::string> &Args,
203 int NumWorkers, int NumJobs) {
Kostya Serebryany016852c2015-02-19 18:45:37 +0000204 std::atomic<int> Counter(0);
205 std::atomic<bool> HasErrors(false);
206 std::string Cmd;
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000207 for (auto &S : Args) {
208 if (FlagValue(S.c_str(), "jobs") || FlagValue(S.c_str(), "workers"))
209 continue;
210 Cmd += S + " ";
Kostya Serebryany016852c2015-02-19 18:45:37 +0000211 }
212 std::vector<std::thread> V;
Kostya Serebryany83fd4862015-05-11 21:31:51 +0000213 std::thread Pulse(PulseThread);
Kostya Serebryanycd7629c2015-05-12 01:43:20 +0000214 Pulse.detach();
Kostya Serebryany016852c2015-02-19 18:45:37 +0000215 for (int i = 0; i < NumWorkers; i++)
216 V.push_back(std::thread(WorkerThread, Cmd, &Counter, NumJobs, &HasErrors));
217 for (auto &T : V)
218 T.join();
219 return HasErrors ? 1 : 0;
220}
221
Ivan Krasin95e82d52015-10-01 23:23:06 +0000222int RunOneTest(Fuzzer *F, const char *InputFilePath) {
223 Unit U = FileToVector(InputFilePath);
Kostya Serebryany856b7af2015-11-03 18:57:25 +0000224 Unit PreciseSizedU(U);
225 assert(PreciseSizedU.size() == PreciseSizedU.capacity());
226 F->ExecuteCallback(PreciseSizedU);
Ivan Krasin95e82d52015-10-01 23:23:06 +0000227 return 0;
228}
229
Kostya Serebryany016852c2015-02-19 18:45:37 +0000230int FuzzerDriver(int argc, char **argv, UserCallback Callback) {
Kostya Serebryany311f27c2016-01-19 20:33:57 +0000231 FuzzerRandom_mt19937 Rand(0);
Kostya Serebryany404c69f2015-07-24 01:06:40 +0000232 SimpleUserSuppliedFuzzer SUSF(&Rand, Callback);
Kostya Serebryanyf3424592015-05-22 22:35:31 +0000233 return FuzzerDriver(argc, argv, SUSF);
234}
235
236int FuzzerDriver(int argc, char **argv, UserSuppliedFuzzer &USF) {
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000237 std::vector<std::string> Args(argv, argv + argc);
238 return FuzzerDriver(Args, USF);
239}
Kostya Serebryany016852c2015-02-19 18:45:37 +0000240
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000241int FuzzerDriver(const std::vector<std::string> &Args, UserCallback Callback) {
Kostya Serebryany311f27c2016-01-19 20:33:57 +0000242 FuzzerRandom_mt19937 Rand(0);
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000243 SimpleUserSuppliedFuzzer SUSF(&Rand, Callback);
244 return FuzzerDriver(Args, SUSF);
245}
246
247int FuzzerDriver(const std::vector<std::string> &Args,
248 UserSuppliedFuzzer &USF) {
249 using namespace fuzzer;
250 assert(!Args.empty());
251 ProgName = new std::string(Args[0]);
252 ParseFlags(Args);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000253 if (Flags.help) {
254 PrintHelp();
255 return 0;
256 }
257
Kostya Serebryany9690fcf2015-05-12 18:51:57 +0000258 if (Flags.jobs > 0 && Flags.workers == 0) {
259 Flags.workers = std::min(NumberOfCpuCores() / 2, Flags.jobs);
260 if (Flags.workers > 1)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000261 Printf("Running %d workers\n", Flags.workers);
Kostya Serebryany9690fcf2015-05-12 18:51:57 +0000262 }
263
Kostya Serebryany016852c2015-02-19 18:45:37 +0000264 if (Flags.workers > 0 && Flags.jobs > 0)
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000265 return RunInMultipleProcesses(Args, Flags.workers, Flags.jobs);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000266
267 Fuzzer::FuzzingOptions Options;
268 Options.Verbosity = Flags.verbosity;
269 Options.MaxLen = Flags.max_len;
Kostya Serebryany490bbd62015-05-19 22:12:57 +0000270 Options.UnitTimeoutSec = Flags.timeout;
Kostya Serebryany9768e7f2016-01-23 19:34:19 +0000271 Options.AbortOnTimeout = Flags.abort_on_timeout;
Kostya Serebryany54a63632016-01-29 23:30:07 +0000272 Options.TimeoutExitCode = Flags.timeout_exitcode;
Kostya Serebryanyb85db172015-10-02 20:47:55 +0000273 Options.MaxTotalTimeSec = Flags.max_total_time;
Kostya Serebryany016852c2015-02-19 18:45:37 +0000274 Options.DoCrossOver = Flags.cross_over;
275 Options.MutateDepth = Flags.mutate_depth;
276 Options.ExitOnFirst = Flags.exit_on_first;
Kostya Serebryanybe5e0ed2015-03-03 23:27:02 +0000277 Options.UseCounters = Flags.use_counters;
Kostya Serebryany2e9fca92015-10-22 23:55:39 +0000278 Options.UseIndirCalls = Flags.use_indir_calls;
Kostya Serebryany5a99ecb2015-05-11 20:51:19 +0000279 Options.UseTraces = Flags.use_traces;
Kostya Serebryanyae5b9562016-01-15 06:24:05 +0000280 Options.UseMemcmp = Flags.use_memcmp;
Kostya Serebryanyfed509e2015-10-17 04:38:26 +0000281 Options.ShuffleAtStartUp = Flags.shuffle;
Kostya Serebryany016852c2015-02-19 18:45:37 +0000282 Options.PreferSmallDuringInitialShuffle =
283 Flags.prefer_small_during_initial_shuffle;
Kostya Serebryany1ac80552015-05-08 21:30:55 +0000284 Options.Reload = Flags.reload;
Kostya Serebryanybc7c0ad2015-08-11 01:44:42 +0000285 Options.OnlyASCII = Flags.only_ascii;
Mike Aizatskya9c23872015-11-12 04:38:40 +0000286 Options.OutputCSV = Flags.output_csv;
Kostya Serebryany016852c2015-02-19 18:45:37 +0000287 if (Flags.runs >= 0)
288 Options.MaxNumberOfRuns = Flags.runs;
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000289 if (!Inputs->empty())
290 Options.OutputCorpus = (*Inputs)[0];
Kostya Serebryany2da7b842015-05-18 21:34:20 +0000291 if (Flags.sync_command)
292 Options.SyncCommand = Flags.sync_command;
293 Options.SyncTimeout = Flags.sync_timeout;
Kostya Serebryany70926ae2015-08-05 21:43:48 +0000294 Options.ReportSlowUnits = Flags.report_slow_units;
Kostya Serebryanybd5d1cd2015-10-09 03:57:59 +0000295 if (Flags.artifact_prefix)
296 Options.ArtifactPrefix = Flags.artifact_prefix;
Kostya Serebryany2d0ef142015-11-25 21:40:46 +0000297 if (Flags.exact_artifact_path)
298 Options.ExactArtifactPath = Flags.exact_artifact_path;
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000299 std::vector<Unit> Dictionary;
Kostya Serebryany7d211662015-09-04 00:12:11 +0000300 if (Flags.dict)
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000301 if (!ParseDictionaryFile(FileToString(Flags.dict), &Dictionary))
Kostya Serebryany7d211662015-09-04 00:12:11 +0000302 return 1;
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000303 if (Flags.verbosity > 0 && !Dictionary.empty())
304 Printf("Dictionary: %zd entries\n", Dictionary.size());
Kostya Serebryanyb91c62b2015-10-16 22:41:47 +0000305 Options.SaveArtifacts = !Flags.test_single_input;
Mike Aizatsky8b11f872016-01-06 00:21:22 +0000306 Options.PrintNewCovPcs = Flags.print_new_cov_pcs;
Kostya Serebryany7d211662015-09-04 00:12:11 +0000307
Kostya Serebryanyf3424592015-05-22 22:35:31 +0000308 Fuzzer F(USF, Options);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000309
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000310 for (auto &U: Dictionary)
Kostya Serebryany476f0ce2016-01-16 03:53:32 +0000311 if (U.size() <= Word::GetMaxSize())
312 USF.GetMD().AddWordToManualDictionary(Word(U.data(), U.size()));
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000313
Kostya Serebryanyb91c62b2015-10-16 22:41:47 +0000314 // Timer
315 if (Flags.timeout > 0)
316 SetTimer(Flags.timeout / 2 + 1);
317
Kostya Serebryanyb5693682015-11-21 03:46:43 +0000318 if (Flags.test_single_input) {
319 RunOneTest(&F, Flags.test_single_input);
320 exit(0);
321 }
Ivan Krasin95e82d52015-10-01 23:23:06 +0000322
Kostya Serebryany550e9c82015-12-19 03:42:16 +0000323 if (Flags.save_minimized_corpus) {
324 Printf("The flag -save_minimized_corpus is deprecated; use -merge=1\n");
325 exit(1);
326 }
327
Kostya Serebryany9cc3b0d2015-10-24 01:16:40 +0000328 if (Flags.merge) {
329 F.Merge(*Inputs);
330 exit(0);
331 }
332
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000333 unsigned Seed = Flags.seed;
334 // Initialize Seed.
335 if (Seed == 0)
Kostya Serebryany311f27c2016-01-19 20:33:57 +0000336 Seed = (std::chrono::system_clock::now().time_since_epoch().count() << 10) +
337 getpid();
Kostya Serebryany016852c2015-02-19 18:45:37 +0000338 if (Flags.verbosity)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000339 Printf("Seed: %u\n", Seed);
Kostya Serebryany404c69f2015-07-24 01:06:40 +0000340 USF.GetRand().ResetSeed(Seed);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000341
Kostya Serebryany1ac80552015-05-08 21:30:55 +0000342 F.RereadOutputCorpus();
Kostya Serebryanya938bcb2015-09-10 16:57:57 +0000343 for (auto &inp : *Inputs)
Kostya Serebryany1ac80552015-05-08 21:30:55 +0000344 if (inp != Options.OutputCorpus)
345 F.ReadDir(inp, nullptr);
Kostya Serebryany016852c2015-02-19 18:45:37 +0000346
347 if (F.CorpusSize() == 0)
348 F.AddToCorpus(Unit()); // Can't fuzz empty corpus, so add an empty input.
349 F.ShuffleAndMinimize();
Kostya Serebryany550e9c82015-12-19 03:42:16 +0000350 if (Flags.drill)
Kostya Serebryanydc3135d2015-11-12 01:02:01 +0000351 F.Drill();
352 else
353 F.Loop();
354
Kostya Serebryany016852c2015-02-19 18:45:37 +0000355 if (Flags.verbosity)
Kostya Serebryany20e9bcb2015-05-23 01:07:46 +0000356 Printf("Done %d runs in %zd second(s)\n", F.getTotalNumberOfRuns(),
357 F.secondsSinceProcessStartUp());
358
Kostya Serebryanyc8cd29f2015-10-03 07:02:05 +0000359 exit(0); // Don't let F destroy itself.
Kostya Serebryany016852c2015-02-19 18:45:37 +0000360}
361
362} // namespace fuzzer