Previously, performing a SIGINT would cause the coordinator
to write a crash to testdata, and would continue to run
despite being interupted.
Also includes a few small cleanups.
Change-Id: Ia3cf7cd231c30ac9ad2a61f4935aa543e241f60d
Reviewed-on: https://go-review.googlesource.com/c/go/+/283634
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
// Return the first error found, replacing ctx.Err() if a more
// interesting error is found.
err = werr
+ break
}
}
}
w.coordinator.crasherC <- crasher
} else {
// Inform the coordinator that fuzzing found something
- // interesting (ie. a crash or new coverage).
+ // interesting (i.e. new coverage).
if resp.Interesting {
w.coordinator.interestingC <- corpusEntry{b: value}
}
// Fuzzing may be interrupted with a timeout or if the user presses ^C.
// In either case, we'll stop worker processes gracefully and save
// crashers and interesting values.
- ctx := context.Background()
- cancel := func() {}
+ ctx, cancel := context.WithCancel(context.Background())
if timeout > 0 {
ctx, cancel = context.WithTimeout(ctx, timeout)
}