diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2022-10-02 14:52:10 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-10-04 10:53:17 +0200 |
| commit | 1363913cf7f6f203cff0ed1c9dc1269c492e68cf (patch) | |
| tree | 745bc1cc9f4f68cbdfd9fa210822a5081e44fd8a /pkg | |
| parent | 7172c3be29dd2772bb7f163c43dce844d5884bf9 (diff) | |
pkg/report: better replace numbers
Currently "./syzkaller-testdir264563108" is replaced with "./syzkaller-testdir2ADDR".
That's due to a bug in the ADDR replacement rule. Fix it.
Also improve NUM replement b/c currently "testdir264563108" is considered
as it can be a function name.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/report/report.go | 9 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/report/660 | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/pkg/report/report.go b/pkg/report/report.go index 179c38541..951478d8d 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -334,7 +334,7 @@ var dynamicTitleReplacement = []replacement{ { // Replace that everything looks like an address with "ADDR", // addresses in descriptions can't be good regardless of the oops regexps. - regexp.MustCompile(`([^a-zA-Z0])(?:0x)?[0-9a-f]{6,}`), + regexp.MustCompile(`([^a-zA-Z0-9])(?:0x)?[0-9a-f]{6,}`), "${1}ADDR", }, { @@ -365,6 +365,13 @@ var dynamicTitleReplacement = []replacement{ regexp.MustCompile(`(\W)(\d+)(\W|$)`), "${1}NUM${3}", }, + { + // Some decimal numbers can be a part of a function name, + // we need to preserve them (e.g. cfg80211* or nl802154*). + // However, if the number is too long, it's probably something else. + regexp.MustCompile(`(\d+){7,}`), + "NUM", + }, } func sanitizeTitle(title string) string { diff --git a/pkg/report/testdata/linux/report/660 b/pkg/report/testdata/linux/report/660 new file mode 100644 index 000000000..efa87f75e --- /dev/null +++ b/pkg/report/testdata/linux/report/660 @@ -0,0 +1,5 @@ +TITLE: SYZFATAL: executor NUM failed NUM times: failed to create temp dir: mkdir ./syzkaller-testdirNUM: read-only file system +ALT: SYZFATAL + +2022/10/02 11:34:15 SYZFATAL: executor 4 failed 11 times: failed to create temp dir: mkdir ./syzkaller-testdir264563108: read-only file system + |
