From: Roland Shoemaker Date: Thu, 2 Sep 2021 21:38:58 +0000 (-0700) Subject: [dev.fuzz] internal/fuzz: maintain debug info during minimization X-Git-Tag: go1.18beta1~1282^2~19 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9c56a64673d2f458e28c603f95b4efb5d39beef2;p=gostls13.git [dev.fuzz] internal/fuzz: maintain debug info during minimization Change-Id: I70c0229e43dfe37f70b9c79c2e6fe88d7b8d7bd0 Reviewed-on: https://go-review.googlesource.com/c/go/+/347231 Trust: Roland Shoemaker Run-TryBot: Roland Shoemaker TryBot-Result: Go Bot Reviewed-by: Jay Conrod --- diff --git a/src/internal/fuzz/fuzz.go b/src/internal/fuzz/fuzz.go index 722933a0bf..5b940e4929 100644 --- a/src/internal/fuzz/fuzz.go +++ b/src/internal/fuzz/fuzz.go @@ -341,10 +341,11 @@ func CoordinateFuzzing(ctx context.Context, opts CoordinateFuzzingOpts) (err err if printDebugInfo() { fmt.Fprintf( c.opts.Log, - "DEBUG worker reported interesting input that doesn't expand coverage, elapsed: %s, id: %s, parent: %s\n", + "DEBUG worker reported interesting input that doesn't expand coverage, elapsed: %s, id: %s, parent: %s, minimized: %t\n", time.Since(c.startTime), result.entry.Name, result.entry.Parent, + result.minimizeAttempted, ) } } diff --git a/src/internal/fuzz/worker.go b/src/internal/fuzz/worker.go index 2f5704094e..32b13662c8 100644 --- a/src/internal/fuzz/worker.go +++ b/src/internal/fuzz/worker.go @@ -1017,6 +1017,11 @@ func (wc *workerClient) minimize(ctx context.Context, entryIn CorpusEntry, args return CorpusEntry{}, minimizeResponse{}, errSharedMemClosed } entryOut.Data = mem.valueCopy() + h := sha256.Sum256(entryOut.Data) + name := fmt.Sprintf("%x", h[:4]) + entryOut.Name = name + entryOut.Parent = entryIn.Parent + entryOut.Generation = entryIn.Generation resp.Count = mem.header().count return entryOut, resp, callErr