aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report
diff options
context:
space:
mode:
authorPimyn Girgis <pimyn@google.com>2025-10-10 11:37:05 +0000
committerAleksandr Nogikh <nogikh@google.com>2025-11-03 13:16:21 +0000
commit367d6e2f26472340aebf50604137461000c681dd (patch)
tree0067114ae56a08a2ab8753f0ab6b229fd1800cd6 /pkg/report
parent1af1d42184f80e747e141852ef0dd2b35644c8a4 (diff)
pkg/report: support optional CRC in backtrace lines
At some point kmemleak started adding a CRC checksum to the "backtrace:" line in memory leak reports. The existing regular expression did not account for this, causing parsing to fail for these reports. Update the regex to make the CRC component optional, allowing reports both with and without the checksum to be parsed correctly.
Diffstat (limited to 'pkg/report')
-rw-r--r--pkg/report/linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index fdf960015..ace1d5ac4 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -1148,7 +1148,8 @@ var linuxStackParams = &stackParams{
regexp.MustCompile(`Freed:`),
regexp.MustCompile(`Freed by task [0-9]+:`),
// Match 'backtrace:', but exclude 'stack backtrace:'
- regexp.MustCompile(`[^k] backtrace:`),
+ // Also match optional crc hash for KMEMLEAK reports.
+ regexp.MustCompile(`[^k] backtrace(?: \(crc [[:xdigit:]]*\))?:`),
regexp.MustCompile(`Backtrace:`),
regexp.MustCompile(`Uninit was stored to memory at`),
},
@@ -1754,7 +1755,7 @@ var linuxOopses = append([]*oops{
fmt: "memory leak in %[1]v",
stack: &stackFmt{
parts: []*regexp.Regexp{
- compile("backtrace:"),
+ compile("backtrace(?: \\(crc [[:xdigit:]]*\\))?:"),
parseStackTrace,
},
skip: []string{"kmemleak", "mmap", "kmem", "slab", "alloc", "create_object",