]> Cypherpunks repositories - gostls13.git/commit
internal/fuzz: avoid deadlock on duplicate entries with exec limit
authorRoland Shoemaker <roland@golang.org>
Thu, 9 Mar 2023 23:59:17 +0000 (15:59 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 10 Mar 2023 17:02:16 +0000 (17:02 +0000)
commit49588d0c555aaacb1354dced5e1fad0195ded7c6
treec44a3dbe039a8da1059a09010b37708d6b3b7632
parentf92a69f9079bc6aba242b90f185b5f40ee424fa2
internal/fuzz: avoid deadlock on duplicate entries with exec limit

If there was a execution limit enabled, and a result put us beyond that
limit, but the result expanded coverage *and* was a duplicate of an
entry already in the cache, the check if we were passed the limit would
be skipped. Since this check was inside the result check body, and we
would no longer send any new inputs, we'd never get to that check again,
causing the coordinator to just sit in an infinite loop.

This moves the check up to the top of the coordinator loop, so that it
is checked after every result is processed. Also add a cmd/go TestScript
regression test which triggered this case much more frequently.

Updates #51484

Change-Id: I7a2181051177acb853c1009beedd334a40796177
Reviewed-on: https://go-review.googlesource.com/c/go/+/475196
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/testdata/script/test_fuzz_limit_dup_entry.txt [new file with mode: 0644]
src/internal/fuzz/fuzz.go