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 <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
                                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.
                                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.