From 02b8de13ac3b47734b3ee784867aa753865e5397 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 11 Dec 2017 15:06:58 +0100 Subject: pkg/report: better detect corrupted stack traces We may find stack frames from the second stack trace in a report when searching from frames of the first one. --- pkg/report/linux.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 17b99aa0e..b862bf54e 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -398,7 +398,14 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) bo frames = frames[1:] corrupted := true // Check that at least one of the next 10 lines contains a frame. + outer: for i := 0; i < 10 && i < len(frames); i++ { + for _, key1 := range linuxStackKeywords { + // Next stack trace starts. + if key1.Match(frames[i]) { + break outer + } + } if bytes.Contains(frames[i], []byte("(stack is not available)")) || stackFrameRe.Match(frames[i]) { corrupted = false break -- cgit mrf-deployment