From: Jay Conrod Date: Tue, 9 Feb 2021 15:23:40 +0000 (-0500) Subject: [dev.fuzz] internal/fuzz: worker exiting 0 should not be a crasher X-Git-Tag: go1.18beta1~1282^2~99 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9b967d12a9f1a13c79104b834a17c4356585cc7a;p=gostls13.git [dev.fuzz] internal/fuzz: worker exiting 0 should not be a crasher If a worker process exits with status 0, treat it as a communication error. Previously, we treated this as a crasher, but it seems more likely to be caused by a bug in the fuzz function rather than a bug in the code being tested. Change-Id: I0c4efeaef85537f8a0e9c6def6aac41d75b2b307 Reviewed-on: https://go-review.googlesource.com/c/go/+/290690 Trust: Jay Conrod Run-TryBot: Jay Conrod TryBot-Result: Go Bot Reviewed-by: Katie Hockman --- diff --git a/src/internal/fuzz/worker.go b/src/internal/fuzz/worker.go index 8ea95438ca..9a92813f8c 100644 --- a/src/internal/fuzz/worker.go +++ b/src/internal/fuzz/worker.go @@ -96,6 +96,11 @@ func (w *worker) runFuzzing() error { w.stop() return nil } + if w.waitErr == nil { + // Worker exited 0. + w.stop() + return fmt.Errorf("worker exited unexpectedly with status 0") + } // Unexpected termination. Inform the coordinator about the crash. // TODO(jayconrod,katiehockman): if -keepfuzzing, restart worker. @@ -108,11 +113,7 @@ func (w *worker) runFuzzing() error { errMsg: message, } w.coordinator.crasherC <- crasher - err := w.stop() - if err == nil { - err = fmt.Errorf("worker exited unexpectedly") - } - return err + return w.stop() case input := <-inputC: // Received input from coordinator.