aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/darwin.go
blob: 52a97ffeaf46369b3e9974ff62e5344027af35c3 (plain)
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
// Copyright 2021 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"
)

func ctorDarwin(cfg *config) (reporterImpl, []string, error) {
	symbolizeRes := []*regexp.Regexp{}
	ctx, err := ctorBSD(cfg, darwinOopses, symbolizeRes)
	return ctx, nil, err
}

var darwinOopses = append([]*oops{
	{
		[]byte("panic(cpu "),
		[]oopsFormat{
			{
				title: compile("panic\\(.+\\): (assertion failed: .*), file"),
				fmt:   "panic: %[1]v",
			},
			{
				title: compile("panic\\(.+\\): Kernel trap at 0x[0-9a-f]+, (type .*), registers"),
				fmt:   "panic: Kernel trap %[1]v",
			},
			{
				title: compile("panic\\(.+\\): \"in6p_route_copyout: wrong or corrupted route:"),
				fmt:   "panic: in6p_route_copyout: wrong or corrupted route",
			},
			{
				title: compile("panic\\(.+\\): \"(zalloc:.+)\\([0-9]+ elements\\)( .*)\""),
				fmt:   "panic: %[1]v%[2]v",
			},
			{
				title: compile("panic\\(.+\\): \"(.*)\""),
				fmt:   "panic: %[1]v",
			},
			{
				title: compile("panic\\(.+\\): (.*)"),
				fmt:   "panic: %[1]v",
			},
		},
		[]*regexp.Regexp{},
	},
	{
		[]byte("Debugger: Unexpected kernel trap number:"),
		[]oopsFormat{
			{
				title: compile("Debugger: (Unexpected kernel trap number: 0x[0-9a-f]+)"),
				fmt:   "debugger: %[1]v",
			},
		},
		[]*regexp.Regexp{},
	},
	&groupGoRuntimeErrors,
}, commonOopses...)