aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-repro
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-07-05 15:41:55 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-07-11 09:03:37 +0000
commit6ca1eb5a578bb1421ad0f3dbde675eb34647e6d7 (patch)
tree935c35d1225bcd55b0d413796168c758734af0f9 /tools/syz-repro
parentfc2b083017012b4afbd9324fc6525e34a19aa0b3 (diff)
all: transition to instance.Pool
Rely on instance.Pool to perform fuzzing and do bug reproductions. Extract the reproduction queue logic to separate testable class.
Diffstat (limited to 'tools/syz-repro')
-rw-r--r--tools/syz-repro/repro.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/tools/syz-repro/repro.go b/tools/syz-repro/repro.go
index 1c5d18cb9..4d0426936 100644
--- a/tools/syz-repro/repro.go
+++ b/tools/syz-repro/repro.go
@@ -48,24 +48,19 @@ func main() {
if err != nil {
log.Fatalf("%v", err)
}
- vmCount := vmPool.Count()
- if *flagCount > 0 && *flagCount < vmCount {
- vmCount = *flagCount
- }
- if vmCount > 4 {
- vmCount = 4
- }
- vmIndexes := make([]int, vmCount)
- for i := range vmIndexes {
- vmIndexes[i] = i
- }
reporter, err := report.NewReporter(cfg)
if err != nil {
log.Fatalf("%v", err)
}
osutil.HandleInterrupts(vm.Shutdown)
- res, stats, err := repro.Run(data, cfg, flatrpc.AllFeatures, reporter, vmPool, vmIndexes)
+ count := vmPool.Count()
+ if *flagCount > 0 {
+ count = *flagCount
+ }
+ pool := vm.NewDispatcher(vmPool, nil)
+ pool.ReserveForRun(count)
+ res, stats, err := repro.Run(data, cfg, flatrpc.AllFeatures, reporter, pool)
if err != nil {
log.Logf(0, "reproduction failed: %v", err)
}
@@ -97,7 +92,7 @@ func main() {
recordCRepro(res, *flagCRepro)
}
if *flagStrace != "" {
- result := repro.RunStrace(res, cfg, reporter, vmPool, vmIndexes[0])
+ result := repro.RunStrace(res, cfg, reporter, pool)
recordStraceResult(result, *flagStrace)
}
}