aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux.go
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2017-12-08 15:30:35 +0100
committerAndrey Konovalov <andreyknvl@gmail.com>2017-12-08 15:53:22 +0100
commit2d8c311ede213548106d09f5d1785c2cb21d06e5 (patch)
tree6cd43272ad143d40215a24c6e2fadc23e3820c8d /pkg/report/linux.go
parent20860a992ac27eabc83b227601b1be1c8dc293f0 (diff)
pkg/report: fix corrupted call trace detection
linuxSymbolizeRe can match "IP: depot_fetch_stack+0x11/0x40", which is not part of the call stack trace. Add another regexp that only matches frames.
Diffstat (limited to 'pkg/report/linux.go')
-rw-r--r--pkg/report/linux.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index 352872366..d0be1acd8 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -396,7 +396,7 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) bo
corrupted := true
// Check that at least one of the next 10 lines contains a frame.
for i := 0; i < 10 && i < len(frames); i++ {
- if bytes.Contains(frames[i], []byte("(stack is not available)")) || linuxSymbolizeRe.Match(frames[i]) {
+ if bytes.Contains(frames[i], []byte("(stack is not available)")) || stackFrameRe.Match(frames[i]) {
corrupted = false
break
}
@@ -411,6 +411,7 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) bo
var (
filenameRe = regexp.MustCompile(`[a-zA-Z0-9_\-\./]*[a-zA-Z0-9_\-]+\.(c|h):[0-9]+`)
linuxSymbolizeRe = regexp.MustCompile(`(?:\[\<(?:[0-9a-f]+)\>\])?[ \t]+(?:[0-9]+:)?([a-zA-Z0-9_.]+)\+0x([0-9a-f]+)/0x([0-9a-f]+)`)
+ stackFrameRe = regexp.MustCompile(`^ *(?:\[\<(?:[0-9a-f]+)\>\])?[ \t]+(?:[0-9]+:)?([a-zA-Z0-9_.]+)\+0x([0-9a-f]+)/0x([0-9a-f]+)`)
lineNumRe = regexp.MustCompile(`(:[0-9]+)+`)
addrRe = regexp.MustCompile(`([^a-zA-Z])(?:0x)?[0-9a-f]{8,}`)
decNumRe = regexp.MustCompile(`([^a-zA-Z])[0-9]{5,}`)