From 95003e97d969ca5c4637325fdcb4f4b5757b5673 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 22 Oct 2024 10:00:12 +0200 Subject: pkg/report: improve Bad page state parsing Take a frame from the stack trace that is included in the bug report. --- pkg/report/linux.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 8a6cc7573..ca27c00e0 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -1330,6 +1330,7 @@ var linuxStackParams = &stackParams{ "__fortify_report", "cleanup_srcu_struct", "rhashtable_lookup", + "extract_(user|iter)_to_sg", }, corruptedLines: []*regexp.Regexp{ // Fault injection stacks are frequently intermixed with crash reports. @@ -1634,8 +1635,21 @@ var linuxOopses = append([]*oops{ alt: []string{"BUG: Dentry still in use [%[1]v of %[2]v]"}, }, { - title: compile("BUG: Bad page state"), - fmt: "BUG: Bad page state", + title: compile("BUG: Bad page (state|cache)"), + fmt: "BUG: Bad page %[1]v in %[2]v", + stack: &stackFmt{ + // TODO: on arm64, for some reason we don't see the page origin backtrace. + // We see the stack trace where the bug was detected, but we consider it to be + // not sufficient to reliably group crashes. + // So Bad page reports on arm64 for now will end up marked as corrupted. + parts: []*regexp.Regexp{ + compile(`page last allocated`), + parseStackTrace, + }, + skip: []string{"(free|put|get|update|release)_page", + "free_unref", "^_*folio", "truncate_inode_pages", + "page_frag_free", "alloc", "vmap"}, + }, }, { title: compile("BUG: Bad page map"), -- cgit mrf-deployment