diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-02-12 11:26:51 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-02-12 11:26:51 +0100 |
| commit | 88bc17df053022a7c2a3753b299b06a9eff19c1a (patch) | |
| tree | 9f77901024d6d2563a327da9e5fa5b297489c52b /pkg/report/linux.go | |
| parent | 4e9b726d97da090a8487a742536eaf1cc5880c16 (diff) | |
pkg/report: improve corrupted report detection
Detect informational kernel reports that are not bugs in itself,
but contain stack traces. If we see them in the middle of another
report, we know stacks are intermixed and the report is potentially
corrupted.
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go index e0f47df54..1892f2266 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -19,16 +19,17 @@ import ( ) type linux struct { - kernelSrc string - kernelObj string - vmlinux string - symbols map[string][]symbolizer.Symbol - ignores []*regexp.Regexp - consoleOutputRe *regexp.Regexp - questionableRe *regexp.Regexp - guiltyFileBlacklist []*regexp.Regexp - reportStartIgnores [][]byte - eoi []byte + kernelSrc string + kernelObj string + vmlinux string + symbols map[string][]symbolizer.Symbol + ignores []*regexp.Regexp + consoleOutputRe *regexp.Regexp + questionableRe *regexp.Regexp + guiltyFileBlacklist []*regexp.Regexp + reportStartIgnores [][]byte + infoMessagesWithStack [][]byte + eoi []byte } func ctorLinux(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, @@ -84,6 +85,13 @@ func ctorLinux(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symb []byte("invalid opcode: 0000"), []byte("Kernel panic - not syncing: panic_on_warn set"), } + // These pattern math kernel reports which are not bugs in itself but contain stack traces. + // If we see them in the middle of another report, we know that the report is potentially corrupted. + ctx.infoMessagesWithStack = [][]byte{ + []byte("vmalloc: allocation failure:"), + []byte("FAULT_INJECTION: forcing a failure"), + []byte("FAULT_FLAG_ALLOW_RETRY missing"), + } return ctx, nil } @@ -114,6 +122,14 @@ func (ctx *linux) Parse(output []byte) *Report { for _, oops1 := range linuxOopses { match := matchOops(line, oops1, ctx.ignores) if match == -1 { + if oops != nil && secondReportPos == 0 { + for _, pattern := range ctx.infoMessagesWithStack { + if bytes.Contains(line, pattern) { + secondReportPos = pos + break + } + } + } continue } if oops == nil { @@ -878,6 +894,17 @@ var linuxOopses = []*oops{ fmt: "INFO: rcu detected stall in %[1]v", stack: &stackFmt{ parts: []*regexp.Regexp{ + compile("apic_timer_interrupt"), + parseStackTrace, + }, + skip: []string{"apic_timer_interrupt", "rcu"}, + }, + }, + { + title: linuxRcuStall, + fmt: "INFO: rcu detected stall in %[1]v", + stack: &stackFmt{ + parts: []*regexp.Regexp{ linuxRipFrame, parseStackTrace, }, |
