From 086ab166bbbf17d3f0a16c8b27f1995a70908b35 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 14 May 2024 16:52:34 +0200 Subject: pkg/fuzzer/queue: retry inputs from crashed VMs Mark some requests as Important. The Retry() layer will give them one more chance even if they were not executed due to a VM crash. For now, the only important requests are related to triage, candidates and pkg/vminfo tests. Add tests for retry.go. --- pkg/fuzzer/queue/queue.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/fuzzer/queue/queue.go') diff --git a/pkg/fuzzer/queue/queue.go b/pkg/fuzzer/queue/queue.go index 14d4ace78..48b912846 100644 --- a/pkg/fuzzer/queue/queue.go +++ b/pkg/fuzzer/queue/queue.go @@ -40,11 +40,16 @@ type Request struct { BinaryFile string // If set, it's executed instead of Prog. Repeat int // Repeats in addition to the first run. + // Important requests will be retried even from crashed VMs. + Important bool + // The callback will be called on request completion in the LIFO order. // If it returns false, all further processing will be stopped. // It allows wrappers to intercept Done() requests. callback DoneCallback + onceCrashed bool + mu sync.Mutex result *Result done chan struct{} @@ -91,6 +96,11 @@ func (r *Request) Wait(ctx context.Context) *Result { } } +// Risky() returns true if there's a substantial risk of the input crashing the VM. +func (r *Request) Risky() bool { + return r.onceCrashed +} + func (r *Request) hash() hash.Sig { buf := new(bytes.Buffer) if r.ExecOpts != nil { -- cgit mrf-deployment