]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: fix deadlock with multiple workers
authorJay Conrod <jayconrod@google.com>
Wed, 17 Feb 2021 22:31:22 +0000 (17:31 -0500)
committerJay Conrod <jayconrod@google.com>
Tue, 9 Mar 2021 18:38:07 +0000 (18:38 +0000)
commit6ee1506769b24d99e27f9a6a9c99e9b7143112bf
tree9b355ce573b895539d991c1cec2c24b335cd649a
parentd4825819fe58e8531c7fcdf4ce27cec63824db25
[dev.fuzz] internal/fuzz: fix deadlock with multiple workers

CoordinateFuzzing now continues to run after discovering a crasher. It
waits until all workers have terminated before returning.

This fixes a deadlock that occurred when multiple workers discovered
crashers concurrently. CoordinateFuzzing would receive one crasher,
close doneC (telling workers to stop), then wait for workers to stop
without receiving more crashers. Other workers would block sending
crashers.

Change-Id: I55a64aac0e6e43f5e36b9d03c15051c3d5debb20
Reviewed-on: https://go-review.googlesource.com/c/go/+/293369
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
src/cmd/go/testdata/script/test_fuzz.txt
src/cmd/go/testdata/script/test_fuzz_cache.txt
src/cmd/go/testdata/script/test_fuzz_fuzztime.txt
src/cmd/go/testdata/script/test_fuzz_match.txt
src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt
src/internal/fuzz/fuzz.go
src/internal/fuzz/sys_posix.go
src/internal/fuzz/worker.go