aboutsummaryrefslogtreecommitdiff
path: root/go/patch/go6.patch
diff options
context:
space:
mode:
Diffstat (limited to 'go/patch/go6.patch')
-rw-r--r--go/patch/go6.patch261
1 files changed, 213 insertions, 48 deletions
diff --git a/go/patch/go6.patch b/go/patch/go6.patch
index 7f1e4c0e..9f32ed84 100644
--- a/go/patch/go6.patch
+++ b/go/patch/go6.patch
@@ -1,65 +1,230 @@
-runtime: deadlock detection does not work when using external linker.
+all: disable some tests that have trouble running remotely.
---- src/runtime/crash_test.go
-+++ src/runtime/crash_test.go
-@@ -177,22 +177,27 @@ func testDeadlock(t *testing.T, name string) {
+--- src/encoding/gob/encoder_test.go
++++ src/encoding/gob/encoder_test.go
+@@ -1125,20 +1125,17 @@ func TestBadData(t *testing.T) {
+ if !strings.Contains(err.Error(), test.error) {
+ t.Errorf("#%d: decode: expected %q error, got %s", i, test.error, err.Error())
+ }
+ }
+ }
+
+ // TestHugeWriteFails tests that enormous messages trigger an error.
+ func TestHugeWriteFails(t *testing.T) {
+- if testing.Short() {
+- // Requires allocating a monster, so don't do this from all.bash.
+- t.Skip("skipping huge allocation in short mode")
+- }
++ t.Skip("skipping test due to huge memory requirement")
+ huge := make([]byte, tooBig)
+ huge[0] = 7 // Make sure it's not all zeros.
+ buf := new(bytes.Buffer)
+ err := NewEncoder(buf).Encode(huge)
+ if err == nil {
+ t.Fatalf("expected error for huge slice")
+ }
+ if !strings.Contains(err.Error(), "message too big") {
+--- src/runtime/crash_cgo_test.go
++++ src/runtime/crash_cgo_test.go
+@@ -246,20 +246,17 @@ func TestCgoCCodeSIGPROF(t *testing.T) {
+ got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF")
+ want := "OK\n"
+ if got != want {
+ t.Errorf("expected %q got %v", want, got)
+ }
}
- func TestSimpleDeadlock(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- testDeadlock(t, "SimpleDeadlock")
+ func TestCgoCrashTraceback(t *testing.T) {
+- t.Parallel()
+- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") {
+- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
+- }
++ t.Skipf("skip running remotely")
+ got := runTestProg(t, "testprogcgo", "CrashTraceback")
+ for i := 1; i <= 3; i++ {
+ if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) {
+ t.Errorf("missing cgo symbolizer:%d", i)
+ }
+ }
}
- func TestInitDeadlock(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- testDeadlock(t, "InitDeadlock")
+@@ -268,20 +265,17 @@ func TestCgoTracebackContext(t *testing.T) {
+ got := runTestProg(t, "testprogcgo", "TracebackContext")
+ want := "OK\n"
+ if got != want {
+ t.Errorf("expected %q got %v", want, got)
+ }
}
- func TestLockedDeadlock(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- testDeadlock(t, "LockedDeadlock")
+ func testCgoPprof(t *testing.T, buildArg, runArg string) {
+- t.Parallel()
+- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") {
+- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
+- }
++ t.Skipf("skip pprof test")
+ testenv.MustHaveGoRun(t)
+
+ exe, err := buildTestProg(t, "testprogcgo", buildArg)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, runArg)).CombinedOutput()
+--- src/runtime/crash_test.go
++++ src/runtime/crash_test.go
+@@ -476,16 +476,17 @@ func TestPanicDeadlockSyscall(t *testing.T) {
+ func TestPanicLoop(t *testing.T) {
+ output := runTestProg(t, "testprog", "PanicLoop")
+ if want := "panic while printing panic value"; !strings.Contains(output, want) {
+ t.Errorf("output does not contain %q:\n%s", want, output)
+ }
+ }
+
+ func TestMemPprof(t *testing.T) {
++ t.Skipf("skip pprof test")
+ testenv.MustHaveGoRun(t)
+
+ exe, err := buildTestProg(t, "testprog")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, "MemProf")).CombinedOutput()
+--- src/runtime/crash_unix_test.go
++++ src/runtime/crash_unix_test.go
+@@ -169,19 +169,17 @@ func loop(i int, c chan bool) {
+
+ func TestPanicSystemstack(t *testing.T) {
+ // Test that GOTRACEBACK=crash prints both the system and user
+ // stack of other threads.
+
+ // The GOTRACEBACK=crash handler takes 0.1 seconds even if
+ // it's not writing a core file and potentially much longer if
+ // it is. Skip in short mode.
+- if testing.Short() {
+- t.Skip("Skipping in short mode (GOTRACEBACK=crash is slow)")
+- }
++ t.Skip("Skipping (GOTRACEBACK=crash hangs on arm)")
+
+ if runtime.Sigisblocked(int(syscall.SIGQUIT)) {
+ t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196")
+ }
+
+ t.Parallel()
+ cmd := exec.Command(os.Args[0], "testPanicSystemstackInternal")
+ cmd = testenv.CleanCmdEnv(cmd)
+@@ -239,16 +237,17 @@ func init() {
}
- func TestLockedDeadlock2(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- testDeadlock(t, "LockedDeadlock2")
+ func testPanicSystemstackInternal() {
+ runtime.BlockOnSystemStack()
+ os.Exit(1) // Should be unreachable.
}
- func TestGoexitDeadlock(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- output := runTestProg(t, "testprog", "GoexitDeadlock")
- want := "no goroutines (main called runtime.Goexit) - deadlock!"
- if !strings.Contains(output, want) {
-@@ -229,6 +234,7 @@ panic: again
+ func TestSignalExitStatus(t *testing.T) {
++ t.Skipf("skip running remotely")
+ testenv.MustHaveGoBuild(t)
+ exe, err := buildTestProg(t, "testprog")
+ if err != nil {
+ t.Fatal(err)
+ }
+ err = testenv.CleanCmdEnv(goExecCmd(exe, "SignalExitStatus")).Run()
+ if err == nil {
+ t.Error("test program succeeded unexpectedly")
+--- src/runtime/fastlog2_test.go
++++ src/runtime/fastlog2_test.go
+@@ -11,21 +11,17 @@ import (
+ )
+
+ func TestFastLog2(t *testing.T) {
+ // Compute the euclidean distance between math.Log2 and the FastLog2
+ // implementation over the range of interest for heap sampling.
+ const randomBitCount = 26
+ var e float64
+
+- inc := 1
+- if testing.Short() {
+- // Check 1K total values, down from 64M.
+- inc = 1 << 16
+- }
++ inc := 1 << 16
+ for i := 1; i < 1<<randomBitCount; i += inc {
+ l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i))
+ d := l - fl
+ e += d * d
+ }
+ e = math.Sqrt(e)
+
+ if e > 1.0 {
+--- src/runtime/hash_test.go
++++ src/runtime/hash_test.go
+@@ -156,19 +156,17 @@ func TestSmhasherZeros(t *testing.T) {
+ for i := 0; i <= N; i++ {
+ h.addB(b[:i])
+ }
+ h.check(t)
}
- func TestGoexitCrash(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- output := runTestProg(t, "testprog", "GoexitExit")
- want := "no goroutines (main called runtime.Goexit) - deadlock!"
- if !strings.Contains(output, want) {
-@@ -285,6 +291,7 @@ func TestBreakpoint(t *testing.T) {
+ // Strings with up to two nonzero bytes all have distinct hashes.
+ func TestSmhasherTwoNonzero(t *testing.T) {
+- if testing.Short() {
+- t.Skip("Skipping in short mode")
+- }
++ t.Skip("skipping test due to huge memory requirement")
+ h := newHashSet()
+ for n := 2; n <= 16; n++ {
+ twoNonZero(h, n)
+ }
+ h.check(t)
+ }
+ func twoNonZero(h *HashSet, n int) {
+ b := make([]byte, n)
+@@ -259,19 +257,17 @@ func setbits(h *HashSet, b []byte, i int, k int) {
+ setbits(h, b, j+1, k-1)
+ b[j/8] &= byte(^(1 << uint(j&7)))
+ }
}
- func TestGoexitInPanic(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- // see issue 8774: this code used to trigger an infinite recursion
- output := runTestProg(t, "testprog", "GoexitInPanic")
- want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!"
-@@ -303,6 +310,7 @@ func TestPanicAfterGoexit(t *testing.T) {
+ // Test all possible combinations of n blocks from the set s.
+ // "permutation" is a bad name here, but it is what Smhasher uses.
+ func TestSmhasherPermutation(t *testing.T) {
+- if testing.Short() {
+- t.Skip("Skipping in short mode")
+- }
++ t.Skip("skipping test due to huge memory requirement")
+ permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7}, 8)
+ permutation(t, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 8)
+ permutation(t, []uint32{0, 1}, 20)
+ permutation(t, []uint32{0, 1 << 31}, 20)
+ permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 6)
}
+ func permutation(t *testing.T, s []uint32, n int) {
+ b := make([]byte, n*4)
+--- src/runtime/pprof/pprof_test.go
++++ src/runtime/pprof/pprof_test.go
+@@ -278,24 +278,17 @@ func profileOk(t *testing.T, need []string, prof bytes.Buffer, duration time.Dur
+ return ok
+ }
+
+ // Fork can hang if preempted with signals frequently enough (see issue 5517).
+ // Ensure that we do not do this.
+ func TestCPUProfileWithFork(t *testing.T) {
+ testenv.MustHaveExec(t)
- func TestRecoveredPanicAfterGoexit(t *testing.T) {
-+ t.Skip("deadlock detection fails with external linker")
- output := runTestProg(t, "testprog", "RecoveredPanicAfterGoexit")
- want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!"
- if !strings.HasPrefix(output, want) {
---- test/fixedbugs/bug429_run.go
-+++ test/fixedbugs/bug429_run.go
-@@ -1,5 +1,5 @@
- // +build !nacl
--// runtarget
-+// skip
-
- // Copyright 2014 The Go Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style
+- heap := 1 << 30
+- if runtime.GOOS == "android" {
+- // Use smaller size for Android to avoid crash.
+- heap = 100 << 20
+- }
+- if testing.Short() {
+- heap = 100 << 20
+- }
++ heap := 100 << 20
+ // This makes fork slower.
+ garbage := make([]byte, heap)
+ // Need to touch the slice, otherwise it won't be paged in.
+ done := make(chan bool)
+ go func() {
+ for i := range garbage {
+ garbage[i] = 42
+ }