diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-07-18 16:31:27 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-07-18 18:00:03 +0200 |
| commit | 0107e4124d76088695cc3c6132072a3e604121a4 (patch) | |
| tree | f7f9414cd35978245b37169bb480053ca155be26 /pkg | |
| parent | 012622d3c9466f5dc2bd0ca47c53498fbb167e3e (diff) | |
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.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/repro/repro.go | 9 |
1 files changed, 6 insertions, 3 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 |
