Commit graph

5 commits

Author SHA1 Message Date
Katie Hockman
d106089fa6 [dev.fuzz] internal/fuzz: write a newline to the end of a corpus file
If someone manually adds/alters a corpus file to add
extra spacing or remove the final newline, the file
can still be decoded. However, this change ensures that
the fuzzing engine correctly writes the final newline.

Fixes golang/go#48130

Change-Id: Ib5556d4a6e4e0bfd9bc2edab357b7c25bedfd176
Reviewed-on: https://go-review.googlesource.com/c/go/+/349055
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>
2021-09-10 19:27:54 +00:00
Jay Conrod
3e06338c5d [dev.fuzz] internal/fuzz: add more benchmarks for workers
* Benchmark{Marshal,Unmarshal}CorpusFile - measures time it takes to
  serialize and deserialize byte slices of various lengths.
* BenchmarkWorkerPing - spins up a worker and measures time it takes
  to ping it N times as a rough measure of RPC latency.
* BenchmarkWorkerFuzz - spins up a worker and measures time it takes
  to mutate an input and call a trivial fuzz function N times.

Also a few small fixes to make this easier.

Change-Id: Id7f2dc6c6c05005cf286f30e6cc92a54bf44fbf7
Reviewed-on: https://go-review.googlesource.com/c/go/+/333670
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>
2021-07-19 21:11:25 +00:00
Katie Hockman
8b96efd8a2 [dev.fuzz] internal/fuzz: allow float types to be integer literals
Previously, something like `float64(0)` would fail to decode
since the 0 value is considered an integer literal, and the
float64 parsing code required a float literal. Be more flexible
here since an integer can always be converted to a float.

Change-Id: Id1c53ef2e8a9748a4f71176b00b453a329af4ade
Reviewed-on: https://go-review.googlesource.com/c/go/+/309032
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>
2021-04-12 18:51:16 +00:00
Katie Hockman
5aacd47c00 [dev.fuzz] internal/fuzz: updating version incoding
Based on feedback from rsc@, update the version
encoding to more clearly indicate that this is
about fuzzing with Go.

Change-Id: Id95dec8283608779b157bf662e7147f9a9c8dba8
Reviewed-on: https://go-review.googlesource.com/c/go/+/295110
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-02-22 18:50:34 +00:00
Katie Hockman
9cbf92c52b [dev.fuzz] internal/fuzz: support corpus file encoding/decoding
Change-Id: Id245ce5f154557f1744210e7d7f061d08901c746
Reviewed-on: https://go-review.googlesource.com/c/go/+/290951
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>
2021-02-17 16:04:01 +00:00