diff options
| author | Austin Clements <austin@google.com> | 2018-07-08 00:21:27 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2018-07-08 19:25:13 +0000 |
| commit | 5cb1b1773fba1e1503493eea5c4ffa49fc5b5f08 (patch) | |
| tree | 640d23796103553d713fe07ade2667835542de95 /src/runtime | |
| parent | b001ffb864ce5486c6edbe98202d3e0687313ce2 (diff) | |
| download | go-5cb1b1773fba1e1503493eea5c4ffa49fc5b5f08.tar.xz | |
runtime: fix TestAbort on non-x86 arches
CL 122515 tightened TestAbort to look for breakpoint exceptions and
not just general signal crashes, but this only applies on x86 arches.
On non-x86 arches we use a nil pointer dereference to abort, so the
test is now failing.
This CL re-loosens TestAbort on non-x86 arches to only expect a signal
traceback.
Should fix the build on linux/arm, linux/arm64, linux/ppc64, and
linux/s390x.
Change-Id: I1065341180ab5ab4da63b406c641dcde93c9490b
Reviewed-on: https://go-review.googlesource.com/122580
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/crash_test.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go index f1229f154b..5c255efd26 100644 --- a/src/runtime/crash_test.go +++ b/src/runtime/crash_test.go @@ -648,13 +648,19 @@ func TestAbort(t *testing.T) { if strings.Contains(output, "BAD") { t.Errorf("output contains BAD:\n%s", output) } - // Check that it's a breakpoint traceback. - want := "SIGTRAP" - switch runtime.GOOS { - case "plan9": - want = "sys: breakpoint" - case "windows": - want = "Exception 0x80000003" + // Check that it's a signal traceback. + want := "PC=" + // For systems that use a breakpoint, check specifically for that. + switch runtime.GOARCH { + case "386", "amd64": + switch runtime.GOOS { + case "plan9": + want = "sys: breakpoint" + case "windows": + want = "Exception 0x80000003" + default: + want = "SIGTRAP" + } } if !strings.Contains(output, want) { t.Errorf("output does not contain %q:\n%s", want, output) |
