Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions centipede/engine_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ constexpr std::string_view kWorkerPersistentModeSocketPathFlagHeader =
"persistent_mode_socket="; // TODO: Use better flag names when
// standardizing the protocol.
constexpr std::string_view kWorkerCrossOverLevel = "crossover_level=";
constexpr std::string_view kWorkerMinSeeds = "min_seeds=";

struct WorkerState {
std::atomic<bool> has_failure_output = false;
Expand Down Expand Up @@ -481,8 +482,8 @@ void WorkerDoGetSeeds(const FuzzTestAdapter& adapter) {
WORKER_CHECK_FOR_ERROR();
}

// TODO(xinhaoyuan): Make 32 adjustable.
while (seed_handles.size() < 32) {
const size_t min_seeds = GetWorkerFlags().GetIntFlag(kWorkerMinSeeds, 32);
while (seed_handles.size() < min_seeds) {
const size_t prev_size = seed_handles.size();
adapter.GetRandomSeedInput(adapter.ctx, &sink);
WorkerCheck(seed_handles.size() == prev_size + 1,
Expand Down
3 changes: 2 additions & 1 deletion centipede/runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ static void DumpSeedsToDir(RunnerCallbacks& callbacks, const char* output_dir) {
++seed_index;
};
callbacks.GetPresetSeedInputs(dump_seed_callback);
while (seed_index < 32) {
const size_t min_seeds = state->flag_helper.GetIntFlag("min_seeds=", 32);
while (seed_index < min_seeds) {
dump_seed_callback(callbacks.GetRandomSeedInput());
}
}
Expand Down
Loading