Skip to content

Commit 5cb1b17

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent b001ffb commit 5cb1b17

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/runtime/crash_test.go

+13-7
Original file line numberDiff line numberDiff line change
@@ -648,13 +648,19 @@ func TestAbort(t *testing.T) {
648648
if strings.Contains(output, "BAD") {
649649
t.Errorf("output contains BAD:\n%s", output)
650650
}
651-
// Check that it's a breakpoint traceback.
652-
want := "SIGTRAP"
653-
switch runtime.GOOS {
654-
case "plan9":
655-
want = "sys: breakpoint"
656-
case "windows":
657-
want = "Exception 0x80000003"
651+
// Check that it's a signal traceback.
652+
want := "PC="
653+
// For systems that use a breakpoint, check specifically for that.
654+
switch runtime.GOARCH {
655+
case "386", "amd64":
656+
switch runtime.GOOS {
657+
case "plan9":
658+
want = "sys: breakpoint"
659+
case "windows":
660+
want = "Exception 0x80000003"
661+
default:
662+
want = "SIGTRAP"
663+
}
658664
}
659665
if !strings.Contains(output, want) {
660666
t.Errorf("output does not contain %q:\n%s", want, output)

0 commit comments

Comments
 (0)