diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2017-07-05 14:41:12 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@google.com> | 2017-07-05 15:40:55 +0200 |
| commit | 918a566afd8bc9e605cfc044392107e364a652cc (patch) | |
| tree | 56b8337931ee2a792f324824122b8edabf345a9d /pkg | |
| parent | ebabe267cda9c25d5789f647339d237893eed10e (diff) | |
pkg/repro: return crash report
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/repro/repro.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index eb7316982..b5e265301 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -36,6 +36,7 @@ type Result struct { Opts csource.Options CRepro bool Stats Stats + Report []byte } type context struct { @@ -44,6 +45,7 @@ type context struct { instances chan *instance bootRequests chan int stats Stats + report []byte } type instance struct { @@ -133,7 +135,9 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, vmPool *vm.Pool, vmIndexes []in res, err := ctx.repro(entries, crashStart) if res != nil { + ctx.reproLog(3, "repro crashed as:\n%s", string(ctx.report)) res.Stats = ctx.stats + res.Report = ctx.report } close(ctx.bootRequests) @@ -656,12 +660,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, text, output, crashed, timedout := vm.MonitorExecution(outc, errc, false, ctx.cfg.ParsedIgnores) - _, _, _ = text, output, timedout + desc, report, output, crashed, timedout := vm.MonitorExecution(outc, errc, false, ctx.cfg.ParsedIgnores) + _, _, _ = report, output, timedout if !crashed { ctx.reproLog(2, "program did not crash") return false, nil } + ctx.report = report ctx.reproLog(2, "program crashed: %v", desc) return true, nil } |
