Commit graph

4 commits

Author SHA1 Message Date
Jay Conrod
988d0248b4 [dev.fuzz] internal/fuzz: improve handling of worker termination by signal
With this change, we'll no longer silently ignore terminations by
SIGKILL. We use SIGKILL to terminate unresponsive workers, but it can
also be delivered by the OOM killer.

When a worker is terminated by a signal not apparently due to a crash
or interruption (like SIGKILL or SIGHUP, as opposed to SIGSEGV), we'll
log a message, but we won't record a crash, since any given input is
not likely to reproduce this termination.

Fixes golang/go#46576

Change-Id: I6ef18a7cf5a457c7b9bc44cf5416378271216bfd
Reviewed-on: https://go-review.googlesource.com/c/go/+/333190
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>
TryBot-Result: Go Bot <gobot@golang.org>
2021-07-08 16:39:05 +00:00
Jay Conrod
f251d1fbb6 [dev.fuzz] testing, internal/fuzz: multiple small fixes
* Run gofmt with go1.17 build constraint changes.
* Tighten regular expressions used in tests. "ok" got some false
  positives with verbose output, so make sure it appears at the start
  of a line.
* Return err in deps.RunFuzzWorker instead of nil.
* Call common.Helper from F methods. This prevents F methods from
  appearing in stack traces.

Change-Id: I839c70ec8a9f313c1a4ea68e6bb34a4d801dd36f
Reviewed-on: https://go-review.googlesource.com/c/go/+/297032
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-03-09 18:36:29 +00:00
Jay Conrod
8e0584c327 [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>
2021-01-15 23:24:58 +00:00
Jay Conrod
a01814975c [dev.fuzz] internal/fuzz: send inputs to workers with shared memory
The coordinator process creates a temporary file for each worker. Both
coordinator and worker map the file into memory and use it for input
values. Access is synchronized with RPC over pipes.

Change-Id: I43c10d7291a8760a616b472d11c017a3a7bb19cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/263153
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
2020-12-04 19:17:29 +01:00