From 80b6c954f8daa8d9910698be9eca6d97284a75a0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 19 Dec 2016 17:39:03 +0100 Subject: manager: add ability to ignore bugs Add new config parameter "ignores" which contains list of regexp expressions. If one of the expressions is matched against oops line, crash report is not saved and VM is not restarted. --- vm/vm.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vm') diff --git a/vm/vm.go b/vm/vm.go index d42ddd4cd..ce4138344 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "os" + "regexp" "syscall" "time" @@ -86,7 +87,7 @@ func LongPipe() (io.ReadCloser, io.WriteCloser, error) { var TimeoutErr = errors.New("timeout") -func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput bool) (desc string, text, output []byte, crashed, timedout bool) { +func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput bool, ignores []*regexp.Regexp) (desc string, text, output []byte, crashed, timedout bool) { waitForOutput := func() { dur := time.Second if needOutput { @@ -117,10 +118,10 @@ func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput b if bytes.Contains(output, []byte("SYZ-FUZZER: PREEMPTED")) { return "preempted", nil, nil, false, true } - if !report.ContainsCrash(output[matchPos:]) { + if !report.ContainsCrash(output[matchPos:], ignores) { return defaultError, nil, output, true, false } - desc, text, start, end := report.Parse(output[matchPos:]) + desc, text, start, end := report.Parse(output[matchPos:], ignores) start = start + matchPos - beforeContext if start < 0 { start = 0 @@ -162,7 +163,7 @@ func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput b if bytes.Index(output[matchPos:], []byte("executed programs:")) != -1 { // syz-execprog output lastExecuteTime = time.Now() } - if report.ContainsCrash(output[matchPos:]) { + if report.ContainsCrash(output[matchPos:], ignores) { return extractError("") } if len(output) > 2*beforeContext { -- cgit mrf-deployment