diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-16 13:53:22 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-16 13:54:07 +0100 |
| commit | c7e64e2b4f3a9d7734a92aebc53f285cd6afd94b (patch) | |
| tree | bb55753c91c0076a65424d1eaf0142ca13475004 /vm/vm.go | |
| parent | 4bc415c2305c2489109f79caf02b8a10fe5036bb (diff) | |
vm: don't call Diagnose when VM hasn't crashed
Fixes #875
Diffstat (limited to 'vm/vm.go')
| -rw-r--r-- | vm/vm.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -230,10 +230,13 @@ type monitor struct { } func (mon *monitor) extractError(defaultError string) *report.Report { + crashed := defaultError != "" || !mon.canExit + if crashed { + mon.inst.Diagnose() + } // Give it some time to finish writing the error message. - mon.inst.Diagnose() mon.waitForOutput() - if bytes.Contains(mon.output, []byte(fuzzerPreemptedStr)) { + if bytes.Contains(mon.output, []byte("SYZ-FUZZER: PREEMPTED")) { return nil } if !mon.reporter.ContainsCrash(mon.output[mon.matchPos:]) { @@ -250,6 +253,9 @@ func (mon *monitor) extractError(defaultError string) *report.Report { } return rep } + if !crashed && mon.inst.Diagnose() { + mon.waitForOutput() + } rep := mon.reporter.Parse(mon.output[mon.matchPos:]) if rep == nil { panic(fmt.Sprintf("reporter.ContainsCrash/Parse disagree:\n%s", mon.output[mon.matchPos:])) |
