From e08df713b6486c0c5bbb584aa9719aa3764813ad Mon Sep 17 00:00:00 2001 From: Xinhao Yuan Date: Tue, 11 Aug 2026 10:17:33 -0700 Subject: [PATCH] Do not fail the runner/worker if it fails to write mutants. This is to be consistent with the previous behavior. Otherwise when the engine request to mutant a large seed the mutation can keep failing due to shmem being too small, while previously it could do its best-effort to fill as much mutants as possible. PiperOrigin-RevId: 962853062 --- centipede/engine_worker.cc | 6 ++---- centipede/runner.cc | 10 +++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/centipede/engine_worker.cc b/centipede/engine_worker.cc index a1febf0a1..3c95801fd 100644 --- a/centipede/engine_worker.cc +++ b/centipede/engine_worker.cc @@ -639,12 +639,10 @@ void WorkerDoMutate(const FuzzTestAdapter& adapter) { mutant_bytes.clear(); adapter.SerializeInputContent(adapter.ctx, emitted_inputs[0], &mutant_bytes_sink); - WORKER_CHECK_FOR_ERROR(); - WorkerCheck(MutationResult::WriteMutant(MutantRef{mutant_bytes, origin}, - *outputs_blobseq), - "failed to write mutant"); adapter.FreeInput(adapter.ctx, emitted_inputs[0]); WORKER_CHECK_FOR_ERROR(); + (void)MutationResult::WriteMutant(MutantRef{mutant_bytes, origin}, + *outputs_blobseq); } for (auto input : origin_inputs) { diff --git a/centipede/runner.cc b/centipede/runner.cc index e734e6d1a..40e4f39bf 100644 --- a/centipede/runner.cc +++ b/centipede/runner.cc @@ -704,13 +704,9 @@ static int MutateInputsFromShmem(BlobSequence& inputs_blobseq, } if (!callbacks.HasCustomMutator()) return EXIT_SUCCESS; - { - bool succ = true; - MutateInputs(callbacks, input_refs, num_mutants, [&](MutantRef mutant) { - succ = succ && MutationResult::WriteMutant(mutant, outputs_blobseq); - }); - if (!succ) return EXIT_FAILURE; - } + MutateInputs(callbacks, input_refs, num_mutants, [&](MutantRef mutant) { + (void)MutationResult::WriteMutant(mutant, outputs_blobseq); + }); return EXIT_SUCCESS; }