]> Cypherpunks repositories - gostls13.git/commit
internal/fuzz: fix bugs with minimization
authorKatie Hockman <katie@golang.org>
Wed, 13 Oct 2021 20:49:27 +0000 (16:49 -0400)
committerKatie Hockman <katie@golang.org>
Fri, 15 Oct 2021 19:03:33 +0000 (19:03 +0000)
commitcfe6763783615233ec7ae863784b898718d14c40
tree86680257ce74bb5ca2b3638727277865ebf70713
parent8331f25e96d6120bb0ec212bd03abcae53282769
internal/fuzz: fix bugs with minimization

This pulls in some code and tests from CL 353355.

This change makes some refactors for when we read
to and write from memory during minimization.
That fixes a bug when minimizing interesting inputs.
Now, if an error occurs while minimizing an interesting
input, that value will continue to be minimized as a
crash, and returned to the user.

This change also allows minimization of a crash that
occurred during the warmup phase. We don't want to
minimize failures in the seed corpus, but if an entry
in the cache causes a new failure, then there's no
compelling reason why we shouldn't try to minimize it.

Fixes #48731

Change-Id: I7262cecd8ea7ae6fdf932f3a36db55fb062a1f2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/355691
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/cmd/go/testdata/script/test_fuzz_minimize.txt
src/cmd/go/testdata/script/test_fuzz_seed_corpus.txt
src/internal/fuzz/fuzz.go
src/internal/fuzz/minimize_test.go
src/internal/fuzz/worker.go