aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-crush
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-11-21 19:02:35 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-11-21 19:02:35 +0100
commitad0af9fff5f7ffbd9597e3ffb956fae3f4292b89 (patch)
tree79599e37c513c10cfe6c9f630a26e767f29a5e3d /tools/syz-crush
parentd4d14b030efd569a3562e5cddd751ab56afda107 (diff)
vm: return Report from MonitorExecution
This allows callers to get access to Report.Corrupted. Better than adding 6-th return value and will allow to pipe other report properties if necessary.
Diffstat (limited to 'tools/syz-crush')
-rw-r--r--tools/syz-crush/crush.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/syz-crush/crush.go b/tools/syz-crush/crush.go
index b349e50bc..1d858790b 100644
--- a/tools/syz-crush/crush.go
+++ b/tools/syz-crush/crush.go
@@ -109,22 +109,18 @@ func runInstance(cfg *mgrconfig.Config, reporter report.Reporter, vmPool *vm.Poo
}
log.Logf(0, "vm-%v: crushing...", index)
- title, _, output, crashed, timedout := vm.MonitorExecution(outc, errc, reporter)
- if timedout {
+ rep, output := vm.MonitorExecution(outc, errc, reporter, false)
+ if rep == nil {
// This is the only "OK" outcome.
log.Logf(0, "vm-%v: running long enough, restarting", index)
} else {
- if !crashed {
- // syz-execprog exited, but it should not.
- title = "lost connection to test machine"
- }
f, err := ioutil.TempFile(".", "syz-crush")
if err != nil {
log.Logf(0, "failed to create temp file: %v", err)
return
}
defer f.Close()
- log.Logf(0, "vm-%v: crashed: %v, saving to %v", index, title, f.Name())
+ log.Logf(0, "vm-%v: crashed: %v, saving to %v", index, rep.Title, f.Name())
f.Write(output)
}
return