]> Cypherpunks repositories - gostls13.git/commit
internal/fuzz: handle unrecoverable errors during minimization
authorKatie Hockman <katie@golang.org>
Wed, 1 Dec 2021 16:25:16 +0000 (11:25 -0500)
committerKatie Hockman <katie@golang.org>
Tue, 7 Dec 2021 21:15:51 +0000 (21:15 +0000)
commit2ebe081288377fa4e9f71b1dab8557a042a9a670
treeec204a519bfacc9204fabb7aedd8d3eaaa3ff56c
parentb37a5391f9e452aa779205add12bd89f44e3fcf0
internal/fuzz: handle unrecoverable errors during minimization

Previously, if an unrecoverable error occurred during
minimization, then the input that caused the failure
could not be retrieved by the coordinator. This was fine
if minimizing a crash, since the coordinator could simply
report the original error, and ignore the new one.
However, if an error occurred while minimizing an
interesting input, then we may lose an important error
that would be better to report.

This changes is a pretty major refactor of the minimization
logic in order to support this. It removes minimization
support of all types except []byte and string. There isn't
compelling evidence that minimizing types like int or float64
are actually beneficial, so removing this seems fine.

With this change, the coordinator requests that the worker
minimize a single value at a time. The worker updates shared
memory directly during minimzation, writing the *unmarshaled*
bytes to the shared memory region. If a nonrecoverable error occurs
during minimization, then the coordinator can get the
unmarshaled value out of shared memory for that type being
minimized.

Fixes #48731

Change-Id: I4d1d449c411129b3c83b148e666bc70f09e95828
Reviewed-on: https://go-review.googlesource.com/c/go/+/367848
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt
src/internal/fuzz/mem.go
src/internal/fuzz/minimize.go
src/internal/fuzz/minimize_test.go
src/internal/fuzz/worker.go
src/internal/fuzz/worker_test.go