From 0107e4124d76088695cc3c6132072a3e604121a4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 18 Jul 2017 16:31:27 +0200 Subject: pkg/repro: save final crash log Logs are useful in situations where we mess the report. Since we try to report crashes with reproducers, we need logs for reproducers. --- pkg/repro/repro.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pkg/repro') 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 -- cgit mrf-deployment