]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: handle SIGINT races gracefully
authorJay Conrod <jayconrod@google.com>
Fri, 15 Jan 2021 19:43:25 +0000 (14:43 -0500)
committerJay Conrod <jayconrod@google.com>
Fri, 15 Jan 2021 23:24:58 +0000 (23:24 +0000)
commit8e0584c327e429bd010edb28fb9fea6f68a4cccc
treee878b6c005a43e118ba5d1e26c51f619587d51a1
parentd45df5de32e555a0386b7e473d30516d744df70a
[dev.fuzz] internal/fuzz: handle SIGINT races gracefully

A worker process may be terminated by SIGINT if it doesn't install the
signal handler before SIGINT is delivered. That's likely when TestMain
or the fuzz target setup take a long time. The coordinator now ignores
these errors.

Also, when testdeps.TestDeps.CoordinateFuzzing and RunFuzzWorker
return, they will send a value on the chan passed to signal.Notify
instead of closing it. This should have been obvious in hindsight, but
the signal handler could still send a value on that channel after
those functions return but before the process exits.

Change-Id: Iea2589115f1f9bb7415bb5e7911defee423e642e
Reviewed-on: https://go-review.googlesource.com/c/go/+/284292
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/sys_posix.go
src/internal/fuzz/sys_unimplemented.go
src/internal/fuzz/sys_windows.go
src/internal/fuzz/worker.go
src/testing/internal/testdeps/deps.go