forked from google/syzkaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openbsd.go
79 lines (71 loc) · 1.58 KB
/
openbsd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package report
import (
"regexp"
)
type openbsd struct {
kernelSrc string
kernelObj string
ignores []*regexp.Regexp
}
func ctorOpenbsd(kernelSrc, kernelObj string, ignores []*regexp.Regexp) (Reporter, []string, error) {
ctx := &openbsd{
kernelSrc: kernelSrc,
kernelObj: kernelObj,
ignores: ignores,
}
return ctx, nil, nil
}
func (ctx *openbsd) ContainsCrash(output []byte) bool {
return containsCrash(output, openbsdOopses, ctx.ignores)
}
func (ctx *openbsd) Parse(output []byte) *Report {
return simpleLineParser(output, openbsdOopses, nil, ctx.ignores)
}
func (ctx *openbsd) Symbolize(rep *Report) error {
return nil
}
var openbsdOopses = []*oops{
{
[]byte("cleaned vnode"),
[]oopsFormat{
{
title: compile("cleaned vnode: "),
fmt: "panic: cleaned vnode isn't",
},
},
[]*regexp.Regexp{},
},
{
[]byte("uvm_fault"),
[]oopsFormat{
{
title: compile("uvm_fault\\((?:.*\\n)+?.*Stopped at[ ]+([^\\+]+)"),
fmt: "uvm_fault: %[1]v",
},
},
[]*regexp.Regexp{},
},
{
[]byte("panic"),
[]oopsFormat{
{
title: compile("panic: pool_do_put: ([^:]+): double pool_put"),
fmt: "pool: double put: %[1]v",
},
{
title: compile("panic: pool_do_get: ([^:]+) free list modified"),
fmt: "pool: free list modified: %[1]v",
},
},
[]*regexp.Regexp{},
},
{
[]byte("kernel:"),
[]oopsFormat{},
[]*regexp.Regexp{
compile("kernel relinking failed"),
},
},
}