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 | |
| 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')
| -rw-r--r-- | pkg/report/linux.go | 7 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/report/95 | 21 |
2 files changed, 25 insertions, 3 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)")) { diff --git a/pkg/report/testdata/linux/report/95 b/pkg/report/testdata/linux/report/95 index 031cd01dc..38736ec6f 100644 --- a/pkg/report/testdata/linux/report/95 +++ b/pkg/report/testdata/linux/report/95 @@ -32,4 +32,23 @@ TITLE: BUG: spinlock already unlocked in synchronize_sched_expedited_cpu_stop [ 108.804399] [<ffffffff81338300>] ? kthread_create_on_node+0x460/0x460 [ 108.811031] [<ffffffff82d2fbac>] ret_from_fork+0x5c/0x90 [ 108.816532] [<ffffffff81338300>] ? kthread_create_on_node+0x460/0x460 - + +REPORT: +BUG: spinlock already unlocked on CPU#1, migration/1/12 + lock: rcu_sched_state+0xb40/0xc20, .magic: dead4ead, .owner: <none>/-1, .owner_cpu: -1 +CPU: 1 PID: 12 Comm: migration/1 Not tainted 4.3.5+ #6 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 + 0000000000000001 ffff8801d8f6fb30 ffffffff81d0010d ffffffff837b69c0 + ffff8801d8f68340 0000000000000003 0000000000000001 0000000000000000 + ffff8801d8f6fb70 ffffffff813fba22 0000000000000046 ffff8801d8f68b80 +Call Trace: + [<ffffffff81d0010d>] dump_stack+0xc1/0x124 + [<ffffffff813fba22>] spin_dump+0x152/0x280 + [<ffffffff813fc152>] do_raw_spin_unlock+0x1e2/0x240 + [<ffffffff810108ec>] _raw_spin_unlock_irqrestore+0x2c/0x60 + [<ffffffff813cd204>] __wake_up+0x44/0x50 + [<ffffffff8142958a>] synchronize_sched_expedited_cpu_stop+0x8a/0xa0 + [<ffffffff814dbfe8>] cpu_stopper_thread+0x1f8/0x400 + [<ffffffff8134237c>] smpboot_thread_fn+0x47c/0x880 + [<ffffffff81338531>] kthread+0x231/0x2c0 + [<ffffffff82d2fbac>] ret_from_fork+0x5c/0x90 |
