diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-23 10:13:12 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-23 10:13:12 +0200 |
| commit | 21e16efbf0c83c6975bba2eef3d525ebb3fa9d09 (patch) | |
| tree | fc4a6ef071dc214b2798db5a6a425b797d413d3c /pkg/report | |
| parent | 802897bc33a8c1de05fc71453e842acaf2c1f76b (diff) | |
pkg/report: add suppressions for Go race OOMs
Diffstat (limited to 'pkg/report')
| -rw-r--r-- | pkg/report/gvisor.go | 2 | ||||
| -rw-r--r-- | pkg/report/report_test.go | 51 | ||||
| -rw-r--r-- | pkg/report/testdata/gvisor/report/13 | 12 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/report/143 | 1 |
4 files changed, 49 insertions, 17 deletions
diff --git a/pkg/report/gvisor.go b/pkg/report/gvisor.go index 488a40dad..732505f64 100644 --- a/pkg/report/gvisor.go +++ b/pkg/report/gvisor.go @@ -21,6 +21,8 @@ func ctorGvisor(kernelSrc, kernelObj string, ignores []*regexp.Regexp) (Reporter "fatal error: runtime: cannot allocate memory", "panic: failed to start executor binary", "panic: executor failed: pthread_create failed", + "ERROR: ThreadSanitizer", // Go race failing due to OOM. + "FATAL: ThreadSanitizer", } return ctx, suppressions, nil } diff --git a/pkg/report/report_test.go b/pkg/report/report_test.go index a2d833837..f3d532459 100644 --- a/pkg/report/report_test.go +++ b/pkg/report/report_test.go @@ -26,14 +26,15 @@ func TestParse(t *testing.T) { } type ParseTest struct { - FileName string - Log []byte - Title string - StartLine string - EndLine string - Corrupted bool - HasReport bool - Report []byte + FileName string + Log []byte + Title string + StartLine string + EndLine string + Corrupted bool + Suppressed bool + HasReport bool + Report []byte } func testParseFile(t *testing.T, reporter Reporter, fn string) { @@ -57,10 +58,11 @@ func testParseFile(t *testing.T, reporter Reporter, fn string) { switch phase { case phaseHeaders: const ( - titlePrefix = "TITLE: " - startPrefix = "START: " - endPrefix = "END: " - corruptedPrefix = "CORRUPTED: " + titlePrefix = "TITLE: " + startPrefix = "START: " + endPrefix = "END: " + corruptedPrefix = "CORRUPTED: " + suppressedPrefix = "SUPPRESSED: " ) switch ln := s.Text(); { case strings.HasPrefix(ln, "#"): @@ -77,7 +79,16 @@ func testParseFile(t *testing.T, reporter Reporter, fn string) { case "N": test.Corrupted = false default: - t.Fatalf("unknown corrupted value %q", v) + t.Fatalf("unknown CORRUPTED value %q", v) + } + case strings.HasPrefix(ln, suppressedPrefix): + switch v := ln[len(suppressedPrefix):]; v { + case "Y": + test.Suppressed = true + case "N": + test.Suppressed = false + default: + t.Fatalf("unknown SUPPRESSED value %q", v) } case ln == "": phase = phaseLog @@ -124,19 +135,23 @@ func testParseImpl(t *testing.T, reporter Reporter, test *ParseTest) { if rep != nil && rep.Title == "" { t.Fatalf("found crash, but title is empty") } - title, corrupted, corruptedReason := "", false, "" + title, corrupted, corruptedReason, suppressed := "", false, "", false if rep != nil { title = rep.Title corrupted = rep.Corrupted corruptedReason = rep.corruptedReason + suppressed = rep.Suppressed } - if title != test.Title || corrupted != test.Corrupted { + if title != test.Title || corrupted != test.Corrupted || suppressed != test.Suppressed { if *flagUpdate && test.StartLine == "" && test.EndLine == "" { buf := new(bytes.Buffer) fmt.Fprintf(buf, "TITLE: %v\n", title) if corrupted { fmt.Fprintf(buf, "CORRUPTED: Y\n") } + if suppressed { + fmt.Fprintf(buf, "SUPPRESSED: Y\n") + } fmt.Fprintf(buf, "\n%s", test.Log) if test.HasReport { fmt.Fprintf(buf, "REPORT:\n%s", test.Report) @@ -145,8 +160,10 @@ func testParseImpl(t *testing.T, reporter Reporter, test *ParseTest) { t.Logf("failed to update test file: %v", err) } } - t.Fatalf("want:\nTITLE: %s\nCORRUPTED: %v\ngot:\nTITLE: %s\nCORRUPTED: %v (%v)\n", - test.Title, test.Corrupted, title, corrupted, corruptedReason) + t.Fatalf("want:\nTITLE: %s\nCORRUPTED: %v\nSUPPRESSED: %v\n"+ + "got:\nTITLE: %s\nCORRUPTED: %v (%v)\nSUPPRESSED: %v\n", + test.Title, test.Corrupted, test.Suppressed, + title, corrupted, corruptedReason, suppressed) } if title != "" && len(rep.Report) == 0 { t.Fatalf("found crash message but report is empty") diff --git a/pkg/report/testdata/gvisor/report/13 b/pkg/report/testdata/gvisor/report/13 new file mode 100644 index 000000000..38fc4cf35 --- /dev/null +++ b/pkg/report/testdata/gvisor/report/13 @@ -0,0 +1,12 @@ +TITLE: FATAL ERROR: error getting processes for container: error executing in sandbox: EOF +SUPPRESSED: Y + +7:54:59 executing program 1: +linkat(0xffffffffffffffff, &(0x7f0000000100)='./file0\x00', 0xffffffffffffffff, &(0x7f0000000140)='./file0\x00', 0x0) + +==64097==ERROR: ThreadSanitizer failed to allocate 0x80000 (524288) bytes of DenseSlabAllocator (error code: 12) +FATAL: ThreadSanitizer CHECK failed: ./gotsan.cc:6532 "((0 && "unable to mmap")) != (0)" (0x0, 0x0) +W0623 07:55:00.082589 64365 x:0] FATAL ERROR: error getting processes for container: error executing in sandbox: EOF +error getting processes for container: error executing in sandbox: EOF +W0623 07:55:00.082787 64048 x:0] FATAL ERROR: error running container: err waiting on container "ci-gvisor-ptrace-proxy-sandbox-race-0": EOF +error running container: err waiting on container "ci-gvisor-ptrace-proxy-sandbox-race-0": EOF diff --git a/pkg/report/testdata/linux/report/143 b/pkg/report/testdata/linux/report/143 index 8d70a82dc..87d2368a2 100644 --- a/pkg/report/testdata/linux/report/143 +++ b/pkg/report/testdata/linux/report/143 @@ -1,4 +1,5 @@ TITLE: kernel panic: Attempted to kill init! +SUPPRESSED: Y INIT: PANIC: segmentation violation! sleeping for 30 seconds. [ 19.171696] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b |
