diff options
| author | Roland Shoemaker <roland@golang.org> | 2021-05-01 18:46:22 -0700 |
|---|---|---|
| committer | Roland Shoemaker <roland@golang.org> | 2021-05-07 14:24:10 +0000 |
| commit | 510e711dd36999f1800678909bb7fdb448aa074f (patch) | |
| tree | f0b530310fabc4cc01f0f9a3a4f59f8c5d58fefe /src/testing/testing.go | |
| parent | af3237eaf9cf46e6a02a3b53447e49c55abd4f00 (diff) | |
| download | go-510e711dd36999f1800678909bb7fdb448aa074f.tar.xz | |
[dev.fuzz] testing,internal/fuzz: prevent unbounded memory growth
Usage of f.testContext.match.fullName to generate the test name causes
unbounded memory growth, eventually causing the fuzzer to slow down
as memory pressure increases.
Each time fuzzFn is invoked it generates a unique string and stores it
in a map. With the fuzzer running at around 100k executions per second
this consumed around ~30GB of memory in a handful of minutes.
Instead just use the base name of the test for mutated inputs, a special
name for seeded inputs, and the filename for inputs from the input
corpus.
Change-Id: I083f47df7e82f0c6b0bda244f158233784a13029
Reviewed-on: https://go-review.googlesource.com/c/go/+/316030
Trust: Roland Shoemaker <roland@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Diffstat (limited to 'src/testing/testing.go')
0 files changed, 0 insertions, 0 deletions
