aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--report/report.go17
-rw-r--r--report/report_test.go10
2 files changed, 23 insertions, 4 deletions
diff --git a/report/report.go b/report/report.go
index 211e49281..72a5d037d 100644
--- a/report/report.go
+++ b/report/report.go
@@ -248,16 +248,25 @@ func Parse(output []byte) (desc string, text []byte, start int, end int) {
}
func extractDescription(output []byte, oops *oops) string {
+ result := ""
+ startPos := -1
for _, format := range oops.formats {
- match := format.re.FindSubmatch(output)
+ match := format.re.FindSubmatchIndex(output)
if match == nil {
continue
}
+ if startPos != -1 && startPos <= match[0] {
+ continue
+ }
+ startPos = match[0]
var args []interface{}
- for i := 1; i < len(match); i++ {
- args = append(args, string(match[i]))
+ for i := 2; i < len(match); i += 2 {
+ args = append(args, string(output[match[i]:match[i+1]]))
}
- return fmt.Sprintf(format.fmt, args...)
+ result = fmt.Sprintf(format.fmt, args...)
+ }
+ if result != "" {
+ return result
}
pos := bytes.Index(output, oops.header)
if pos == -1 {
diff --git a/report/report_test.go b/report/report_test.go
index 4c9ae2729..ac77b4c39 100644
--- a/report/report_test.go
+++ b/report/report_test.go
@@ -335,6 +335,16 @@ BUG: soft lockup - CPU#3 stuck for 11s! [syz-executor:643]
`: `BUG: soft lockup`,
`
+BUG: spinlock lockup suspected on CPU#2, syz-executor/12636
+BUG: soft lockup - CPU#3 stuck for 11s! [syz-executor:643]
+`: `BUG: spinlock lockup suspected`,
+
+ `
+BUG: soft lockup - CPU#3 stuck for 11s! [syz-executor:643]
+BUG: spinlock lockup suspected on CPU#2, syz-executor/12636
+`: `BUG: soft lockup`,
+
+ `
BUG UNIX (Not tainted): kasan: bad access detected
`: "",
}