diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2023-02-22 07:53:26 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2023-02-22 11:30:20 +0100 |
| commit | 409945bc8fab54efa11597029f5c9704bf0cbc22 (patch) | |
| tree | 68fb9518ea4717056cd54c5afab3673645b8d2bf /pkg | |
| parent | 42a4d50890beed97e5e9868be922faa6285f4a12 (diff) | |
pkg/report: improve Go throw/panic parsing
This several small improvements:
1. Move these patterns into the common part.
We run Go code on (almost) all OSes and error messages
are the same for all of them.
2. Detect "fatal error:" as a bug as well.
This is what I currently see from Go 1.20 runtime,
but we don't recognize it, so these reports probably
go into "lost connection" bucket now (bad).
3. Add a pattern for panic(ENOMEM) message.
pkg/image/compression_optimized.go can produce it
on mmap failure.
4. Add tests.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/report/gvisor.go | 3 | ||||
| -rw-r--r-- | pkg/report/linux.go | 2 | ||||
| -rw-r--r-- | pkg/report/report.go | 23 | ||||
| -rw-r--r-- | pkg/report/testdata/all/report/6 | 10 | ||||
| -rw-r--r-- | pkg/report/testdata/all/report/7 | 15 |
5 files changed, 47 insertions, 6 deletions
diff --git a/pkg/report/gvisor.go b/pkg/report/gvisor.go index 3d5da6b85..6c4bb794a 100644 --- a/pkg/report/gvisor.go +++ b/pkg/report/gvisor.go @@ -17,9 +17,6 @@ func ctorGvisor(cfg *config) (reporterImpl, []string, error) { config: cfg, } suppressions := []string{ - "fatal error: runtime: out of memory", - "fatal error: runtime: cannot allocate memory", - "fatal error: newosproc", "panic: ptrace sysemu failed: no such process", // OOM kill `panic: ptrace (s|g)et fpregs.* failed: no such process`, // OOM kill `panic: ptrace (s|g)et regs.* failed: no such process`, // OOM kill diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 320f5b148..df955b748 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -115,8 +115,6 @@ func ctorLinux(cfg *config) (reporterImpl, []string, error) { []byte("FAULT_FLAG_ALLOW_RETRY missing"), } suppressions := []string{ - "fatal error: runtime: out of memory", - "fatal error: runtime: cannot allocate memory", "panic: failed to start executor binary", "panic: executor failed: pthread_create failed", "panic: failed to create temp dir", diff --git a/pkg/report/report.go b/pkg/report/report.go index 77244fcd9..0a2b6be40 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -128,7 +128,17 @@ func NewReporter(cfg *mgrconfig.Config) (*Reporter, error) { if err != nil { return nil, err } - supps, err := compileRegexps(append(suppressions, cfg.Suppressions...)) + suppressions = append(suppressions, []string{ + // Go runtime OOM messages: + "fatal error: runtime: out of memory", + "fatal error: runtime: cannot allocate memory", + "fatal error: out of memory", + "fatal error: newosproc", + // Panic with ENOMEM err: + "panic: .*cannot allocate memory", + }...) + suppressions = append(suppressions, cfg.Suppressions...) + supps, err := compileRegexps(suppressions) if err != nil { return nil, err } @@ -820,4 +830,15 @@ var commonOopses = []*oops{ compile(`evtlog_status:`), }, }, + { + []byte("fatal error:"), + []oopsFormat{ + { + title: compile("fatal error:(.*)"), + fmt: "fatal error:%[1]v", + noStackTrace: true, + }, + }, + []*regexp.Regexp{}, + }, } diff --git a/pkg/report/testdata/all/report/6 b/pkg/report/testdata/all/report/6 new file mode 100644 index 000000000..f6dd5efb7 --- /dev/null +++ b/pkg/report/testdata/all/report/6 @@ -0,0 +1,10 @@ +TITLE: panic: cannot allocate memory +SUPPRESSED: Y + +panic: cannot allocate memory + +goroutine 14 [running]: +github.com/google/syzkaller/pkg/image.mustDecompress({0xc005ab4c00, 0x583, 0x600}) +syzkaller/pkg/image/compression_optimized.go:65 +0x5cb +github.com/google/syzkaller/pkg/image.MustDecompress({0xc005ab4c00, 0xc00746d400, 0x0}) +syzkaller/pkg/image/compression.go:36 +0x3b diff --git a/pkg/report/testdata/all/report/7 b/pkg/report/testdata/all/report/7 new file mode 100644 index 000000000..69be284d9 --- /dev/null +++ b/pkg/report/testdata/all/report/7 @@ -0,0 +1,15 @@ +TITLE: fatal error: out of memory +SUPPRESSED: Y + +runtime: out of memory: cannot allocate 1073741824-byte block (6446022656 in use) +fatal error: out of memory + +goroutine 1 [running]: +runtime.throw({0x4772bc?, 0x20000?}) + runtime/panic.go:1047 +0x5d fp=0xc000184e38 sp=0xc000184e08 pc=0x42ea1d +runtime.(*mcache).allocLarge(0xc0000b0a00?, 0x40000000, 0x1) + runtime/mcache.go:236 +0x178 fp=0xc000184e80 sp=0xc000184e38 pc=0x411318 +runtime.mallocgc(0x40000000, 0x46a9c0, 0x1) + runtime/malloc.go:1053 +0x4f7 fp=0xc000184ee8 sp=0xc000184e80 pc=0x40b157 + + |
