github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/pkg/report/darwin.go (about) 1 // Copyright 2021 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package report 5 6 import ( 7 "regexp" 8 9 "github.com/google/syzkaller/pkg/report/crash" 10 ) 11 12 func ctorDarwin(cfg *config) (reporterImpl, []string, error) { 13 symbolizeRes := []*regexp.Regexp{} 14 ctx, err := ctorBSD(cfg, darwinOopses, symbolizeRes) 15 return ctx, nil, err 16 } 17 18 var darwinOopses = append([]*oops{ 19 { 20 []byte("panic(cpu "), 21 []oopsFormat{ 22 { 23 title: compile("panic\\(.+\\): (assertion failed: .*), file"), 24 fmt: "panic: %[1]v", 25 }, 26 { 27 title: compile("panic\\(.+\\): Kernel trap at 0x[0-9a-f]+, (type .*), registers"), 28 fmt: "panic: Kernel trap %[1]v", 29 }, 30 { 31 title: compile("panic\\(.+\\): \"in6p_route_copyout: wrong or corrupted route:"), 32 fmt: "panic: in6p_route_copyout: wrong or corrupted route", 33 }, 34 { 35 title: compile("panic\\(.+\\): \"(zalloc:.+)\\([0-9]+ elements\\)( .*)\""), 36 fmt: "panic: %[1]v%[2]v", 37 }, 38 { 39 title: compile("panic\\(.+\\): \"(.*)\""), 40 fmt: "panic: %[1]v", 41 }, 42 { 43 title: compile("panic\\(.+\\): (.*)"), 44 fmt: "panic: %[1]v", 45 }, 46 }, 47 []*regexp.Regexp{}, 48 crash.UnknownType, 49 }, 50 { 51 []byte("Debugger: Unexpected kernel trap number:"), 52 []oopsFormat{ 53 { 54 title: compile("Debugger: (Unexpected kernel trap number: 0x[0-9a-f]+)"), 55 fmt: "debugger: %[1]v", 56 }, 57 }, 58 []*regexp.Regexp{}, 59 crash.UnknownType, 60 }, 61 &groupGoRuntimeErrors, 62 }, commonOopses...)