Skip to content

Commit

Permalink
Print mutator log when runner log requested.
Browse files Browse the repository at this point in the history
In developing fuzzers, it's often useful to print logging from the fuzzer
binary, and centipede provided a command-line argument to do that. However this
argument didn't apply to invocations for the purpose of gathering mutants, thus
it was hard to debug problems when developing custom implementations of
LLVMFuzzerCustomMutator and similar. Add logging in this case too.

PiperOrigin-RevId: 701867237
  • Loading branch information
FuzzTest Team authored and copybara-github committed Dec 2, 2024
1 parent c5dd071 commit 4e36413
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions centipede/centipede_callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ bool CentipedeCallbacks::MutateViaExternalBinary(

if (retval != EXIT_SUCCESS) {
LOG(WARNING) << "Custom mutator failed with exit code " << retval;
}
if (env_.print_runner_log || retval != EXIT_SUCCESS) {
PrintExecutionLog();
}

Expand All @@ -320,6 +322,7 @@ bool CentipedeCallbacks::MutateViaExternalBinary(
mutants[i].assign(blob.data, blob.data + blob.size);
}
outputs_blobseq_.ReleaseSharedMemory(); // Outputs are already consumed.

VLOG(1) << __FUNCTION__ << " took " << (absl::Now() - start_time);
return retval == 0;
}
Expand Down

0 comments on commit 4e36413

Please sign in to comment.