aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-repro
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-11-05 17:33:59 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-11-13 10:32:10 +0000
commit5ad1a162959d6df7712dc93cffe128322b11d7af (patch)
treec9da9e418df1605fff5eb07d6f90a74a9bee4e6b /tools/syz-repro
parent8acebd3f596375b3c8c34ee8f9000a344064295a (diff)
pkg/repro: accept a cancellable context
Refactor pkg/repro to accept a context.Context object. This will make it look more similar to other package interfaces and will eventually let us abort currently running repro jobs without having to shut down the whole application. Simplify the code by factoring out the parameters common both to RunSyzRepro() and RunCRepro().
Diffstat (limited to 'tools/syz-repro')
-rw-r--r--tools/syz-repro/repro.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/syz-repro/repro.go b/tools/syz-repro/repro.go
index 220170599..d47b75698 100644
--- a/tools/syz-repro/repro.go
+++ b/tools/syz-repro/repro.go
@@ -67,7 +67,12 @@ func main() {
go func() {
defer done()
- res, stats, err := repro.Run(data, cfg, flatrpc.AllFeatures, reporter, pool)
+ res, stats, err := repro.Run(ctx, data, repro.Environment{
+ Config: cfg,
+ Features: flatrpc.AllFeatures,
+ Reporter: reporter,
+ Pool: pool,
+ })
if err != nil {
log.Logf(0, "reproduction failed: %v", err)
}