diff options
| -rw-r--r-- | pkg/repro/repro.go | 9 | ||||
| -rw-r--r-- | syz-manager/manager.go | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index bce549b0a..128ad7c2f 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -36,9 +36,10 @@ type Result struct { Opts csource.Options CRepro bool Stats Stats - // Description and report of the final crash that we reproduced. + // Description, log and report of the final crash that we reproduced. // Can be different from what we started reproducing. Desc string + Log []byte Report []byte } @@ -49,6 +50,7 @@ type context struct { bootRequests chan int stats Stats desc string + log []byte report []byte } @@ -142,6 +144,7 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, vmPool *vm.Pool, vmIndexes []in ctx.reproLog(3, "repro crashed as:\n%s", string(ctx.report)) res.Stats = ctx.stats res.Desc = ctx.desc + res.Log = ctx.log res.Report = ctx.report } @@ -665,13 +668,13 @@ func (ctx *context) testImpl(inst *vm.Instance, command string, duration time.Du if err != nil { return false, fmt.Errorf("failed to run command in VM: %v", err) } - desc, report, output, crashed, timedout := vm.MonitorExecution(outc, errc, false, ctx.cfg.ParsedIgnores) - _, _, _ = report, output, timedout + desc, report, output, crashed, _ := vm.MonitorExecution(outc, errc, false, ctx.cfg.ParsedIgnores) if !crashed { ctx.reproLog(2, "program did not crash") return false, nil } ctx.desc = desc + ctx.log = output ctx.report = report ctx.reproLog(2, "program crashed: %v", desc) return true, nil diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 033de3e2f..b4b8941e2 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -627,10 +627,13 @@ func (mgr *Manager) saveRepro(res *repro.Result) { if len(mgr.cfg.Tag) > 0 { osutil.WriteFile(filepath.Join(dir, "repro.tag"), []byte(mgr.cfg.Tag)) } + if len(res.Log) > 0 { + osutil.WriteFile(filepath.Join(dir, "repro.log"), res.Log) + } if len(res.Report) > 0 { - osutil.WriteFile(filepath.Join(dir, "repro.report"), []byte(res.Report)) + osutil.WriteFile(filepath.Join(dir, "repro.report"), res.Report) } - osutil.WriteFile(filepath.Join(dir, "repro.log"), res.Stats.Log) + osutil.WriteFile(filepath.Join(dir, "repro.stats.log"), res.Stats.Log) stats := fmt.Sprintf("Extracting prog: %s\nMinimizing prog: %s\nSimplifying prog options: %s\nExtracting C: %s\nSimplifying C: %s\n", res.Stats.ExtractProgTime, res.Stats.MinimizeProgTime, res.Stats.SimplifyProgTime, res.Stats.ExtractCTime, res.Stats.SimplifyCTime) osutil.WriteFile(filepath.Join(dir, "repro.stats"), []byte(stats)) @@ -664,7 +667,7 @@ func (mgr *Manager) saveRepro(res *repro.Result) { BuildID: mgr.cfg.Tag, Title: res.Desc, Maintainers: maintainers, - Log: nil, + Log: res.Log, Report: res.Report, ReproOpts: []byte(fmt.Sprintf("%+v", res.Opts)), ReproSyz: []byte(res.Prog.Serialize()), |
