]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: add minimization of []byte
authorKatie Hockman <katie@golang.org>
Wed, 3 Mar 2021 19:16:07 +0000 (14:16 -0500)
committerKatie Hockman <katie@golang.org>
Thu, 18 Mar 2021 16:07:17 +0000 (16:07 +0000)
commit32f45d13b2fa9ef8ae17e885c2d82d80a6d22caa
tree1f7cfcfb33f84c5506996509ba9454e93d6567aa
parent6ee1506769b24d99e27f9a6a9c99e9b7143112bf
[dev.fuzz] internal/fuzz: add minimization of []byte

This works by minimizing for a maximum of one minute. We may consider
making this customizable in the future.

This only minimizes []byte inputs which caused a recoverable error. In
the future, it should support minimizing other appopriate types, and
minimizing types which caused non-recoverable errors (though this is
much more expensive).

The code in internal/fuzz/worker.go is copied from, or heavily inspired
by, code originally authored by Dmitry Vyukov and Josh Bleecher Snyder
as part of the go-fuzz project. Thanks to them for their contributions.
See https://github.com/dvyukov/go-fuzz.

Change-Id: I93dbac7ff874d6d0c1b9b9dda23930ae9921480c
Reviewed-on: https://go-review.googlesource.com/c/go/+/298909
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/testdata/script/test_fuzz_mutator.txt
src/internal/fuzz/worker.go