From 2a075d57ab619ae5333c823cc260a722ab0c47fe Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 21 Jun 2018 14:38:08 +0200 Subject: pkg/report: allow to specify suppressions per OS Currently all (linux-specific) suppressions are hardcoded in mgrconfig. This is very wrong. Move them to pkg/report and allow to specify per OS. Add gvisor-specific suppressions. This required a bit of refactoring. Introduce mgrconfig.KernelObj finally. Make report.NewReporter and vm.Create accept mgrconfig directly instead of passing it as multiple scattered args. Remove tools/syz-parse and it always did the same as tools/syz-symbolize. Simplify global vars in syz-manager/cover.go. Create reporter eagerly in manager. Use sort.Slice more. Overall -90 lines removed. --- pkg/report/linux.go | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 0fc67f80d..f29235b69 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -32,17 +32,15 @@ type linux struct { eoi []byte } -func ctorLinux(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, - ignores []*regexp.Regexp) (Reporter, error) { +func ctorLinux(kernelSrc, kernelObj string, ignores []*regexp.Regexp) (Reporter, []string, error) { vmlinux := "" + var symbols map[string][]symbolizer.Symbol if kernelObj != "" { vmlinux = filepath.Join(kernelObj, "vmlinux") - if symbols == nil { - var err error - symbols, err = symbolizer.ReadSymbols(vmlinux) - if err != nil { - return nil, err - } + var err error + symbols, err = symbolizer.ReadSymbols(vmlinux) + if err != nil { + return nil, nil, err } } ctx := &linux{ @@ -95,7 +93,23 @@ func ctorLinux(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symb []byte("FAULT_INJECTION: forcing a failure"), []byte("FAULT_FLAG_ALLOW_RETRY missing"), } - return ctx, nil + suppressions := []string{ + "fatal error: runtime: out of memory", + "fatal error: runtime: cannot allocate memory", + "panic: failed to start executor binary", + "panic: executor failed: pthread_create failed", + "panic: failed to create temp dir", + "fatal error: unexpected signal during runtime execution", // presubmably OOM turned into SIGBUS + "signal SIGBUS: bus error", // presubmably OOM turned into SIGBUS + "Out of memory: Kill process .* \\(syz-fuzzer\\)", + "Out of memory: Kill process .* \\(sshd\\)", + "Killed process .* \\(syz-fuzzer\\)", + "Killed process .* \\(sshd\\)", + "lowmemorykiller: Killing 'syz-fuzzer'", + "lowmemorykiller: Killing 'sshd'", + "INIT: PANIC: segmentation violation!", + } + return ctx, suppressions, nil } func (ctx *linux) ContainsCrash(output []byte) bool { -- cgit mrf-deployment