]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: refactor in preparation for GOFUZZCACHE
authorJay Conrod <jayconrod@google.com>
Fri, 4 Dec 2020 23:07:20 +0000 (18:07 -0500)
committerJay Conrod <jayconrod@google.com>
Tue, 15 Dec 2020 15:34:59 +0000 (15:34 +0000)
commit97df3ba792bda80b99a8508cf36dfba3d1c37576
treed4993e9cb4a8c35376b1ba1b20fd34153cc81b15
parentc3dc22598829eec39b6b55e347ad4b974af24e12
[dev.fuzz] internal/fuzz: refactor in preparation for GOFUZZCACHE

Several small changes, most related to GOFUZZCACHE.

* Use separate channels to send crashers and interesting values to the
  coordinator.
* Add a new type, crasherEntry, which is a corpusEntry with an
  error message.
* Workers now send fatal errors to the coordinator via errC instead of
  returning or closing doneC.
* In CoordinateFuzzing, defer code that closes doneC and waits for
  workers to stop. This is the only place where doneC is closed.
* In workerServer and workerClient, always pass input values through
  shared memory instead of RPC messages or arguments to avoid
  confusion.
* Rename sharedMem.value to valueRef and add valueCopy to make it
  clearer whether a reference or copy is needed.
* mutate now operates on shared memory directly.
* mutate will not panic on empty input.

Change-Id: I6e57354875508f0ac4483ed2728f3ba18dc938c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/275533
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/fuzz.go
src/internal/fuzz/mem.go
src/internal/fuzz/mutator.go
src/internal/fuzz/worker.go