diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-27 06:23:11 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-27 06:23:11 +0100 |
| commit | 0bbbd254473b576a405b9e7b6bae7fbe72277419 (patch) | |
| tree | 0009176aa2bfc8c8ac206c7a3b6c18ce7b0a1fc8 /pkg/report/linux.go | |
| parent | 7d95711b320580ddb0c564fb66ed8185337de272 (diff) | |
pkg/report: fix detection of questionable frames
The previous commit "pkg/report: handle cases when whole stack is questionable"
mishandles frames that start with [PC] prefix before " ? ".
Restore that part.
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 31b6be136..15047377e 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -25,6 +25,7 @@ type linux struct { consoleOutputRe *regexp.Regexp taskContext *regexp.Regexp cpuContext *regexp.Regexp + questionableFrame *regexp.Regexp guiltyFileBlacklist []*regexp.Regexp reportStartIgnores []*regexp.Regexp infoMessagesWithStack [][]byte @@ -50,6 +51,7 @@ func ctorLinux(cfg *config) (Reporter, []string, error) { ctx.consoleOutputRe = regexp.MustCompile(`^(?:\*\* [0-9]+ printk messages dropped \*\* )?(?:.* login: )?(?:\<[0-9]+\>)?\[ *[0-9]+\.[0-9]+\](\[ *(?:C|T)[0-9]+\])? `) ctx.taskContext = regexp.MustCompile(`\[ *T[0-9]+\]`) ctx.cpuContext = regexp.MustCompile(`\[ *C[0-9]+\]`) + ctx.questionableFrame = regexp.MustCompile(`(\[\<[0-9a-f]+\>\])? \? `) ctx.eoi = []byte("<EOI>") ctx.guiltyFileBlacklist = []*regexp.Regexp{ regexp.MustCompile(`.*\.h`), @@ -300,8 +302,9 @@ func (ctx *linux) stripLinePrefix(line []byte, context string, useQuestionable b line = line[start+2:] if !bytes.Contains(line, ctx.eoi) { // x86_64 prefix. - if bytes.HasPrefix(line, []byte(" ? ")) { - return line[2:], !useQuestionable + if ctx.questionableFrame.Match(line) { + pos := bytes.Index(line, []byte(" ? ")) + return line[pos+2:], !useQuestionable } // powerpc suffix. if bytes.HasSuffix(line, []byte(" (unreliable)")) { |
