MCPcopy Create free account
hub / github.com/HexHive/NASS / WorkerThread

Function WorkerThread

fuzz/libfuzzer/FuzzerDriver.cpp:238–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238static void WorkerThread(const Command &BaseCmd, std::atomic<unsigned> *Counter,
239 unsigned NumJobs, std::atomic<bool> *HasErrors) {
240 while (true) {
241 unsigned C = (*Counter)++;
242 if (C >= NumJobs) break;
243 std::string Log = "fuzz-" + std::to_string(C) + ".log";
244 Command Cmd(BaseCmd);
245 Cmd.setOutputFile(Log);
246 Cmd.combineOutAndErr();
247 if (Flags.verbosity) {
248 std::string CommandLine = Cmd.toString();
249 Printf("%s\n", CommandLine.c_str());
250 }
251 int ExitCode = ExecuteCommand(Cmd);
252 if (ExitCode != 0)
253 *HasErrors = true;
254 std::lock_guard<std::mutex> Lock(Mu);
255 Printf("================== Job %u exited with exit code %d ============\n",
256 C, ExitCode);
257 fuzzer::CopyFileToErr(Log);
258 }
259}
260
261static void ValidateDirectoryExists(const std::string &Path,
262 bool CreateDirectory) {

Callers

nothing calls this directly

Calls 7

CopyFileToErrFunction · 0.85
setOutputFileMethod · 0.80
combineOutAndErrMethod · 0.80
PrintfFunction · 0.70
ExecuteCommandFunction · 0.70
toStringMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected