aboutsummaryrefslogtreecommitdiffstats
path: root/report
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-03-10 16:40:23 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-03-10 16:40:23 +0100
commit2f41f8b5db3d4ef6c2192158f8c9948ed455d1f2 (patch)
tree7d9e7e68766d1a30b48363de0066066784e8d45a /report
parent6acb3c802d4886db5097b047d0275b4a33ce6e18 (diff)
report: replace more variable numbers with string constants
"pmd:1a700f067" -> "pmd:ADDR" "syz-executor6" -> "syz-executor"
Diffstat (limited to 'report')
-rw-r--r--report/report.go11
-rw-r--r--report/report_test.go10
2 files changed, 15 insertions, 6 deletions
diff --git a/report/report.go b/report/report.go
index fef2f30c8..0fc8f03ab 100644
--- a/report/report.go
+++ b/report/report.go
@@ -256,10 +256,11 @@ var (
consoleOutputRe = regexp.MustCompile(`^(?:\<[0-9]+\>)?\[ *[0-9]+\.[0-9]+\] `)
questionableRe = regexp.MustCompile(`(?:\[\<[0-9a-f]+\>\])? \? +[a-zA-Z0-9_.]+\+0x[0-9a-f]+/[0-9a-f]+`)
symbolizeRe = regexp.MustCompile(`(?:\[\<(?:[0-9a-f]+)\>\])? +(?:[0-9]+:)?([a-zA-Z0-9_.]+)\+0x([0-9a-f]+)/0x([0-9a-f]+)`)
- addrRe = regexp.MustCompile(`[0-9a-f]{16}`)
+ decNumRe = regexp.MustCompile(`[0-9]{5,}`)
+ addrRe = regexp.MustCompile(`[0-9a-f]{8,}`)
funcRe = regexp.MustCompile(`([a-zA-Z][a-zA-Z0-9_.]+)\+0x[0-9a-z]+/0x[0-9a-z]+`)
cpuRe = regexp.MustCompile(`CPU#[0-9]+`)
- executorRe = regexp.MustCompile(`syz-executor[0-9]+(/|:)[0-9]+`)
+ executorRe = regexp.MustCompile(`syz-executor[0-9]+((/|:)[0-9]+)?`)
eoi = []byte("<EOI>")
)
@@ -351,16 +352,18 @@ func Parse(output []byte, ignores []*regexp.Regexp) (desc string, text []byte, s
if len(desc) > 0 && desc[len(desc)-1] == '\r' {
desc = desc[:len(desc)-1]
}
+ // Executor PIDs are not interesting.
+ desc = executorRe.ReplaceAllLiteralString(desc, "syz-executor")
// Replace that everything looks like an address with "ADDR",
// addresses in descriptions can't be good regardless of the oops regexps.
desc = addrRe.ReplaceAllLiteralString(desc, "ADDR")
+ // Replace that everything looks like a decimal number with "NUM".
+ desc = decNumRe.ReplaceAllLiteralString(desc, "NUM")
// Replace all raw references to runctions (e.g. "ip6_fragment+0x1052/0x2d80")
// with just function name ("ip6_fragment"). Offsets and sizes are not stable.
desc = funcRe.ReplaceAllString(desc, "$1")
// CPU numbers are not interesting.
desc = cpuRe.ReplaceAllLiteralString(desc, "CPU")
- // Executor PIDs are not interesting.
- desc = executorRe.ReplaceAllLiteralString(desc, "syz-executor")
// Corrupted/intermixed lines can be very long.
const maxDescLen = 180
if len(desc) > maxDescLen {
diff --git a/report/report_test.go b/report/report_test.go
index 751621e29..c6aa57a05 100644
--- a/report/report_test.go
+++ b/report/report_test.go
@@ -562,7 +562,7 @@ WARNING: /etc/ssh/moduli does not exist, using fixed modulus
`
[ 76.825838] BUG: using __this_cpu_add() in preemptible [00000000] code: syz-executor0/10076
-`: `BUG: using __this_cpu_add() in preemptible [00000000] code: syz-executor`,
+`: `BUG: using __this_cpu_add() in preemptible [ADDR] code: syz-executor`,
`
[ 367.131148] BUG kmalloc-8 (Tainted: G B ): Object already free
@@ -574,7 +574,13 @@ WARNING: /etc/ssh/moduli does not exist, using fixed modulus
[ 95.445015] perf: interrupt took too long (3985 > 3976), lowering kernel.perf_event_max_sample_rate to 50000
`: ``,
- `[ 92.396607] general protection fault: 0000 [#1] [ 387.811073] audit: type=1326 audit(1486238739.637:135): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=10020 comm="syz-executor1" exe="/root/syz-executor1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x44fad9 code=0x0`: `general protection fault: 0000 [#1] [ 387.811073] audit: type=1326 audit(1486238739.637:135): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=10020 comm="syz-executor1" exe="/root/s`,
+ `[ 92.396607] general protection fault: 0000 [#1] [ 387.811073] audit: type=1326 audit(1486238739.637:135): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=10020 comm="syz-executor1" exe="/root/syz-executor1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x44fad9 code=0x0`: `general protection fault: 0000 [#1] [ 387.NUM] audit: type=1326 audit(ADDR.637:135): auid=ADDR uid=0 gid=0 ses=ADDR pid=NUM comm="syz-executor" exe="/root/syz-executor" sig=31 arch`,
+
+ `
+[ 40.438790] BUG: Bad page map in process syz-executor6 pte:ffff8801a700ff00 pmd:1a700f067
+[ 40.447217] addr:00000000009ca000 vm_flags:00100073 anon_vma:ffff8801d16f20e0 mapping: (null) index:9ca
+[ 40.457560] file: (null) fault: (null) mmap: (null) readpage: (null)
+`: `BUG: Bad page map in process syz-executor pte:ADDR pmd:ADDR`,
}
for log, crash := range tests {
if strings.Index(log, "\r\n") != -1 {