]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: minimize inputs that expand coverage
authorJay Conrod <jayconrod@google.com>
Tue, 17 Aug 2021 20:25:12 +0000 (13:25 -0700)
committerJay Conrod <jayconrod@google.com>
Thu, 2 Sep 2021 17:58:51 +0000 (17:58 +0000)
commit5bc273aca54391177ad3f43a54d22021deb99114
treec4b1932f3395bbd2e1ee04b060dc8bf38c3b51cd
parentf0668e7c8cc2f26e16afa31dd43be774b1db65a5
[dev.fuzz] internal/fuzz: minimize inputs that expand coverage

When a fuzz worker discovers an input that activates coverage counters
that weren't previously activated, it sends that input back to the
coordinator, as before. If the coordinator also finds that input
provides new coverage (that is, some other input hasn't won the race),
the coordinator now sends the input back to workers for minimization.

The minimization procedure now supports minimizing these interesting
inputs. It attempts to find smaller inputs that preserve at least one
new coverage bit. If minimization succeeds, the coordinator adds the
smaller input to the corpus instead of the original. If minimization
fails, the coordinator adds the original input. If minimization finds
that the original input didn't provide new coverage after all (for
example, a counter was activated by an unrelated background goroutine
and was considered flaky), the input is ignored and not recorded.

Change-Id: I81d98d6ec28abb0ac2a476f73480ceeaff674c08
Reviewed-on: https://go-review.googlesource.com/c/go/+/342997
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt [new file with mode: 0644]
src/internal/fuzz/fuzz.go
src/internal/fuzz/minimize.go
src/internal/fuzz/minimize_test.go
src/internal/fuzz/queue.go [new file with mode: 0644]
src/internal/fuzz/queue_test.go [new file with mode: 0644]
src/internal/fuzz/worker.go