From 3a6a41868eb620912235f2dd3f9738c76035e731 Mon Sep 17 00:00:00 2001
From: Russ Cox
+On x86-64 systems, Go programs now maintain stack frame pointers
+as expected by profiling tools like Linux's perf and Intel's VTune,
+making it easier to analyze and optimize Go programs using these tools.
+The frame pointer maintenance has a small run-time overhead that varies
+but averages around 2%. We hope to reduce this cost in future releases.
+To build a toolchain that does not use frame pointers, set
+GOEXPERIMENT=noframepointer when running
+make.bash, make.bat, or make.rc.
+
From 42da35c699853002b7695052a8eeb3f10019cfd5 Mon Sep 17 00:00:00 2001
From: Keith Randall io.EOF .
+io.EOF.
@@ -532,6 +532,21 @@ that applies Huffman but not Lempel-Ziv encoding.
but at the cost of producing compressed outputs that are 20-40% larger than those
generated by the new BestSpeed.
+It is important to note that both
+BestSpeed and HuffmanOnly produce a compressed output that is RFC 1951 compliant.
+In other words, any valid DEFLATE decompressor will continue to be able to decompress these outputs.
+
+Lastly, there is a minor change to the decompressor's implementation of
+io.Reader. In previous versions,
+the decompressor deferred reporting
+io.EOF until exactly no more bytes could be read.
+Now, it reports
+io.EOF more eagerly when reading the last set of bytes.
+
req.Response.
Since Go 1, the default behavior of the HTTP client is
to request server-side compression
using the Accept-Encoding request header
-and then to uncompress the response body transparently,
+and then to decompress the response body transparently,
and this behavior is adjustable using the
Transport's DisableCompression field.
In Go 1.7, to aid the implementation of HTTP proxies, the
Response's new
Uncompressed field reports whether
-this transparent uncompression took place.
+this transparent decompression took place.
@@ -1090,7 +1105,7 @@ In previous releases of Go, if
were asked for zero bytes with no data remaining, it would
return a count of 0 and no error.
Now it returns a count of 0 and the error
-io.EOF .
+io.EOF.
From b859a78e0a71d769274dac8cf0108bdf41ec55a5 Mon Sep 17 00:00:00 2001
From: Joe Tsai
@@ -664,23 +664,15 @@ maps using keys with string types.
Go 1.7 adds support for maps using keys with integer types:
the encoding uses a quoted decimal representation as the JSON key.
Go 1.7 also adds support for encoding maps using non-string keys that implement
-MarshalJSON
-(see
-Marshaler)
-or
-MarshalText
+the MarshalText
(see
encoding.TextMarshaler)
-methods,
+method,
as well as support for decoding maps using non-string keys that implement
-UnmarshalJSON
-(see
-Unmarshaler)
-or
-UnmarshalText
+the UnmarshalText
(see
encoding.TextUnmarshaler)
-methods.
+method.
These methods are ignored for keys with string types in order to preserve
the encoding and decoding used in earlier versions of Go.
/search?).
-The
-File
-type adds a new
-Size
-method, so that File implements the new
-SizedReaderAt method.
-
It is important to note that both
-IsExists now returns true for syscall.ENOTEMPTY,
on systems where that error exists.
From d2c92f8453cab8d042b794c8ce398f6ff8e6f650 Mon Sep 17 00:00:00 2001
From: Josh Bleecher Snyder BestSpeed.
BestSpeed and HuffmanOnly produce a compressed output that is RFC 1951 compliant.
+BestSpeed and HuffmanOnly produce a compressed output that is
+RFC 1951 compliant.
In other words, any valid DEFLATE decompressor will continue to be able to decompress these outputs.
T against the dynamic type of the
expression x. As with type assertions, x must be of
interface type, and each non-interface type
T listed in a case must implement the type of x.
+The types listed in the cases of a type switch must all be
+different.
@@ -4696,6 +4698,7 @@ in the TypeSwitchGuard. The type in a case may benil; that case is used when the expression in the TypeSwitchGuard is anilinterface value. +There may be at most onenilcase.From e106122200032cdf4f0a993cdd89c7531aaf8d75 Mon Sep 17 00:00:00 2001 From: Keith Randall
Date: Tue, 31 May 2016 13:48:29 -0700 Subject: [PATCH 031/120] cmd/compile: test non-constant shifts Test all the weird shifts, like int8 shifted right by uint16. Increases coverage for shift lowerings in AMD64.rules. Change-Id: I066fe6ad6bfc05253a8d6a2ee17ff244d3a7652e Reviewed-on: https://go-review.googlesource.com/23585 Run-TryBot: Todd Neal TryBot-Result: Gobot Gobot Reviewed-by: Todd Neal --- src/cmd/compile/internal/gc/shift_test.go | 126 +++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/shift_test.go b/src/cmd/compile/internal/gc/shift_test.go index cb6be777a7..ce2eedf152 100644 --- a/src/cmd/compile/internal/gc/shift_test.go +++ b/src/cmd/compile/internal/gc/shift_test.go @@ -4,7 +4,10 @@ package gc -import "testing" +import ( + "reflect" + "testing" +) // Tests shifts of zero. @@ -905,3 +908,124 @@ func TestShiftLargeCombine3(t *testing.T) { t.Errorf("shift overflow mishandled") } } + +func TestShiftGeneric(t *testing.T) { + for _, test := range [...]struct { + valueWidth int + signed bool + shiftWidth int + left bool + f interface{} + }{ + {64, true, 64, true, func(n int64, s uint64) int64 { return n << s }}, + {64, true, 64, false, func(n int64, s uint64) int64 { return n >> s }}, + {64, false, 64, false, func(n uint64, s uint64) uint64 { return n >> s }}, + {64, true, 32, true, func(n int64, s uint32) int64 { return n << s }}, + {64, true, 32, false, func(n int64, s uint32) int64 { return n >> s }}, + {64, false, 32, false, func(n uint64, s uint32) uint64 { return n >> s }}, + {64, true, 16, true, func(n int64, s uint16) int64 { return n << s }}, + {64, true, 16, false, func(n int64, s uint16) int64 { return n >> s }}, + {64, false, 16, false, func(n uint64, s uint16) uint64 { return n >> s }}, + {64, true, 8, true, func(n int64, s uint8) int64 { return n << s }}, + {64, true, 8, false, func(n int64, s uint8) int64 { return n >> s }}, + {64, false, 8, false, func(n uint64, s uint8) uint64 { return n >> s }}, + + {32, true, 64, true, func(n int32, s uint64) int32 { return n << s }}, + {32, true, 64, false, func(n int32, s uint64) int32 { return n >> s }}, + {32, false, 64, false, func(n uint32, s uint64) uint32 { return n >> s }}, + {32, true, 32, true, func(n int32, s uint32) int32 { return n << s }}, + {32, true, 32, false, func(n int32, s uint32) int32 { return n >> s }}, + {32, false, 32, false, func(n uint32, s uint32) uint32 { return n >> s }}, + {32, true, 16, true, func(n int32, s uint16) int32 { return n << s }}, + {32, true, 16, false, func(n int32, s uint16) int32 { return n >> s }}, + {32, false, 16, false, func(n uint32, s uint16) uint32 { return n >> s }}, + {32, true, 8, true, func(n int32, s uint8) int32 { return n << s }}, + {32, true, 8, false, func(n int32, s uint8) int32 { return n >> s }}, + {32, false, 8, false, func(n uint32, s uint8) uint32 { return n >> s }}, + + {16, true, 64, true, func(n int16, s uint64) int16 { return n << s }}, + {16, true, 64, false, func(n int16, s uint64) int16 { return n >> s }}, + {16, false, 64, false, func(n uint16, s uint64) uint16 { return n >> s }}, + {16, true, 32, true, func(n int16, s uint32) int16 { return n << s }}, + {16, true, 32, false, func(n int16, s uint32) int16 { return n >> s }}, + {16, false, 32, false, func(n uint16, s uint32) uint16 { return n >> s }}, + {16, true, 16, true, func(n int16, s uint16) int16 { return n << s }}, + {16, true, 16, false, func(n int16, s uint16) int16 { return n >> s }}, + {16, false, 16, false, func(n uint16, s uint16) uint16 { return n >> s }}, + {16, true, 8, true, func(n int16, s uint8) int16 { return n << s }}, + {16, true, 8, false, func(n int16, s uint8) int16 { return n >> s }}, + {16, false, 8, false, func(n uint16, s uint8) uint16 { return n >> s }}, + + {8, true, 64, true, func(n int8, s uint64) int8 { return n << s }}, + {8, true, 64, false, func(n int8, s uint64) int8 { return n >> s }}, + {8, false, 64, false, func(n uint8, s uint64) uint8 { return n >> s }}, + {8, true, 32, true, func(n int8, s uint32) int8 { return n << s }}, + {8, true, 32, false, func(n int8, s uint32) int8 { return n >> s }}, + {8, false, 32, false, func(n uint8, s uint32) uint8 { return n >> s }}, + {8, true, 16, true, func(n int8, s uint16) int8 { return n << s }}, + {8, true, 16, false, func(n int8, s uint16) int8 { return n >> s }}, + {8, false, 16, false, func(n uint8, s uint16) uint8 { return n >> s }}, + {8, true, 8, true, func(n int8, s uint8) int8 { return n << s }}, + {8, true, 8, false, func(n int8, s uint8) int8 { return n >> s }}, + {8, false, 8, false, func(n uint8, s uint8) uint8 { return n >> s }}, + } { + fv := reflect.ValueOf(test.f) + var args [2]reflect.Value + for i := 0; i < test.valueWidth; i++ { + // Build value to be shifted. + var n int64 = 1 + for j := 0; j < i; j++ { + n <<= 1 + } + args[0] = reflect.ValueOf(n).Convert(fv.Type().In(0)) + for s := 0; s <= test.shiftWidth; s++ { + args[1] = reflect.ValueOf(s).Convert(fv.Type().In(1)) + + // Compute desired result. We're testing variable shifts + // assuming constant shifts are correct. + r := n + var op string + switch { + case test.left: + op = "<<" + for j := 0; j < s; j++ { + r <<= 1 + } + switch test.valueWidth { + case 32: + r = int64(int32(r)) + case 16: + r = int64(int16(r)) + case 8: + r = int64(int8(r)) + } + case test.signed: + op = ">>" + switch test.valueWidth { + case 32: + r = int64(int32(r)) + case 16: + r = int64(int16(r)) + case 8: + r = int64(int8(r)) + } + for j := 0; j < s; j++ { + r >>= 1 + } + default: + op = ">>>" + for j := 0; j < s; j++ { + r = int64(uint64(r) >> 1) + } + } + + // Call function. + res := fv.Call(args[:])[0].Convert(reflect.ValueOf(r).Type()) + + if res.Int() != r { + t.Errorf("%s%dx%d(%x,%x)=%x, want %x", op, test.valueWidth, test.shiftWidth, n, s, res.Int(), r) + } + } + } + } +} From fe62a9ee872d4f61a47cc4e8c7bc0fb67cc4ebb6 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 27 May 2016 19:47:55 -0700 Subject: [PATCH 032/120] crypto/tls: remove unused variable in benchmark code This fixes `go test go/types`. https://golang.org/cl/23487/ introduced this code which contains two unused variables (declared and assigned to, but never read). cmd/compile doesn't report the error due open issue #8560 (the variables are assigned to in a closure), but go/types does. The build bot only runs go/types tests in -short mode (which doesn't typecheck the std lib), hence this doesn't show up on the dashboard either. We cannot call b.Fatal and friends in the goroutine. Communicating the error to the invoking function requires a channel or a mutex. Unless the channel/sycnhronized variable is tested in each iteration that follows, the iteration blocks if there's a failure. Testing in each iteration may affect benchmark times. One could use a time-out but that time depends on the underlying system. Panicking seems good enough in this unlikely case; better than hanging or affecting benchmark times. Change-Id: Idce1172da8058e580fa3b3e398825b0eb4316325 Reviewed-on: https://go-review.googlesource.com/23528 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/crypto/tls/tls_test.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go index 47f02beeda..5b665bf532 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -481,20 +481,19 @@ func throughput(b *testing.B, totalBytes int64, dynamicRecordSizingDisabled bool N := b.N - var serr error go func() { for i := 0; i < N; i++ { sconn, err := ln.Accept() if err != nil { - serr = err - return + // panic rather than synchronize to avoid benchmark overhead + // (cannot call b.Fatal in goroutine) + panic(fmt.Errorf("accept: %v", err)) } serverConfig := *testConfig serverConfig.DynamicRecordSizingDisabled = dynamicRecordSizingDisabled srv := Server(sconn, &serverConfig) if err := srv.Handshake(); err != nil { - serr = fmt.Errorf("handshake: %v", err) - return + panic(fmt.Errorf("handshake: %v", err)) } io.Copy(srv, srv) } @@ -570,20 +569,19 @@ func latency(b *testing.B, bps int, dynamicRecordSizingDisabled bool) { N := b.N - var serr error go func() { for i := 0; i < N; i++ { sconn, err := ln.Accept() if err != nil { - serr = err - return + // panic rather than synchronize to avoid benchmark overhead + // (cannot call b.Fatal in goroutine) + panic(fmt.Errorf("accept: %v", err)) } serverConfig := *testConfig serverConfig.DynamicRecordSizingDisabled = dynamicRecordSizingDisabled srv := Server(&slowConn{sconn, bps}, &serverConfig) if err := srv.Handshake(); err != nil { - serr = fmt.Errorf("handshake: %v", err) - return + panic(fmt.Errorf("handshake: %v", err)) } io.Copy(srv, srv) } From 04acd625d7a1044c8ca78464f6727276577ffb3d Mon Sep 17 00:00:00 2001 From: Kenny Grant Date: Tue, 31 May 2016 22:30:37 +0100 Subject: [PATCH 033/120] context: fix typo in comments Change-Id: I41310ec88c889fda79d80eaf4a742a1000284f60 Reviewed-on: https://go-review.googlesource.com/23591 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/context/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/context.go b/src/context/context.go index 169db74f57..fc2a56ebff 100644 --- a/src/context/context.go +++ b/src/context/context.go @@ -107,7 +107,7 @@ type Context interface { // collisions. // // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: + // for the values stored using that key: // // // Package user defines a User type that's stored in Contexts. // package user From 2885e07c259ffda336d6965fcca03b4df617d812 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 1 Jun 2016 13:32:53 +1200 Subject: [PATCH 034/120] cmd/compile: pass process env to 'go tool compile' in compileToAsm In particular, this stops the test failing when GOROOT and GOROOT_FINAL are different. Change-Id: Ibf6cc0a173f1d965ee8aa31eee2698b223f1ceec Reviewed-on: https://go-review.googlesource.com/23620 Run-TryBot: Michael Hudson-Doyle TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/compile/internal/gc/asm_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/asm_test.go b/src/cmd/compile/internal/gc/asm_test.go index 469f0864d5..73d2e336d2 100644 --- a/src/cmd/compile/internal/gc/asm_test.go +++ b/src/cmd/compile/internal/gc/asm_test.go @@ -61,7 +61,7 @@ func compileToAsm(dir, arch, pkg string) string { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "tool", "compile", "-S", "-o", filepath.Join(dir, "out.o"), src) - cmd.Env = append(cmd.Env, "GOARCH="+arch) + cmd.Env = append([]string{"GOARCH=" + arch}, os.Environ()...) cmd.Stdout = &stdout cmd.Stderr = &stderr if err := cmd.Run(); err != nil { From 88ae6495d086ed5b0acb94d5adc49434ec47a675 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Tue, 31 May 2016 19:44:48 -0700 Subject: [PATCH 035/120] syscall: rename SysProcAttr.Unshare to Unshareflags For symmetry with Cloneflags and it looks slightly weird because there is syscall.Unshare method. Change-Id: I3d710177ca8f27c05b344407f212cbbe3435094b Reviewed-on: https://go-review.googlesource.com/23612 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Rob Pike --- src/syscall/exec_linux.go | 34 +++++++++++++++++----------------- src/syscall/exec_linux_test.go | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index 5a6b204997..4b8199a2e5 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -20,21 +20,21 @@ type SysProcIDMap struct { } type SysProcAttr struct { - Chroot string // Chroot. - Credential *Credential // Credential. - Ptrace bool // Enable tracing. - Setsid bool // Create session. - Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid. - Setctty bool // Set controlling terminal to fd Ctty (only meaningful if Setsid is set) - Noctty bool // Detach fd 0 from controlling terminal - Ctty int // Controlling TTY fd - Foreground bool // Place child's process group in foreground. (Implies Setpgid. Uses Ctty as fd of controlling TTY) - Pgid int // Child's process group ID if Setpgid. - Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only) - Cloneflags uintptr // Flags for clone calls (Linux only) - Unshare uintptr // Flags for unshare calls (Linux only) - UidMappings []SysProcIDMap // User ID mappings for user namespaces. - GidMappings []SysProcIDMap // Group ID mappings for user namespaces. + Chroot string // Chroot. + Credential *Credential // Credential. + Ptrace bool // Enable tracing. + Setsid bool // Create session. + Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid. + Setctty bool // Set controlling terminal to fd Ctty (only meaningful if Setsid is set) + Noctty bool // Detach fd 0 from controlling terminal + Ctty int // Controlling TTY fd + Foreground bool // Place child's process group in foreground. (Implies Setpgid. Uses Ctty as fd of controlling TTY) + Pgid int // Child's process group ID if Setpgid. + Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only) + Cloneflags uintptr // Flags for clone calls (Linux only) + Unshareflags uintptr // Flags for unshare calls (Linux only) + UidMappings []SysProcIDMap // User ID mappings for user namespaces. + GidMappings []SysProcIDMap // Group ID mappings for user namespaces. // GidMappingsEnableSetgroups enabling setgroups syscall. // If false, then setgroups syscall will be disabled for the child process. // This parameter is no-op if GidMappings == nil. Otherwise for unprivileged @@ -196,8 +196,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr } // Unshare - if sys.Unshare != 0 { - _, _, err1 = RawSyscall(SYS_UNSHARE, sys.Unshare, 0, 0) + if sys.Unshareflags != 0 { + _, _, err1 = RawSyscall(SYS_UNSHARE, sys.Unshareflags, 0, 0) if err1 != 0 { goto childerror } diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go index 099756328c..395dd99039 100644 --- a/src/syscall/exec_linux_test.go +++ b/src/syscall/exec_linux_test.go @@ -143,7 +143,7 @@ func TestUnshare(t *testing.T) { cmd := exec.Command("cat", "/proc/net/dev") cmd.SysProcAttr = &syscall.SysProcAttr{ - Unshare: syscall.CLONE_NEWNET, + Unshareflags: syscall.CLONE_NEWNET, } out, err := cmd.CombinedOutput() if err != nil { From ad074e205e4aa4c7762e223df65695d5157b0c4e Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Thu, 26 May 2016 11:46:19 +0200 Subject: [PATCH 036/120] regexp: use Run for benchmark Change-Id: I4d19e3221d3789d4c460b421b2d1484253778068 Reviewed-on: https://go-review.googlesource.com/23429 Reviewed-by: Robert Griesemer Run-TryBot: Marcel van Lohuizen --- src/regexp/exec_test.go | 77 +++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 46 deletions(-) diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go index 463fcf1848..69f187e38a 100644 --- a/src/regexp/exec_test.go +++ b/src/regexp/exec_test.go @@ -658,57 +658,42 @@ func makeText(n int) []byte { return text } -func benchmark(b *testing.B, re string, n int) { - r := MustCompile(re) - t := makeText(n) - b.ResetTimer() - b.SetBytes(int64(n)) - for i := 0; i < b.N; i++ { - if r.Match(t) { - b.Fatal("match!") +func BenchmarkMatch(b *testing.B) { + for _, data := range benchData { + r := MustCompile(data.re) + for _, size := range benchSizes { + t := makeText(size.n) + b.Run(data.name+"/"+size.name, func(b *testing.B) { + b.SetBytes(int64(size.n)) + for i := 0; i < b.N; i++ { + if r.Match(t) { + b.Fatal("match!") + } + } + }) } } } -const ( - easy0 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ$" - easy0i = "(?i)ABCDEFGHIJklmnopqrstuvwxyz$" - easy1 = "A[AB]B[BC]C[CD]D[DE]E[EF]F[FG]G[GH]H[HI]I[IJ]J$" - medium = "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$" - hard = "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$" - hard1 = "ABCD|CDEF|EFGH|GHIJ|IJKL|KLMN|MNOP|OPQR|QRST|STUV|UVWX|WXYZ" -) +var benchData = []struct{ name, re string }{ + {"Easy0", "ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, + {"Easy0i", "(?i)ABCDEFGHIJklmnopqrstuvwxyz$"}, + {"Easy1", "A[AB]B[BC]C[CD]D[DE]E[EF]F[FG]G[GH]H[HI]I[IJ]J$"}, + {"Medium", "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, + {"Hard", "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, + {"Hard1", "ABCD|CDEF|EFGH|GHIJ|IJKL|KLMN|MNOP|OPQR|QRST|STUV|UVWX|WXYZ"}, +} -func BenchmarkMatchEasy0_32(b *testing.B) { benchmark(b, easy0, 32<<0) } -func BenchmarkMatchEasy0_1K(b *testing.B) { benchmark(b, easy0, 1<<10) } -func BenchmarkMatchEasy0_32K(b *testing.B) { benchmark(b, easy0, 32<<10) } -func BenchmarkMatchEasy0_1M(b *testing.B) { benchmark(b, easy0, 1<<20) } -func BenchmarkMatchEasy0_32M(b *testing.B) { benchmark(b, easy0, 32<<20) } -func BenchmarkMatchEasy0i_32(b *testing.B) { benchmark(b, easy0i, 32<<0) } -func BenchmarkMatchEasy0i_1K(b *testing.B) { benchmark(b, easy0i, 1<<10) } -func BenchmarkMatchEasy0i_32K(b *testing.B) { benchmark(b, easy0i, 32<<10) } -func BenchmarkMatchEasy0i_1M(b *testing.B) { benchmark(b, easy0i, 1<<20) } -func BenchmarkMatchEasy0i_32M(b *testing.B) { benchmark(b, easy0i, 32<<20) } -func BenchmarkMatchEasy1_32(b *testing.B) { benchmark(b, easy1, 32<<0) } -func BenchmarkMatchEasy1_1K(b *testing.B) { benchmark(b, easy1, 1<<10) } -func BenchmarkMatchEasy1_32K(b *testing.B) { benchmark(b, easy1, 32<<10) } -func BenchmarkMatchEasy1_1M(b *testing.B) { benchmark(b, easy1, 1<<20) } -func BenchmarkMatchEasy1_32M(b *testing.B) { benchmark(b, easy1, 32<<20) } -func BenchmarkMatchMedium_32(b *testing.B) { benchmark(b, medium, 32<<0) } -func BenchmarkMatchMedium_1K(b *testing.B) { benchmark(b, medium, 1<<10) } -func BenchmarkMatchMedium_32K(b *testing.B) { benchmark(b, medium, 32<<10) } -func BenchmarkMatchMedium_1M(b *testing.B) { benchmark(b, medium, 1<<20) } -func BenchmarkMatchMedium_32M(b *testing.B) { benchmark(b, medium, 32<<20) } -func BenchmarkMatchHard_32(b *testing.B) { benchmark(b, hard, 32<<0) } -func BenchmarkMatchHard_1K(b *testing.B) { benchmark(b, hard, 1<<10) } -func BenchmarkMatchHard_32K(b *testing.B) { benchmark(b, hard, 32<<10) } -func BenchmarkMatchHard_1M(b *testing.B) { benchmark(b, hard, 1<<20) } -func BenchmarkMatchHard_32M(b *testing.B) { benchmark(b, hard, 32<<20) } -func BenchmarkMatchHard1_32(b *testing.B) { benchmark(b, hard1, 32<<0) } -func BenchmarkMatchHard1_1K(b *testing.B) { benchmark(b, hard1, 1<<10) } -func BenchmarkMatchHard1_32K(b *testing.B) { benchmark(b, hard1, 32<<10) } -func BenchmarkMatchHard1_1M(b *testing.B) { benchmark(b, hard1, 1<<20) } -func BenchmarkMatchHard1_32M(b *testing.B) { benchmark(b, hard1, 32<<20) } +var benchSizes = []struct { + name string + n int +}{ + {"32", 32}, + {"1K", 1 << 10}, + {"32K", 32 << 10}, + {"1M", 1 << 20}, + {"32M", 32 << 20}, +} func TestLongest(t *testing.T) { re, err := Compile(`a(|b)`) From bd2dc2d819b85beb8887466a165242e2d540e4b9 Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Wed, 1 Jun 2016 09:44:38 -0300 Subject: [PATCH 037/120] doc: rename Unshare to Unshareflags in go1.7 release notes Implementation changed in https://golang.org/cl/23612. Updates #15810 Change-Id: I8fff9e3aa3e54162546bb9ec1cc2ebba2b6d9fed Reviewed-on: https://go-review.googlesource.com/23614 Reviewed-by: Ian Lance Taylor --- doc/go1.7.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.7.html b/doc/go1.7.html index 4151300dca..9ee377ec8f 100644 --- a/doc/go1.7.html +++ b/doc/go1.7.html @@ -1131,7 +1131,7 @@ On Linux, the SysProcAttrstruct (as used inos/exec.Cmd'sSysProcAttrfield) -has a newUnsharefield. +has a newUnshareflagsfield. If the field is nonzero, the child process created byForkExec(as used inexec.Cmd'sRunmethod) From e29e0ba19af26c30c95b59aeda482e60ae594113 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 1 Jun 2016 15:13:55 +0200 Subject: [PATCH 038/120] cmd/compile: fix TestAssembly on Plan 9 Since CL 23620, TestAssembly is failing on Plan 9. In CL 23620, the process environment is passed to 'go tool compile' after setting GOARCH. On Plan 9, if GOARCH is already set in the process environment, it would take precedence. On Unix, it works as expected because the first GOARCH found takes precedence. This change uses the mergeEnvLists function from cmd/go/main.go to merge the two environment lists such that variables with the same name in "in" replace those in "out". Change-Id: Idee22058343932ee18666dda331c562c89c33507 Reviewed-on: https://go-review.googlesource.com/23593 Reviewed-by: Ian Lance TaylorRun-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/asm_test.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/asm_test.go b/src/cmd/compile/internal/gc/asm_test.go index 73d2e336d2..b44bf77c5d 100644 --- a/src/cmd/compile/internal/gc/asm_test.go +++ b/src/cmd/compile/internal/gc/asm_test.go @@ -61,7 +61,7 @@ func compileToAsm(dir, arch, pkg string) string { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "tool", "compile", "-S", "-o", filepath.Join(dir, "out.o"), src) - cmd.Env = append([]string{"GOARCH=" + arch}, os.Environ()...) + cmd.Env = mergeEnvLists([]string{"GOARCH=" + arch}, os.Environ()) cmd.Stdout = &stdout cmd.Stderr = &stderr if err := cmd.Run(); err != nil { @@ -103,3 +103,22 @@ func f(x int) int { []string{"\tSHLQ\t\\$5,", "\tLEAQ\t\\(.*\\)\\(.*\\*2\\),"}, }, } + +// mergeEnvLists merges the two environment lists such that +// variables with the same name in "in" replace those in "out". +// This always returns a newly allocated slice. +func mergeEnvLists(in, out []string) []string { + out = append([]string(nil), out...) +NextVar: + for _, inkv := range in { + k := strings.SplitAfterN(inkv, "=", 2)[0] + for i, outkv := range out { + if strings.HasPrefix(outkv, k) { + out[i] = inkv + continue NextVar + } + } + out = append(out, inkv) + } + return out +} From 52fe47247217f5126dacc5a8c8e80b85d2fb25c6 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 31 May 2016 14:55:12 -0700 Subject: [PATCH 039/120] cmd/compile: for arm, zero unaligned memory 1 byte at a time If memory might be unaligned, zero it one byte at a time instead of 4 bytes at a time. Fixes #15902 Change-Id: I4eff0840e042e2f137c1a4028f08793eb7dfd703 Reviewed-on: https://go-review.googlesource.com/23587 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Minux Ma --- src/cmd/compile/internal/arm/ggen.go | 26 ++++++++++++++++++++++++++ test/fixedbugs/issue15902.go | 27 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 test/fixedbugs/issue15902.go diff --git a/src/cmd/compile/internal/arm/ggen.go b/src/cmd/compile/internal/arm/ggen.go index d241357d62..4a45e589eb 100644 --- a/src/cmd/compile/internal/arm/ggen.go +++ b/src/cmd/compile/internal/arm/ggen.go @@ -341,6 +341,11 @@ func clearfat(nl *gc.Node) { c := w % 4 // bytes q := w / 4 // quads + if nl.Type.Align < 4 { + q = 0 + c = w + } + var r0 gc.Node r0.Op = gc.OREGISTER @@ -395,6 +400,27 @@ func clearfat(nl *gc.Node) { } } + if c > 4 { + // Loop to zero unaligned memory. + var end gc.Node + gc.Regalloc(&end, gc.Types[gc.Tptr], nil) + p := gins(arm.AMOVW, &dst, &end) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = int64(c) + + p = gins(arm.AMOVB, &nz, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 1 + p.Scond |= arm.C_PBIT + pl := p + + p = gins(arm.ACMP, &dst, nil) + raddr(&end, p) + gc.Patch(gc.Gbranch(arm.ABNE, nil, 0), pl) + + gc.Regfree(&end) + c = 0 + } var p *obj.Prog for c > 0 { p = gins(arm.AMOVB, &nz, &dst) diff --git a/test/fixedbugs/issue15902.go b/test/fixedbugs/issue15902.go new file mode 100644 index 0000000000..9511a220ed --- /dev/null +++ b/test/fixedbugs/issue15902.go @@ -0,0 +1,27 @@ +// run + +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This test makes sure we don't use 4-byte unaligned writes +// to zero memory on architectures that don't support them. + +package main + +type T struct { + a byte + b [10]byte +} + +//go:noinline +func f(t *T) { + // t will be aligned, so &t.b won't be. + t.b = [10]byte{} +} + +var t T + +func main() { + f(&t) +} From bc4fdfdbfe6b971fcceaf4d75514a882917df10d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 1 Jun 2016 09:31:31 -0700 Subject: [PATCH 040/120] os/signal: deflake TestReset/TestIgnore Fixes #15661. Change-Id: Ic3a8296fc7107f491880900ef52563e52caca1a3 Reviewed-on: https://go-review.googlesource.com/23615 Run-TryBot: Ian Lance Taylor Reviewed-by: David Crawshaw TryBot-Result: Gobot Gobot --- src/os/signal/signal_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go index 56d786e501..406102c663 100644 --- a/src/os/signal/signal_test.go +++ b/src/os/signal/signal_test.go @@ -139,6 +139,19 @@ func testCancel(t *testing.T, ignore bool) { Reset(syscall.SIGWINCH, syscall.SIGHUP) } + // At this point we do not expect any further signals on c1. + // However, it is just barely possible that the initial SIGWINCH + // at the start of this function was delivered after we called + // Notify on c1. In that case the waitSig for SIGWINCH may have + // picked up that initial SIGWINCH, and the second SIGWINCH may + // then have been delivered on the channel. This sequence of events + // may have caused issue 15661. + // So, read any possible signal from the channel now. + select { + case <-c1: + default: + } + // Send this process a SIGWINCH. It should be ignored. syscall.Kill(syscall.Getpid(), syscall.SIGWINCH) From 77026ef902d3fa21597400d230701979bc1f0efc Mon Sep 17 00:00:00 2001 From: Emmanuel Odeke Date: Sun, 22 May 2016 02:20:11 -0700 Subject: [PATCH 041/120] runtime: document heap scavenger memory summary Fixes #15212. Change-Id: I2628ec8333330721cddc5145af1ffda6f3e0c63f Reviewed-on: https://go-review.googlesource.com/23319 Reviewed-by: Austin Clements --- src/runtime/extern.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runtime/extern.go b/src/runtime/extern.go index 1df8691cfc..441dcd9702 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -82,6 +82,21 @@ It is a comma-separated list of name=val pairs setting these named variables: If the line ends with "(forced)", this GC was forced by a runtime.GC() call and all phases are STW. + Setting gctrace to any value > 0 also causes the garbage collector + to emit a summary when memory is released back to the system. + This process of returning memory to the system is called scavenging. + The format of this summary is subject to change. + Currently it is: + scvg#: # MB released printed only if non-zero + scvg#: inuse: # idle: # sys: # released: # consumed: # (MB) + where the fields are as follows: + scvg# the scavenge cycle number, incremented at each scavenge + inuse: # MB used or partially used spans + idle: # MB spans pending scavenging + sys: # MB mapped from the system + released: # MB released to the system + consumed: # MB allocated from the system + memprofilerate: setting memprofilerate=X will update the value of runtime.MemProfileRate. When set to 0 memory profiling is disabled. Refer to the description of MemProfileRate for the default value. From 5db44c17a2391bbdfbc3c04e83e66025ca5dea3d Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Wed, 1 Jun 2016 19:16:56 +0200 Subject: [PATCH 042/120] math/big: avoid panic in float.Text with negative prec Fixes #15918 Change-Id: I4b434aed262960a2e6c659d4c2296fbf662c3a52 Reviewed-on: https://go-review.googlesource.com/23633 Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer TryBot-Result: Gobot Gobot --- src/math/big/floatconv_test.go | 5 +++++ src/math/big/ftoa.go | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index b6f9993608..b2a1ab05fc 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -290,6 +290,11 @@ func TestFloat64Text(t *testing.T) { // Issue 2625. {383260575764816448, 'f', 0, "383260575764816448"}, {383260575764816448, 'g', -1, "3.8326057576481645e+17"}, + + // Issue 15918. + {1, 'f', -10, "1"}, + {1, 'f', -11, "1"}, + {1, 'f', -12, "1"}, } { // The test cases are from the strconv package which tests float64 values. // When formatting values with prec = -1 (shortest representation), diff --git a/src/math/big/ftoa.go b/src/math/big/ftoa.go index 624ea5e073..57b16e1ad1 100644 --- a/src/math/big/ftoa.go +++ b/src/math/big/ftoa.go @@ -41,8 +41,11 @@ import ( // x.Prec() mantissa bits. // The prec value is ignored for the 'b' or 'p' format. func (x *Float) Text(format byte, prec int) string { - const extra = 10 // TODO(gri) determine a good/better value here - return string(x.Append(make([]byte, 0, prec+extra), format, prec)) + cap := 10 // TODO(gri) determine a good/better value here + if prec > 0 { + cap += prec + } + return string(x.Append(make([]byte, 0, cap), format, prec)) } // String formats x like x.Text('g', 10). From bbd1dcdf7da68a3759a2d86f851391c1ec974f77 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 1 Jun 2016 13:46:49 -0700 Subject: [PATCH 043/120] cmd/compile: correctly export underlying type of predecl. error type Fixes #15920. Change-Id: I78cd79b91a58d0f7218b80f9445417f4ee071a6e Reviewed-on: https://go-review.googlesource.com/23606 Reviewed-by: Matthew Dempsky Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/bexport.go | 16 +++++++++++- src/cmd/compile/internal/gc/universe.go | 14 ++++++++--- src/go/internal/gcimporter/gcimporter_test.go | 25 +++++++++++++++++++ .../gcimporter/testdata/issue15920.go | 11 ++++++++ test/fixedbugs/issue15920.dir/a.go | 9 +++++++ test/fixedbugs/issue15920.dir/b.go | 7 ++++++ test/fixedbugs/issue15920.go | 7 ++++++ 7 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 src/go/internal/gcimporter/testdata/issue15920.go create mode 100644 test/fixedbugs/issue15920.dir/a.go create mode 100644 test/fixedbugs/issue15920.dir/b.go create mode 100644 test/fixedbugs/issue15920.go diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go index f533053cd7..c7be2deaa2 100644 --- a/src/cmd/compile/internal/gc/bexport.go +++ b/src/cmd/compile/internal/gc/bexport.go @@ -622,6 +622,8 @@ func isInlineable(n *Node) bool { return false } +var errorInterface *Type // lazily initialized + func (p *exporter) typ(t *Type) { if t == nil { Fatalf("exporter: nil type") @@ -673,7 +675,19 @@ func (p *exporter) typ(t *Type) { p.qualifiedName(tsym) // write underlying type - p.typ(t.Orig) + orig := t.Orig + if orig == errortype { + // The error type is the only predeclared type which has + // a composite underlying type. When we encode that type, + // make sure to encode the underlying interface rather than + // the named type again. See also the comment in universe.go + // regarding the errortype and issue #15920. + if errorInterface == nil { + errorInterface = makeErrorInterface() + } + orig = errorInterface + } + p.typ(orig) // interfaces don't have associated methods if t.Orig.IsInterface() { diff --git a/src/cmd/compile/internal/gc/universe.go b/src/cmd/compile/internal/gc/universe.go index b55af7e25a..270d4c3770 100644 --- a/src/cmd/compile/internal/gc/universe.go +++ b/src/cmd/compile/internal/gc/universe.go @@ -358,9 +358,7 @@ func typeinit() { itable = typPtr(Types[TUINT8]) } -func lexinit1() { - // t = interface { Error() string } - +func makeErrorInterface() *Type { rcvr := typ(TSTRUCT) rcvr.StructType().Funarg = FunargRcvr field := newField() @@ -387,10 +385,18 @@ func lexinit1() { field.Type = f t.SetFields([]*Field{field}) + return t +} + +func lexinit1() { // error type s := Pkglookup("error", builtinpkg) - errortype = t + errortype = makeErrorInterface() errortype.Sym = s + // TODO: If we can prove that it's safe to set errortype.Orig here + // than we don't need the special errortype/errorInterface case in + // bexport.go. See also issue #15920. + // errortype.Orig = makeErrorInterface() s.Def = typenod(errortype) // byte alias diff --git a/src/go/internal/gcimporter/gcimporter_test.go b/src/go/internal/gcimporter/gcimporter_test.go index 8de36c713c..d8c5bcfb1c 100644 --- a/src/go/internal/gcimporter/gcimporter_test.go +++ b/src/go/internal/gcimporter/gcimporter_test.go @@ -400,3 +400,28 @@ func TestIssue15517(t *testing.T) { } } } + +func TestIssue15920(t *testing.T) { + skipSpecialPlatforms(t) + + // This package only handles gc export data. + if runtime.Compiler != "gc" { + t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler) + return + } + + // On windows, we have to set the -D option for the compiler to avoid having a drive + // letter and an illegal ':' in the import path - just skip it (see also issue #3483). + if runtime.GOOS == "windows" { + t.Skip("avoid dealing with relative paths/drive letters on windows") + } + + if f := compile(t, "testdata", "issue15920.go"); f != "" { + defer os.Remove(f) + } + + imports := make(map[string]*types.Package) + if _, err := Import(imports, "./testdata/issue15920", "."); err != nil { + t.Fatal(err) + } +} diff --git a/src/go/internal/gcimporter/testdata/issue15920.go b/src/go/internal/gcimporter/testdata/issue15920.go new file mode 100644 index 0000000000..c70f7d8267 --- /dev/null +++ b/src/go/internal/gcimporter/testdata/issue15920.go @@ -0,0 +1,11 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +// The underlying type of Error is the underlying type of error. +// Make sure we can import this again without problems. +type Error error + +func F() Error { return nil } diff --git a/test/fixedbugs/issue15920.dir/a.go b/test/fixedbugs/issue15920.dir/a.go new file mode 100644 index 0000000000..15f92355f7 --- /dev/null +++ b/test/fixedbugs/issue15920.dir/a.go @@ -0,0 +1,9 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package a + +type Error error + +func F() Error { return nil } diff --git a/test/fixedbugs/issue15920.dir/b.go b/test/fixedbugs/issue15920.dir/b.go new file mode 100644 index 0000000000..0a36c5c6ab --- /dev/null +++ b/test/fixedbugs/issue15920.dir/b.go @@ -0,0 +1,7 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package b + +import _ "./a" diff --git a/test/fixedbugs/issue15920.go b/test/fixedbugs/issue15920.go new file mode 100644 index 0000000000..4d2844dbb9 --- /dev/null +++ b/test/fixedbugs/issue15920.go @@ -0,0 +1,7 @@ +// compiledir + +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored From 6de014b9e2a655e093c2e3b5617a90b97d66c152 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 1 Jun 2016 20:58:02 +0200 Subject: [PATCH 044/120] misc/cgo/test,cmd/dist: enable (most) Cgo tests on Android Some tests cannot build for Android; use build tags and stubs to skip them. For #15919 Change-Id: Ieedcb73d4cabe23c3775cfb1d44c1276982dccd9 Reviewed-on: https://go-review.googlesource.com/23634 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: David Crawshaw --- misc/cgo/test/cgo_stubs_android_test.go | 13 +++++++++++++ misc/cgo/test/issue3775.go | 2 ++ misc/cgo/test/issue6997_linux.c | 2 ++ misc/cgo/test/issue6997_linux.go | 2 ++ misc/cgo/test/issue7978.go | 3 +++ misc/cgo/test/issue8694.go | 2 ++ misc/cgo/test/sigaltstack.go | 2 +- src/cmd/dist/test.go | 26 ++++++++++++++----------- 8 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 misc/cgo/test/cgo_stubs_android_test.go diff --git a/misc/cgo/test/cgo_stubs_android_test.go b/misc/cgo/test/cgo_stubs_android_test.go new file mode 100644 index 0000000000..710e094cf7 --- /dev/null +++ b/misc/cgo/test/cgo_stubs_android_test.go @@ -0,0 +1,13 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +// Stubs for tests that fails to build on Android +func test6997(t *testing.T) {} +func test3775(t *testing.T) {} +func test8694(t *testing.T) {} +func testSigaltstack(t *testing.T) {} diff --git a/misc/cgo/test/issue3775.go b/misc/cgo/test/issue3775.go index 8f81854195..5aca7602c0 100644 --- a/misc/cgo/test/issue3775.go +++ b/misc/cgo/test/issue3775.go @@ -1,3 +1,5 @@ +// +build !android + package cgotest /* diff --git a/misc/cgo/test/issue6997_linux.c b/misc/cgo/test/issue6997_linux.c index 1d5fb2ac7e..de803d296e 100644 --- a/misc/cgo/test/issue6997_linux.c +++ b/misc/cgo/test/issue6997_linux.c @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !android + #include #include #include diff --git a/misc/cgo/test/issue6997_linux.go b/misc/cgo/test/issue6997_linux.go index aaa51dcbf8..0c98ea0794 100644 --- a/misc/cgo/test/issue6997_linux.go +++ b/misc/cgo/test/issue6997_linux.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !android + // Test that pthread_cancel works as expected // (NPTL uses SIGRTMIN to implement thread cancelation) // See https://golang.org/issue/6997 diff --git a/misc/cgo/test/issue7978.go b/misc/cgo/test/issue7978.go index 94ea0b6fa3..d5f6cc71d0 100644 --- a/misc/cgo/test/issue7978.go +++ b/misc/cgo/test/issue7978.go @@ -103,6 +103,9 @@ func test7978(t *testing.T) { if C.HAS_SYNC_FETCH_AND_ADD == 0 { t.Skip("clang required for __sync_fetch_and_add support on darwin/arm") } + if runtime.GOOS == "android" { + t.Skip("GOTRACEBACK is not passed on to the exec wrapper") + } if os.Getenv("GOTRACEBACK") != "2" { t.Fatalf("GOTRACEBACK must be 2") } diff --git a/misc/cgo/test/issue8694.go b/misc/cgo/test/issue8694.go index 00ab7d5202..89be7ea090 100644 --- a/misc/cgo/test/issue8694.go +++ b/misc/cgo/test/issue8694.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !android + package cgotest /* diff --git a/misc/cgo/test/sigaltstack.go b/misc/cgo/test/sigaltstack.go index b641ff6037..b16adc7d88 100644 --- a/misc/cgo/test/sigaltstack.go +++ b/misc/cgo/test/sigaltstack.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !windows +// +build !windows,!android // Test that the Go runtime still works if C code changes the signal stack. diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 1a1f7d961b..33ed018245 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -432,8 +432,8 @@ func (t *tester) registerTests() { }, }) - if t.cgoEnabled && t.goos != "android" && !t.iOS() { - // Disabled on android and iOS. golang.org/issue/8345 + if t.cgoEnabled && !t.iOS() { + // Disabled on iOS. golang.org/issue/15919 t.tests = append(t.tests, distTest{ name: "cgo_stdio", heading: "../misc/cgo/stdio", @@ -465,9 +465,9 @@ func (t *tester) registerTests() { }) } } - if t.cgoEnabled && t.goos != "android" && !t.iOS() { - // TODO(crawshaw): reenable on android and iOS - // golang.org/issue/8345 + if t.cgoEnabled && !t.iOS() { + // TODO(crawshaw): reenable on iOS + // golang.org/issue/15919 // // These tests are not designed to run off the host. t.tests = append(t.tests, distTest{ @@ -729,7 +729,7 @@ func (t *tester) runHostTest(dirBanner, pkg string) error { func (t *tester) cgoTest(dt *distTest) error { env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) - if t.goos == "android" || t.iOS() { + if t.iOS() { cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags()) cmd.Env = env return cmd.Run() @@ -738,7 +738,7 @@ func (t *tester) cgoTest(dt *distTest) error { cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag("")) cmd.Env = env - if t.gohostos != "dragonfly" && t.gohostarch != "ppc64le" { + if t.gohostos != "dragonfly" && t.gohostarch != "ppc64le" && t.goos != "android" { // linkmode=internal fails on dragonfly since errno is a TLS relocation. // linkmode=internal fails on ppc64le because cmd/link doesn't // handle the TOC correctly (issue 15409). @@ -792,8 +792,10 @@ func (t *tester) cgoTest(dt *distTest) error { if err := cmd.Run(); err != nil { fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.") } else { - cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) - cmd.Env = env + if t.goos != "android" { + cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) + cmd.Env = env + } cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test") cmd.Env = env @@ -801,8 +803,10 @@ func (t *tester) cgoTest(dt *distTest) error { cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external`) cmd.Env = env - cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) - cmd.Env = env + if t.goos != "android" { + cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) + cmd.Env = env + } } if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test From d0c1888739ac0d5d0c9f82a4b86945c0351caef6 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 2 Jun 2016 08:11:01 +1000 Subject: [PATCH 045/120] doc: revert copyright date to 2009 Somehow this date was changed in error (by me) to 2012. It should have always been 2009. Change-Id: I87029079458d4c4eeeff2f2fc0574f10afa9af09 Reviewed-on: https://go-review.googlesource.com/23622 Reviewed-by: Rob Pike --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 7448756763..6a66aea5ea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are From f6c0241999bffe0fe52e8b7f5bbcc8f9e02edbdf Mon Sep 17 00:00:00 2001 From: Tom Bergan Date: Fri, 27 May 2016 16:53:13 -0700 Subject: [PATCH 046/120] net/http: update bundled http2 Updates x/net/http2 to git rev 6bdd4be4 for CL 23526: http2: GotFirstResponseByte hook should only fire once Also updated the trace hooks test to verify that all trace hooks are called exactly once except ConnectStart/End, which may be called multiple times (due to happy-eyeballs). Fixes #15777 Change-Id: Iea5c64eb322b58be27f9ff863b3a6f90e996fa9b Reviewed-on: https://go-review.googlesource.com/23527 Reviewed-by: Andrew Gerrand --- src/net/http/h2_bundle.go | 35 +++++++++++++++++++++++----------- src/net/http/transport_test.go | 35 ++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 9cedcaa73d..597eb7de47 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -25,8 +25,6 @@ import ( "encoding/binary" "errors" "fmt" - "golang.org/x/net/http2/hpack" - "golang.org/x/net/lex/httplex" "io" "io/ioutil" "log" @@ -42,6 +40,9 @@ import ( "strings" "sync" "time" + + "golang.org/x/net/http2/hpack" + "golang.org/x/net/lex/httplex" ) // ClientConnPool manages a pool of HTTP/2 client connections. @@ -291,7 +292,7 @@ func http2configureTransport(t1 *Transport) (*http2Transport, error) { t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") } upgradeFn := func(authority string, c *tls.Conn) RoundTripper { - addr := http2authorityAddr(authority) + addr := http2authorityAddr("https", authority) if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { go c.Close() return http2erringRoundTripper{err} @@ -4848,6 +4849,10 @@ type http2Transport struct { // uncompressed. DisableCompression bool + // AllowHTTP, if true, permits HTTP/2 requests using the insecure, + // plain-text "http" scheme. Note that this does not enable h2c support. + AllowHTTP bool + // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to // send in the initial settings frame. It is how many bytes // of response headers are allow. Unlike the http2 spec, zero here @@ -4963,6 +4968,7 @@ type http2clientStream struct { done chan struct{} // closed when stream remove from cc.streams map; close calls guarded by cc.mu // owned by clientConnReadLoop: + firstByte bool // got the first response byte pastHeaders bool // got first MetaHeadersFrame (actual headers) pastTrailers bool // got optional second MetaHeadersFrame (trailers) @@ -5046,20 +5052,24 @@ func (t *http2Transport) RoundTrip(req *Request) (*Response, error) { // authorityAddr returns a given authority (a host/IP, or host:port / ip:port) // and returns a host:port. The port 443 is added if needed. -func http2authorityAddr(authority string) (addr string) { +func http2authorityAddr(scheme string, authority string) (addr string) { if _, _, err := net.SplitHostPort(authority); err == nil { return authority } - return net.JoinHostPort(authority, "443") + port := "443" + if scheme == "http" { + port = "80" + } + return net.JoinHostPort(authority, port) } // RoundTripOpt is like RoundTrip, but takes options. func (t *http2Transport) RoundTripOpt(req *Request, opt http2RoundTripOpt) (*Response, error) { - if req.URL.Scheme != "https" { + if !(req.URL.Scheme == "https" || (req.URL.Scheme == "http" && t.AllowHTTP)) { return nil, errors.New("http2: unsupported scheme") } - addr := http2authorityAddr(req.URL.Host) + addr := http2authorityAddr(req.URL.Scheme, req.URL.Host) for { cc, err := t.connPool().GetClientConn(req, addr) if err != nil { @@ -5944,15 +5954,18 @@ func (rl *http2clientConnReadLoop) processHeaders(f *http2MetaHeadersFrame) erro return nil } + if !cs.firstByte { + if cs.trace != nil { + + http2traceFirstResponseByte(cs.trace) + } + cs.firstByte = true + } if !cs.pastHeaders { cs.pastHeaders = true } else { return rl.processTrailers(cs, f) } - if cs.trace != nil { - - http2traceFirstResponseByte(cs.trace) - } res, err := rl.handleResponse(cs, f) if err != nil { diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 1c1a1d0397..d653a5a7fc 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -3312,27 +3312,30 @@ func testTransportEventTrace(t *testing.T, h2 bool, noHooks bool) { } got := buf.String() - wantSub := func(sub string) { - if !strings.Contains(got, sub) { - t.Errorf("expected substring %q in output.", sub) + wantOnce := func(sub string) { + if strings.Count(got, sub) != 1 { + t.Errorf("expected substring %q exactly once in output.", sub) } } - if strings.Count(got, "got conn: {") != 1 { - t.Errorf("expected exactly 1 \"got conn\" event.") + wantOnceOrMore := func(sub string) { + if strings.Count(got, sub) == 0 { + t.Errorf("expected substring %q at least once in output.", sub) + } } - wantSub("Getting conn for dns-is-faked.golang:" + port) - wantSub("DNS start: {Host:dns-is-faked.golang}") - wantSub("DNS done: {Addrs:[{IP:" + ip + " Zone:}] Err: Coalesced:false}") - wantSub("Connecting to tcp " + addrStr) - wantSub("connected to tcp " + addrStr + " = ") - wantSub("Reused:false WasIdle:false IdleTime:0s") - wantSub("first response byte") + wantOnce("Getting conn for dns-is-faked.golang:" + port) + wantOnce("DNS start: {Host:dns-is-faked.golang}") + wantOnce("DNS done: {Addrs:[{IP:" + ip + " Zone:}] Err: Coalesced:false}") + wantOnce("got conn: {") + wantOnceOrMore("Connecting to tcp " + addrStr) + wantOnceOrMore("connected to tcp " + addrStr + " = ") + wantOnce("Reused:false WasIdle:false IdleTime:0s") + wantOnce("first response byte") if !h2 { - wantSub("PutIdleConn = ") + wantOnce("PutIdleConn = ") } - wantSub("Wait100Continue") - wantSub("Got100Continue") - wantSub("WroteRequest: {Err: }") + wantOnce("Wait100Continue") + wantOnce("Got100Continue") + wantOnce("WroteRequest: {Err: }") if strings.Contains(got, " to udp ") { t.Errorf("should not see UDP (DNS) connections") } From 2a8c81ffaadc69add6ff85b241691adb7f9f24ff Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 1 Jun 2016 14:41:09 -0700 Subject: [PATCH 047/120] crypto/tls: buffer handshake messages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change causes TLS handshake messages to be buffered and written in a single Write to the underlying net.Conn. There are two reasons to want to do this: Firstly, it's slightly preferable to do this in order to save sending several, small packets over the network where a single one will do. Secondly, since 37c28759ca46cf381a466e32168a793165d9c9e9 errors from Write have been returned from a handshake. This means that, if a peer closes the connection during a handshake, a “broken pipe” error may result from tls.Conn.Handshake(). This can mask any, more detailed, fatal alerts that the peer may have sent because a read will never happen. Buffering handshake messages means that the peer will not receive, and possibly reject, any of a flow while it's still being written. Fixes #15709 Change-Id: I38dcff1abecc06e52b2de647ea98713ce0fb9a21 Reviewed-on: https://go-review.googlesource.com/23609 Reviewed-by: Andrew Gerrand Run-TryBot: Andrew Gerrand TryBot-Result: Gobot Gobot --- src/crypto/tls/conn.go | 37 +++++++++++++++++---- src/crypto/tls/handshake_client.go | 7 ++++ src/crypto/tls/handshake_client_test.go | 44 ++++++++++++++++++++++++- src/crypto/tls/handshake_server.go | 12 +++++++ 4 files changed, 93 insertions(+), 7 deletions(-) diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go index 40c17440d6..87bef23d91 100644 --- a/src/crypto/tls/conn.go +++ b/src/crypto/tls/conn.go @@ -71,10 +71,12 @@ type Conn struct { clientProtocolFallback bool // input/output - in, out halfConn // in.Mutex < out.Mutex - rawInput *block // raw input, right off the wire - input *block // application data waiting to be read - hand bytes.Buffer // handshake data waiting to be read + in, out halfConn // in.Mutex < out.Mutex + rawInput *block // raw input, right off the wire + input *block // application data waiting to be read + hand bytes.Buffer // handshake data waiting to be read + buffering bool // whether records are buffered in sendBuf + sendBuf []byte // a buffer of records waiting to be sent // bytesSent counts the bytes of application data sent. // packetsSent counts packets. @@ -803,6 +805,30 @@ func (c *Conn) maxPayloadSizeForWrite(typ recordType, explicitIVLen int) int { return n } +// c.out.Mutex <= L. +func (c *Conn) write(data []byte) (int, error) { + if c.buffering { + c.sendBuf = append(c.sendBuf, data...) + return len(data), nil + } + + n, err := c.conn.Write(data) + c.bytesSent += int64(n) + return n, err +} + +func (c *Conn) flush() (int, error) { + if len(c.sendBuf) == 0 { + return 0, nil + } + + n, err := c.conn.Write(c.sendBuf) + c.bytesSent += int64(n) + c.sendBuf = nil + c.buffering = false + return n, err +} + // writeRecordLocked writes a TLS record with the given type and payload to the // connection and updates the record layer state. // c.out.Mutex <= L. @@ -862,10 +888,9 @@ func (c *Conn) writeRecordLocked(typ recordType, data []byte) (int, error) { } copy(b.data[recordHeaderLen+explicitIVLen:], data) c.out.encrypt(b, explicitIVLen) - if _, err := c.conn.Write(b.data); err != nil { + if _, err := c.write(b.data); err != nil { return n, err } - c.bytesSent += int64(m) n += m data = data[m:] } diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go index 475737b989..f789e6f888 100644 --- a/src/crypto/tls/handshake_client.go +++ b/src/crypto/tls/handshake_client.go @@ -206,6 +206,7 @@ NextCipherSuite: hs.finishedHash.Write(hs.hello.marshal()) hs.finishedHash.Write(hs.serverHello.marshal()) + c.buffering = true if isResume { if err := hs.establishKeys(); err != nil { return err @@ -220,6 +221,9 @@ NextCipherSuite: if err := hs.sendFinished(c.clientFinished[:]); err != nil { return err } + if _, err := c.flush(); err != nil { + return err + } } else { if err := hs.doFullHandshake(); err != nil { return err @@ -230,6 +234,9 @@ NextCipherSuite: if err := hs.sendFinished(c.clientFinished[:]); err != nil { return err } + if _, err := c.flush(); err != nil { + return err + } c.clientFinishedIsFirst = true if err := hs.readSessionTicket(); err != nil { return err diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go index 40b0770e12..c5000e5907 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -983,7 +983,7 @@ func (b *brokenConn) Write(data []byte) (int, error) { func TestFailedWrite(t *testing.T) { // Test that a write error during the handshake is returned. - for _, breakAfter := range []int{0, 1, 2, 3} { + for _, breakAfter := range []int{0, 1} { c, s := net.Pipe() done := make(chan bool) @@ -1003,3 +1003,45 @@ func TestFailedWrite(t *testing.T) { <-done } } + +// writeCountingConn wraps a net.Conn and counts the number of Write calls. +type writeCountingConn struct { + net.Conn + + // numWrites is the number of writes that have been done. + numWrites int +} + +func (wcc *writeCountingConn) Write(data []byte) (int, error) { + wcc.numWrites++ + return wcc.Conn.Write(data) +} + +func TestBuffering(t *testing.T) { + c, s := net.Pipe() + done := make(chan bool) + + clientWCC := &writeCountingConn{Conn: c} + serverWCC := &writeCountingConn{Conn: s} + + go func() { + Server(serverWCC, testConfig).Handshake() + serverWCC.Close() + done <- true + }() + + err := Client(clientWCC, testConfig).Handshake() + if err != nil { + t.Fatal(err) + } + clientWCC.Close() + <-done + + if n := clientWCC.numWrites; n != 2 { + t.Errorf("expected client handshake to complete with only two writes, but saw %d", n) + } + + if n := serverWCC.numWrites; n != 2 { + t.Errorf("expected server handshake to complete with only two writes, but saw %d", n) + } +} diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go index cf617df19f..1aac729561 100644 --- a/src/crypto/tls/handshake_server.go +++ b/src/crypto/tls/handshake_server.go @@ -52,6 +52,7 @@ func (c *Conn) serverHandshake() error { } // For an overview of TLS handshaking, see https://tools.ietf.org/html/rfc5246#section-7.3 + c.buffering = true if isResume { // The client has included a session ticket and so we do an abbreviated handshake. if err := hs.doResumeHandshake(); err != nil { @@ -71,6 +72,9 @@ func (c *Conn) serverHandshake() error { if err := hs.sendFinished(c.serverFinished[:]); err != nil { return err } + if _, err := c.flush(); err != nil { + return err + } c.clientFinishedIsFirst = false if err := hs.readFinished(nil); err != nil { return err @@ -89,12 +93,16 @@ func (c *Conn) serverHandshake() error { return err } c.clientFinishedIsFirst = true + c.buffering = true if err := hs.sendSessionTicket(); err != nil { return err } if err := hs.sendFinished(nil); err != nil { return err } + if _, err := c.flush(); err != nil { + return err + } } c.handshakeComplete = true @@ -430,6 +438,10 @@ func (hs *serverHandshakeState) doFullHandshake() error { return err } + if _, err := c.flush(); err != nil { + return err + } + var pub crypto.PublicKey // public key for client auth, if any msg, err := c.readHandshake() From d7ae8b3c11b027721f0878caac0620ccb7f81048 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 2 Jun 2016 09:24:43 +1000 Subject: [PATCH 048/120] api: update next.txt Change-Id: I04da6a56382d3bd96e3c849a022618553039b2db Reviewed-on: https://go-review.googlesource.com/23651 Reviewed-by: Chris Broadfoot --- api/next.txt | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/api/next.txt b/api/next.txt index 5ae56c126a..ec3a2b14eb 100644 --- a/api/next.txt +++ b/api/next.txt @@ -170,10 +170,37 @@ pkg io, const SeekStart ideal-int pkg math/big, method (*Float) GobDecode([]uint8) error pkg math/big, method (*Float) GobEncode() ([]uint8, error) pkg net, method (*Dialer) DialContext(context.Context, string, string) (Conn, error) +pkg net/http, const StatusAlreadyReported = 208 +pkg net/http, const StatusAlreadyReported ideal-int +pkg net/http, const StatusFailedDependency = 424 +pkg net/http, const StatusFailedDependency ideal-int +pkg net/http, const StatusIMUsed = 226 +pkg net/http, const StatusIMUsed ideal-int +pkg net/http, const StatusInsufficientStorage = 507 +pkg net/http, const StatusInsufficientStorage ideal-int +pkg net/http, const StatusLocked = 423 +pkg net/http, const StatusLocked ideal-int +pkg net/http, const StatusLoopDetected = 508 +pkg net/http, const StatusLoopDetected ideal-int +pkg net/http, const StatusMultiStatus = 207 +pkg net/http, const StatusMultiStatus ideal-int +pkg net/http, const StatusNotExtended = 510 +pkg net/http, const StatusNotExtended ideal-int +pkg net/http, const StatusPermanentRedirect = 308 +pkg net/http, const StatusPermanentRedirect ideal-int +pkg net/http, const StatusProcessing = 102 +pkg net/http, const StatusProcessing ideal-int +pkg net/http, const StatusUnprocessableEntity = 422 +pkg net/http, const StatusUnprocessableEntity ideal-int +pkg net/http, const StatusUpgradeRequired = 426 +pkg net/http, const StatusUpgradeRequired ideal-int +pkg net/http, const StatusVariantAlsoNegotiates = 506 +pkg net/http, const StatusVariantAlsoNegotiates ideal-int pkg net/http, method (*Request) Context() context.Context pkg net/http, method (*Request) WithContext(context.Context) *Request pkg net/http, type Request struct, Response *Response pkg net/http, type Response struct, Uncompressed bool +pkg net/http, type Transport struct, DialContext func(context.Context, string, string) (net.Conn, error) pkg net/http, type Transport struct, Dialer *net.Dialer pkg net/http, type Transport struct, IdleConnTimeout time.Duration pkg net/http, type Transport struct, MaxIdleConns int @@ -240,12 +267,12 @@ pkg runtime, type Frame struct, Line int pkg runtime, type Frame struct, PC uintptr pkg runtime, type Frames struct pkg strings, method (*Reader) Reset(string) -pkg syscall (linux-386), type SysProcAttr struct, Unshare uintptr -pkg syscall (linux-386-cgo), type SysProcAttr struct, Unshare uintptr -pkg syscall (linux-amd64), type SysProcAttr struct, Unshare uintptr -pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Unshare uintptr -pkg syscall (linux-arm), type SysProcAttr struct, Unshare uintptr -pkg syscall (linux-arm-cgo), type SysProcAttr struct, Unshare uintptr +pkg syscall (linux-386), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-386-cgo), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-amd64), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-arm), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Unshareflags uintptr pkg testing, method (*B) Run(string, func(*B)) bool pkg testing, method (*T) Run(string, func(*T)) bool pkg testing, type InternalExample struct, Unordered bool From 36358b16062fb419a4c78b3f03b24106cb057222 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 2 Jun 2016 09:59:06 +1000 Subject: [PATCH 049/120] api: remove os.File.Size and http.Transport.Dialer This method and field were added and then later removed during the 1.7 development cycle. Change-Id: I0482a6356b91d2be67880b44ef5d8a1daab49ec8 Reviewed-on: https://go-review.googlesource.com/23670 Reviewed-by: Chris Broadfoot --- api/next.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/next.txt b/api/next.txt index ec3a2b14eb..35afa91136 100644 --- a/api/next.txt +++ b/api/next.txt @@ -201,7 +201,6 @@ pkg net/http, method (*Request) WithContext(context.Context) *Request pkg net/http, type Request struct, Response *Response pkg net/http, type Response struct, Uncompressed bool pkg net/http, type Transport struct, DialContext func(context.Context, string, string) (net.Conn, error) -pkg net/http, type Transport struct, Dialer *net.Dialer pkg net/http, type Transport struct, IdleConnTimeout time.Duration pkg net/http, type Transport struct, MaxIdleConns int pkg net/http, type Transport struct, MaxResponseHeaderBytes int64 @@ -240,7 +239,6 @@ pkg net/http/httptrace, type GotConnInfo struct, WasIdle bool pkg net/http/httptrace, type WroteRequestInfo struct pkg net/http/httptrace, type WroteRequestInfo struct, Err error pkg net/url, type URL struct, ForceQuery bool -pkg os, method (*File) Size() (int64, error) pkg os/exec, func CommandContext(context.Context, string, ...string) *Cmd pkg os/user, func LookupGroup(string) (*Group, error) pkg os/user, func LookupGroupId(string) (*Group, error) From 3c6b6684ce21c1092ba208a0f1744ad7c930248a Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 2 Jun 2016 10:00:23 +1000 Subject: [PATCH 050/120] api: promote next.txt to go1.7.txt and update api tool Change-Id: Idb348be00f949da553aa6aab62836f59dfee298d Reviewed-on: https://go-review.googlesource.com/23671 Reviewed-by: Chris Broadfoot Run-TryBot: Andrew Gerrand --- api/go1.7.txt | 276 +++++++++++++++++++++++++++++++++++++++++++++ api/next.txt | 276 --------------------------------------------- src/cmd/api/run.go | 2 +- 3 files changed, 277 insertions(+), 277 deletions(-) create mode 100644 api/go1.7.txt diff --git a/api/go1.7.txt b/api/go1.7.txt new file mode 100644 index 0000000000..35afa91136 --- /dev/null +++ b/api/go1.7.txt @@ -0,0 +1,276 @@ +pkg bytes, func ContainsAny([]uint8, string) bool +pkg bytes, func ContainsRune([]uint8, int32) bool +pkg bytes, method (*Reader) Reset([]uint8) +pkg compress/flate, const HuffmanOnly = -2 +pkg compress/flate, const HuffmanOnly ideal-int +pkg context, func Background() Context +pkg context, func TODO() Context +pkg context, func WithCancel(Context) (Context, CancelFunc) +pkg context, func WithDeadline(Context, time.Time) (Context, CancelFunc) +pkg context, func WithTimeout(Context, time.Duration) (Context, CancelFunc) +pkg context, func WithValue(Context, interface{}, interface{}) Context +pkg context, type CancelFunc func() +pkg context, type Context interface { Deadline, Done, Err, Value } +pkg context, type Context interface, Deadline() (time.Time, bool) +pkg context, type Context interface, Done() <-chan struct +pkg context, type Context interface, Err() error +pkg context, type Context interface, Value(interface{}) interface{} +pkg context, var Canceled error +pkg context, var DeadlineExceeded error +pkg crypto/tls, const RenegotiateFreelyAsClient = 2 +pkg crypto/tls, const RenegotiateFreelyAsClient RenegotiationSupport +pkg crypto/tls, const RenegotiateNever = 0 +pkg crypto/tls, const RenegotiateNever RenegotiationSupport +pkg crypto/tls, const RenegotiateOnceAsClient = 1 +pkg crypto/tls, const RenegotiateOnceAsClient RenegotiationSupport +pkg crypto/tls, type Config struct, DynamicRecordSizingDisabled bool +pkg crypto/tls, type Config struct, Renegotiation RenegotiationSupport +pkg crypto/tls, type RenegotiationSupport int +pkg crypto/x509, func SystemCertPool() (*CertPool, error) +pkg crypto/x509, type SystemRootsError struct, Err error +pkg debug/dwarf, method (*Data) Ranges(*Entry) ([][2]uint64, error) +pkg debug/dwarf, method (*Reader) SeekPC(uint64) (*Entry, error) +pkg debug/elf, const R_390_12 = 2 +pkg debug/elf, const R_390_12 R_390 +pkg debug/elf, const R_390_16 = 3 +pkg debug/elf, const R_390_16 R_390 +pkg debug/elf, const R_390_20 = 57 +pkg debug/elf, const R_390_20 R_390 +pkg debug/elf, const R_390_32 = 4 +pkg debug/elf, const R_390_32 R_390 +pkg debug/elf, const R_390_64 = 22 +pkg debug/elf, const R_390_64 R_390 +pkg debug/elf, const R_390_8 = 1 +pkg debug/elf, const R_390_8 R_390 +pkg debug/elf, const R_390_COPY = 9 +pkg debug/elf, const R_390_COPY R_390 +pkg debug/elf, const R_390_GLOB_DAT = 10 +pkg debug/elf, const R_390_GLOB_DAT R_390 +pkg debug/elf, const R_390_GOT12 = 6 +pkg debug/elf, const R_390_GOT12 R_390 +pkg debug/elf, const R_390_GOT16 = 15 +pkg debug/elf, const R_390_GOT16 R_390 +pkg debug/elf, const R_390_GOT20 = 58 +pkg debug/elf, const R_390_GOT20 R_390 +pkg debug/elf, const R_390_GOT32 = 7 +pkg debug/elf, const R_390_GOT32 R_390 +pkg debug/elf, const R_390_GOT64 = 24 +pkg debug/elf, const R_390_GOT64 R_390 +pkg debug/elf, const R_390_GOTENT = 26 +pkg debug/elf, const R_390_GOTENT R_390 +pkg debug/elf, const R_390_GOTOFF = 13 +pkg debug/elf, const R_390_GOTOFF R_390 +pkg debug/elf, const R_390_GOTOFF16 = 27 +pkg debug/elf, const R_390_GOTOFF16 R_390 +pkg debug/elf, const R_390_GOTOFF64 = 28 +pkg debug/elf, const R_390_GOTOFF64 R_390 +pkg debug/elf, const R_390_GOTPC = 14 +pkg debug/elf, const R_390_GOTPC R_390 +pkg debug/elf, const R_390_GOTPCDBL = 21 +pkg debug/elf, const R_390_GOTPCDBL R_390 +pkg debug/elf, const R_390_GOTPLT12 = 29 +pkg debug/elf, const R_390_GOTPLT12 R_390 +pkg debug/elf, const R_390_GOTPLT16 = 30 +pkg debug/elf, const R_390_GOTPLT16 R_390 +pkg debug/elf, const R_390_GOTPLT20 = 59 +pkg debug/elf, const R_390_GOTPLT20 R_390 +pkg debug/elf, const R_390_GOTPLT32 = 31 +pkg debug/elf, const R_390_GOTPLT32 R_390 +pkg debug/elf, const R_390_GOTPLT64 = 32 +pkg debug/elf, const R_390_GOTPLT64 R_390 +pkg debug/elf, const R_390_GOTPLTENT = 33 +pkg debug/elf, const R_390_GOTPLTENT R_390 +pkg debug/elf, const R_390_GOTPLTOFF16 = 34 +pkg debug/elf, const R_390_GOTPLTOFF16 R_390 +pkg debug/elf, const R_390_GOTPLTOFF32 = 35 +pkg debug/elf, const R_390_GOTPLTOFF32 R_390 +pkg debug/elf, const R_390_GOTPLTOFF64 = 36 +pkg debug/elf, const R_390_GOTPLTOFF64 R_390 +pkg debug/elf, const R_390_JMP_SLOT = 11 +pkg debug/elf, const R_390_JMP_SLOT R_390 +pkg debug/elf, const R_390_NONE = 0 +pkg debug/elf, const R_390_NONE R_390 +pkg debug/elf, const R_390_PC16 = 16 +pkg debug/elf, const R_390_PC16 R_390 +pkg debug/elf, const R_390_PC16DBL = 17 +pkg debug/elf, const R_390_PC16DBL R_390 +pkg debug/elf, const R_390_PC32 = 5 +pkg debug/elf, const R_390_PC32 R_390 +pkg debug/elf, const R_390_PC32DBL = 19 +pkg debug/elf, const R_390_PC32DBL R_390 +pkg debug/elf, const R_390_PC64 = 23 +pkg debug/elf, const R_390_PC64 R_390 +pkg debug/elf, const R_390_PLT16DBL = 18 +pkg debug/elf, const R_390_PLT16DBL R_390 +pkg debug/elf, const R_390_PLT32 = 8 +pkg debug/elf, const R_390_PLT32 R_390 +pkg debug/elf, const R_390_PLT32DBL = 20 +pkg debug/elf, const R_390_PLT32DBL R_390 +pkg debug/elf, const R_390_PLT64 = 25 +pkg debug/elf, const R_390_PLT64 R_390 +pkg debug/elf, const R_390_RELATIVE = 12 +pkg debug/elf, const R_390_RELATIVE R_390 +pkg debug/elf, const R_390_TLS_DTPMOD = 54 +pkg debug/elf, const R_390_TLS_DTPMOD R_390 +pkg debug/elf, const R_390_TLS_DTPOFF = 55 +pkg debug/elf, const R_390_TLS_DTPOFF R_390 +pkg debug/elf, const R_390_TLS_GD32 = 40 +pkg debug/elf, const R_390_TLS_GD32 R_390 +pkg debug/elf, const R_390_TLS_GD64 = 41 +pkg debug/elf, const R_390_TLS_GD64 R_390 +pkg debug/elf, const R_390_TLS_GDCALL = 38 +pkg debug/elf, const R_390_TLS_GDCALL R_390 +pkg debug/elf, const R_390_TLS_GOTIE12 = 42 +pkg debug/elf, const R_390_TLS_GOTIE12 R_390 +pkg debug/elf, const R_390_TLS_GOTIE20 = 60 +pkg debug/elf, const R_390_TLS_GOTIE20 R_390 +pkg debug/elf, const R_390_TLS_GOTIE32 = 43 +pkg debug/elf, const R_390_TLS_GOTIE32 R_390 +pkg debug/elf, const R_390_TLS_GOTIE64 = 44 +pkg debug/elf, const R_390_TLS_GOTIE64 R_390 +pkg debug/elf, const R_390_TLS_IE32 = 47 +pkg debug/elf, const R_390_TLS_IE32 R_390 +pkg debug/elf, const R_390_TLS_IE64 = 48 +pkg debug/elf, const R_390_TLS_IE64 R_390 +pkg debug/elf, const R_390_TLS_IEENT = 49 +pkg debug/elf, const R_390_TLS_IEENT R_390 +pkg debug/elf, const R_390_TLS_LDCALL = 39 +pkg debug/elf, const R_390_TLS_LDCALL R_390 +pkg debug/elf, const R_390_TLS_LDM32 = 45 +pkg debug/elf, const R_390_TLS_LDM32 R_390 +pkg debug/elf, const R_390_TLS_LDM64 = 46 +pkg debug/elf, const R_390_TLS_LDM64 R_390 +pkg debug/elf, const R_390_TLS_LDO32 = 52 +pkg debug/elf, const R_390_TLS_LDO32 R_390 +pkg debug/elf, const R_390_TLS_LDO64 = 53 +pkg debug/elf, const R_390_TLS_LDO64 R_390 +pkg debug/elf, const R_390_TLS_LE32 = 50 +pkg debug/elf, const R_390_TLS_LE32 R_390 +pkg debug/elf, const R_390_TLS_LE64 = 51 +pkg debug/elf, const R_390_TLS_LE64 R_390 +pkg debug/elf, const R_390_TLS_LOAD = 37 +pkg debug/elf, const R_390_TLS_LOAD R_390 +pkg debug/elf, const R_390_TLS_TPOFF = 56 +pkg debug/elf, const R_390_TLS_TPOFF R_390 +pkg debug/elf, method (R_390) GoString() string +pkg debug/elf, method (R_390) String() string +pkg debug/elf, type R_390 int +pkg encoding/json, method (*Encoder) SetEscapeHTML(bool) +pkg encoding/json, method (*Encoder) SetIndent(string, string) +pkg go/build, type Package struct, BinaryOnly bool +pkg go/build, type Package struct, CgoFFLAGS []string +pkg go/build, type Package struct, FFiles []string +pkg go/doc, type Example struct, Unordered bool +pkg io, const SeekCurrent = 1 +pkg io, const SeekCurrent ideal-int +pkg io, const SeekEnd = 2 +pkg io, const SeekEnd ideal-int +pkg io, const SeekStart = 0 +pkg io, const SeekStart ideal-int +pkg math/big, method (*Float) GobDecode([]uint8) error +pkg math/big, method (*Float) GobEncode() ([]uint8, error) +pkg net, method (*Dialer) DialContext(context.Context, string, string) (Conn, error) +pkg net/http, const StatusAlreadyReported = 208 +pkg net/http, const StatusAlreadyReported ideal-int +pkg net/http, const StatusFailedDependency = 424 +pkg net/http, const StatusFailedDependency ideal-int +pkg net/http, const StatusIMUsed = 226 +pkg net/http, const StatusIMUsed ideal-int +pkg net/http, const StatusInsufficientStorage = 507 +pkg net/http, const StatusInsufficientStorage ideal-int +pkg net/http, const StatusLocked = 423 +pkg net/http, const StatusLocked ideal-int +pkg net/http, const StatusLoopDetected = 508 +pkg net/http, const StatusLoopDetected ideal-int +pkg net/http, const StatusMultiStatus = 207 +pkg net/http, const StatusMultiStatus ideal-int +pkg net/http, const StatusNotExtended = 510 +pkg net/http, const StatusNotExtended ideal-int +pkg net/http, const StatusPermanentRedirect = 308 +pkg net/http, const StatusPermanentRedirect ideal-int +pkg net/http, const StatusProcessing = 102 +pkg net/http, const StatusProcessing ideal-int +pkg net/http, const StatusUnprocessableEntity = 422 +pkg net/http, const StatusUnprocessableEntity ideal-int +pkg net/http, const StatusUpgradeRequired = 426 +pkg net/http, const StatusUpgradeRequired ideal-int +pkg net/http, const StatusVariantAlsoNegotiates = 506 +pkg net/http, const StatusVariantAlsoNegotiates ideal-int +pkg net/http, method (*Request) Context() context.Context +pkg net/http, method (*Request) WithContext(context.Context) *Request +pkg net/http, type Request struct, Response *Response +pkg net/http, type Response struct, Uncompressed bool +pkg net/http, type Transport struct, DialContext func(context.Context, string, string) (net.Conn, error) +pkg net/http, type Transport struct, IdleConnTimeout time.Duration +pkg net/http, type Transport struct, MaxIdleConns int +pkg net/http, type Transport struct, MaxResponseHeaderBytes int64 +pkg net/http, var ErrUseLastResponse error +pkg net/http, var LocalAddrContextKey *contextKey +pkg net/http, var ServerContextKey *contextKey +pkg net/http/cgi, type Handler struct, Stderr io.Writer +pkg net/http/httptest, func NewRequest(string, string, io.Reader) *http.Request +pkg net/http/httptest, method (*ResponseRecorder) Result() *http.Response +pkg net/http/httptrace, func ContextClientTrace(context.Context) *ClientTrace +pkg net/http/httptrace, func WithClientTrace(context.Context, *ClientTrace) context.Context +pkg net/http/httptrace, type ClientTrace struct +pkg net/http/httptrace, type ClientTrace struct, ConnectDone func(string, string, error) +pkg net/http/httptrace, type ClientTrace struct, ConnectStart func(string, string) +pkg net/http/httptrace, type ClientTrace struct, DNSDone func(DNSDoneInfo) +pkg net/http/httptrace, type ClientTrace struct, DNSStart func(DNSStartInfo) +pkg net/http/httptrace, type ClientTrace struct, GetConn func(string) +pkg net/http/httptrace, type ClientTrace struct, Got100Continue func() +pkg net/http/httptrace, type ClientTrace struct, GotConn func(GotConnInfo) +pkg net/http/httptrace, type ClientTrace struct, GotFirstResponseByte func() +pkg net/http/httptrace, type ClientTrace struct, PutIdleConn func(error) +pkg net/http/httptrace, type ClientTrace struct, Wait100Continue func() +pkg net/http/httptrace, type ClientTrace struct, WroteHeaders func() +pkg net/http/httptrace, type ClientTrace struct, WroteRequest func(WroteRequestInfo) +pkg net/http/httptrace, type DNSDoneInfo struct +pkg net/http/httptrace, type DNSDoneInfo struct, Addrs []net.IPAddr +pkg net/http/httptrace, type DNSDoneInfo struct, Coalesced bool +pkg net/http/httptrace, type DNSDoneInfo struct, Err error +pkg net/http/httptrace, type DNSStartInfo struct +pkg net/http/httptrace, type DNSStartInfo struct, Host string +pkg net/http/httptrace, type GotConnInfo struct +pkg net/http/httptrace, type GotConnInfo struct, Conn net.Conn +pkg net/http/httptrace, type GotConnInfo struct, IdleTime time.Duration +pkg net/http/httptrace, type GotConnInfo struct, Reused bool +pkg net/http/httptrace, type GotConnInfo struct, WasIdle bool +pkg net/http/httptrace, type WroteRequestInfo struct +pkg net/http/httptrace, type WroteRequestInfo struct, Err error +pkg net/url, type URL struct, ForceQuery bool +pkg os/exec, func CommandContext(context.Context, string, ...string) *Cmd +pkg os/user, func LookupGroup(string) (*Group, error) +pkg os/user, func LookupGroupId(string) (*Group, error) +pkg os/user, method (*User) GroupIds() ([]string, error) +pkg os/user, method (UnknownGroupError) Error() string +pkg os/user, method (UnknownGroupIdError) Error() string +pkg os/user, type Group struct +pkg os/user, type Group struct, Gid string +pkg os/user, type Group struct, Name string +pkg os/user, type UnknownGroupError string +pkg os/user, type UnknownGroupIdError string +pkg reflect, func StructOf([]StructField) Type +pkg reflect, method (StructTag) Lookup(string) (string, bool) +pkg runtime, func CallersFrames([]uintptr) *Frames +pkg runtime, func KeepAlive(interface{}) +pkg runtime, func SetCgoTraceback(int, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) +pkg runtime, method (*Frames) Next() (Frame, bool) +pkg runtime, type Frame struct +pkg runtime, type Frame struct, Entry uintptr +pkg runtime, type Frame struct, File string +pkg runtime, type Frame struct, Func *Func +pkg runtime, type Frame struct, Function string +pkg runtime, type Frame struct, Line int +pkg runtime, type Frame struct, PC uintptr +pkg runtime, type Frames struct +pkg strings, method (*Reader) Reset(string) +pkg syscall (linux-386), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-386-cgo), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-amd64), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-arm), type SysProcAttr struct, Unshareflags uintptr +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Unshareflags uintptr +pkg testing, method (*B) Run(string, func(*B)) bool +pkg testing, method (*T) Run(string, func(*T)) bool +pkg testing, type InternalExample struct, Unordered bool diff --git a/api/next.txt b/api/next.txt index 35afa91136..e69de29bb2 100644 --- a/api/next.txt +++ b/api/next.txt @@ -1,276 +0,0 @@ -pkg bytes, func ContainsAny([]uint8, string) bool -pkg bytes, func ContainsRune([]uint8, int32) bool -pkg bytes, method (*Reader) Reset([]uint8) -pkg compress/flate, const HuffmanOnly = -2 -pkg compress/flate, const HuffmanOnly ideal-int -pkg context, func Background() Context -pkg context, func TODO() Context -pkg context, func WithCancel(Context) (Context, CancelFunc) -pkg context, func WithDeadline(Context, time.Time) (Context, CancelFunc) -pkg context, func WithTimeout(Context, time.Duration) (Context, CancelFunc) -pkg context, func WithValue(Context, interface{}, interface{}) Context -pkg context, type CancelFunc func() -pkg context, type Context interface { Deadline, Done, Err, Value } -pkg context, type Context interface, Deadline() (time.Time, bool) -pkg context, type Context interface, Done() <-chan struct -pkg context, type Context interface, Err() error -pkg context, type Context interface, Value(interface{}) interface{} -pkg context, var Canceled error -pkg context, var DeadlineExceeded error -pkg crypto/tls, const RenegotiateFreelyAsClient = 2 -pkg crypto/tls, const RenegotiateFreelyAsClient RenegotiationSupport -pkg crypto/tls, const RenegotiateNever = 0 -pkg crypto/tls, const RenegotiateNever RenegotiationSupport -pkg crypto/tls, const RenegotiateOnceAsClient = 1 -pkg crypto/tls, const RenegotiateOnceAsClient RenegotiationSupport -pkg crypto/tls, type Config struct, DynamicRecordSizingDisabled bool -pkg crypto/tls, type Config struct, Renegotiation RenegotiationSupport -pkg crypto/tls, type RenegotiationSupport int -pkg crypto/x509, func SystemCertPool() (*CertPool, error) -pkg crypto/x509, type SystemRootsError struct, Err error -pkg debug/dwarf, method (*Data) Ranges(*Entry) ([][2]uint64, error) -pkg debug/dwarf, method (*Reader) SeekPC(uint64) (*Entry, error) -pkg debug/elf, const R_390_12 = 2 -pkg debug/elf, const R_390_12 R_390 -pkg debug/elf, const R_390_16 = 3 -pkg debug/elf, const R_390_16 R_390 -pkg debug/elf, const R_390_20 = 57 -pkg debug/elf, const R_390_20 R_390 -pkg debug/elf, const R_390_32 = 4 -pkg debug/elf, const R_390_32 R_390 -pkg debug/elf, const R_390_64 = 22 -pkg debug/elf, const R_390_64 R_390 -pkg debug/elf, const R_390_8 = 1 -pkg debug/elf, const R_390_8 R_390 -pkg debug/elf, const R_390_COPY = 9 -pkg debug/elf, const R_390_COPY R_390 -pkg debug/elf, const R_390_GLOB_DAT = 10 -pkg debug/elf, const R_390_GLOB_DAT R_390 -pkg debug/elf, const R_390_GOT12 = 6 -pkg debug/elf, const R_390_GOT12 R_390 -pkg debug/elf, const R_390_GOT16 = 15 -pkg debug/elf, const R_390_GOT16 R_390 -pkg debug/elf, const R_390_GOT20 = 58 -pkg debug/elf, const R_390_GOT20 R_390 -pkg debug/elf, const R_390_GOT32 = 7 -pkg debug/elf, const R_390_GOT32 R_390 -pkg debug/elf, const R_390_GOT64 = 24 -pkg debug/elf, const R_390_GOT64 R_390 -pkg debug/elf, const R_390_GOTENT = 26 -pkg debug/elf, const R_390_GOTENT R_390 -pkg debug/elf, const R_390_GOTOFF = 13 -pkg debug/elf, const R_390_GOTOFF R_390 -pkg debug/elf, const R_390_GOTOFF16 = 27 -pkg debug/elf, const R_390_GOTOFF16 R_390 -pkg debug/elf, const R_390_GOTOFF64 = 28 -pkg debug/elf, const R_390_GOTOFF64 R_390 -pkg debug/elf, const R_390_GOTPC = 14 -pkg debug/elf, const R_390_GOTPC R_390 -pkg debug/elf, const R_390_GOTPCDBL = 21 -pkg debug/elf, const R_390_GOTPCDBL R_390 -pkg debug/elf, const R_390_GOTPLT12 = 29 -pkg debug/elf, const R_390_GOTPLT12 R_390 -pkg debug/elf, const R_390_GOTPLT16 = 30 -pkg debug/elf, const R_390_GOTPLT16 R_390 -pkg debug/elf, const R_390_GOTPLT20 = 59 -pkg debug/elf, const R_390_GOTPLT20 R_390 -pkg debug/elf, const R_390_GOTPLT32 = 31 -pkg debug/elf, const R_390_GOTPLT32 R_390 -pkg debug/elf, const R_390_GOTPLT64 = 32 -pkg debug/elf, const R_390_GOTPLT64 R_390 -pkg debug/elf, const R_390_GOTPLTENT = 33 -pkg debug/elf, const R_390_GOTPLTENT R_390 -pkg debug/elf, const R_390_GOTPLTOFF16 = 34 -pkg debug/elf, const R_390_GOTPLTOFF16 R_390 -pkg debug/elf, const R_390_GOTPLTOFF32 = 35 -pkg debug/elf, const R_390_GOTPLTOFF32 R_390 -pkg debug/elf, const R_390_GOTPLTOFF64 = 36 -pkg debug/elf, const R_390_GOTPLTOFF64 R_390 -pkg debug/elf, const R_390_JMP_SLOT = 11 -pkg debug/elf, const R_390_JMP_SLOT R_390 -pkg debug/elf, const R_390_NONE = 0 -pkg debug/elf, const R_390_NONE R_390 -pkg debug/elf, const R_390_PC16 = 16 -pkg debug/elf, const R_390_PC16 R_390 -pkg debug/elf, const R_390_PC16DBL = 17 -pkg debug/elf, const R_390_PC16DBL R_390 -pkg debug/elf, const R_390_PC32 = 5 -pkg debug/elf, const R_390_PC32 R_390 -pkg debug/elf, const R_390_PC32DBL = 19 -pkg debug/elf, const R_390_PC32DBL R_390 -pkg debug/elf, const R_390_PC64 = 23 -pkg debug/elf, const R_390_PC64 R_390 -pkg debug/elf, const R_390_PLT16DBL = 18 -pkg debug/elf, const R_390_PLT16DBL R_390 -pkg debug/elf, const R_390_PLT32 = 8 -pkg debug/elf, const R_390_PLT32 R_390 -pkg debug/elf, const R_390_PLT32DBL = 20 -pkg debug/elf, const R_390_PLT32DBL R_390 -pkg debug/elf, const R_390_PLT64 = 25 -pkg debug/elf, const R_390_PLT64 R_390 -pkg debug/elf, const R_390_RELATIVE = 12 -pkg debug/elf, const R_390_RELATIVE R_390 -pkg debug/elf, const R_390_TLS_DTPMOD = 54 -pkg debug/elf, const R_390_TLS_DTPMOD R_390 -pkg debug/elf, const R_390_TLS_DTPOFF = 55 -pkg debug/elf, const R_390_TLS_DTPOFF R_390 -pkg debug/elf, const R_390_TLS_GD32 = 40 -pkg debug/elf, const R_390_TLS_GD32 R_390 -pkg debug/elf, const R_390_TLS_GD64 = 41 -pkg debug/elf, const R_390_TLS_GD64 R_390 -pkg debug/elf, const R_390_TLS_GDCALL = 38 -pkg debug/elf, const R_390_TLS_GDCALL R_390 -pkg debug/elf, const R_390_TLS_GOTIE12 = 42 -pkg debug/elf, const R_390_TLS_GOTIE12 R_390 -pkg debug/elf, const R_390_TLS_GOTIE20 = 60 -pkg debug/elf, const R_390_TLS_GOTIE20 R_390 -pkg debug/elf, const R_390_TLS_GOTIE32 = 43 -pkg debug/elf, const R_390_TLS_GOTIE32 R_390 -pkg debug/elf, const R_390_TLS_GOTIE64 = 44 -pkg debug/elf, const R_390_TLS_GOTIE64 R_390 -pkg debug/elf, const R_390_TLS_IE32 = 47 -pkg debug/elf, const R_390_TLS_IE32 R_390 -pkg debug/elf, const R_390_TLS_IE64 = 48 -pkg debug/elf, const R_390_TLS_IE64 R_390 -pkg debug/elf, const R_390_TLS_IEENT = 49 -pkg debug/elf, const R_390_TLS_IEENT R_390 -pkg debug/elf, const R_390_TLS_LDCALL = 39 -pkg debug/elf, const R_390_TLS_LDCALL R_390 -pkg debug/elf, const R_390_TLS_LDM32 = 45 -pkg debug/elf, const R_390_TLS_LDM32 R_390 -pkg debug/elf, const R_390_TLS_LDM64 = 46 -pkg debug/elf, const R_390_TLS_LDM64 R_390 -pkg debug/elf, const R_390_TLS_LDO32 = 52 -pkg debug/elf, const R_390_TLS_LDO32 R_390 -pkg debug/elf, const R_390_TLS_LDO64 = 53 -pkg debug/elf, const R_390_TLS_LDO64 R_390 -pkg debug/elf, const R_390_TLS_LE32 = 50 -pkg debug/elf, const R_390_TLS_LE32 R_390 -pkg debug/elf, const R_390_TLS_LE64 = 51 -pkg debug/elf, const R_390_TLS_LE64 R_390 -pkg debug/elf, const R_390_TLS_LOAD = 37 -pkg debug/elf, const R_390_TLS_LOAD R_390 -pkg debug/elf, const R_390_TLS_TPOFF = 56 -pkg debug/elf, const R_390_TLS_TPOFF R_390 -pkg debug/elf, method (R_390) GoString() string -pkg debug/elf, method (R_390) String() string -pkg debug/elf, type R_390 int -pkg encoding/json, method (*Encoder) SetEscapeHTML(bool) -pkg encoding/json, method (*Encoder) SetIndent(string, string) -pkg go/build, type Package struct, BinaryOnly bool -pkg go/build, type Package struct, CgoFFLAGS []string -pkg go/build, type Package struct, FFiles []string -pkg go/doc, type Example struct, Unordered bool -pkg io, const SeekCurrent = 1 -pkg io, const SeekCurrent ideal-int -pkg io, const SeekEnd = 2 -pkg io, const SeekEnd ideal-int -pkg io, const SeekStart = 0 -pkg io, const SeekStart ideal-int -pkg math/big, method (*Float) GobDecode([]uint8) error -pkg math/big, method (*Float) GobEncode() ([]uint8, error) -pkg net, method (*Dialer) DialContext(context.Context, string, string) (Conn, error) -pkg net/http, const StatusAlreadyReported = 208 -pkg net/http, const StatusAlreadyReported ideal-int -pkg net/http, const StatusFailedDependency = 424 -pkg net/http, const StatusFailedDependency ideal-int -pkg net/http, const StatusIMUsed = 226 -pkg net/http, const StatusIMUsed ideal-int -pkg net/http, const StatusInsufficientStorage = 507 -pkg net/http, const StatusInsufficientStorage ideal-int -pkg net/http, const StatusLocked = 423 -pkg net/http, const StatusLocked ideal-int -pkg net/http, const StatusLoopDetected = 508 -pkg net/http, const StatusLoopDetected ideal-int -pkg net/http, const StatusMultiStatus = 207 -pkg net/http, const StatusMultiStatus ideal-int -pkg net/http, const StatusNotExtended = 510 -pkg net/http, const StatusNotExtended ideal-int -pkg net/http, const StatusPermanentRedirect = 308 -pkg net/http, const StatusPermanentRedirect ideal-int -pkg net/http, const StatusProcessing = 102 -pkg net/http, const StatusProcessing ideal-int -pkg net/http, const StatusUnprocessableEntity = 422 -pkg net/http, const StatusUnprocessableEntity ideal-int -pkg net/http, const StatusUpgradeRequired = 426 -pkg net/http, const StatusUpgradeRequired ideal-int -pkg net/http, const StatusVariantAlsoNegotiates = 506 -pkg net/http, const StatusVariantAlsoNegotiates ideal-int -pkg net/http, method (*Request) Context() context.Context -pkg net/http, method (*Request) WithContext(context.Context) *Request -pkg net/http, type Request struct, Response *Response -pkg net/http, type Response struct, Uncompressed bool -pkg net/http, type Transport struct, DialContext func(context.Context, string, string) (net.Conn, error) -pkg net/http, type Transport struct, IdleConnTimeout time.Duration -pkg net/http, type Transport struct, MaxIdleConns int -pkg net/http, type Transport struct, MaxResponseHeaderBytes int64 -pkg net/http, var ErrUseLastResponse error -pkg net/http, var LocalAddrContextKey *contextKey -pkg net/http, var ServerContextKey *contextKey -pkg net/http/cgi, type Handler struct, Stderr io.Writer -pkg net/http/httptest, func NewRequest(string, string, io.Reader) *http.Request -pkg net/http/httptest, method (*ResponseRecorder) Result() *http.Response -pkg net/http/httptrace, func ContextClientTrace(context.Context) *ClientTrace -pkg net/http/httptrace, func WithClientTrace(context.Context, *ClientTrace) context.Context -pkg net/http/httptrace, type ClientTrace struct -pkg net/http/httptrace, type ClientTrace struct, ConnectDone func(string, string, error) -pkg net/http/httptrace, type ClientTrace struct, ConnectStart func(string, string) -pkg net/http/httptrace, type ClientTrace struct, DNSDone func(DNSDoneInfo) -pkg net/http/httptrace, type ClientTrace struct, DNSStart func(DNSStartInfo) -pkg net/http/httptrace, type ClientTrace struct, GetConn func(string) -pkg net/http/httptrace, type ClientTrace struct, Got100Continue func() -pkg net/http/httptrace, type ClientTrace struct, GotConn func(GotConnInfo) -pkg net/http/httptrace, type ClientTrace struct, GotFirstResponseByte func() -pkg net/http/httptrace, type ClientTrace struct, PutIdleConn func(error) -pkg net/http/httptrace, type ClientTrace struct, Wait100Continue func() -pkg net/http/httptrace, type ClientTrace struct, WroteHeaders func() -pkg net/http/httptrace, type ClientTrace struct, WroteRequest func(WroteRequestInfo) -pkg net/http/httptrace, type DNSDoneInfo struct -pkg net/http/httptrace, type DNSDoneInfo struct, Addrs []net.IPAddr -pkg net/http/httptrace, type DNSDoneInfo struct, Coalesced bool -pkg net/http/httptrace, type DNSDoneInfo struct, Err error -pkg net/http/httptrace, type DNSStartInfo struct -pkg net/http/httptrace, type DNSStartInfo struct, Host string -pkg net/http/httptrace, type GotConnInfo struct -pkg net/http/httptrace, type GotConnInfo struct, Conn net.Conn -pkg net/http/httptrace, type GotConnInfo struct, IdleTime time.Duration -pkg net/http/httptrace, type GotConnInfo struct, Reused bool -pkg net/http/httptrace, type GotConnInfo struct, WasIdle bool -pkg net/http/httptrace, type WroteRequestInfo struct -pkg net/http/httptrace, type WroteRequestInfo struct, Err error -pkg net/url, type URL struct, ForceQuery bool -pkg os/exec, func CommandContext(context.Context, string, ...string) *Cmd -pkg os/user, func LookupGroup(string) (*Group, error) -pkg os/user, func LookupGroupId(string) (*Group, error) -pkg os/user, method (*User) GroupIds() ([]string, error) -pkg os/user, method (UnknownGroupError) Error() string -pkg os/user, method (UnknownGroupIdError) Error() string -pkg os/user, type Group struct -pkg os/user, type Group struct, Gid string -pkg os/user, type Group struct, Name string -pkg os/user, type UnknownGroupError string -pkg os/user, type UnknownGroupIdError string -pkg reflect, func StructOf([]StructField) Type -pkg reflect, method (StructTag) Lookup(string) (string, bool) -pkg runtime, func CallersFrames([]uintptr) *Frames -pkg runtime, func KeepAlive(interface{}) -pkg runtime, func SetCgoTraceback(int, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) -pkg runtime, method (*Frames) Next() (Frame, bool) -pkg runtime, type Frame struct -pkg runtime, type Frame struct, Entry uintptr -pkg runtime, type Frame struct, File string -pkg runtime, type Frame struct, Func *Func -pkg runtime, type Frame struct, Function string -pkg runtime, type Frame struct, Line int -pkg runtime, type Frame struct, PC uintptr -pkg runtime, type Frames struct -pkg strings, method (*Reader) Reset(string) -pkg syscall (linux-386), type SysProcAttr struct, Unshareflags uintptr -pkg syscall (linux-386-cgo), type SysProcAttr struct, Unshareflags uintptr -pkg syscall (linux-amd64), type SysProcAttr struct, Unshareflags uintptr -pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Unshareflags uintptr -pkg syscall (linux-arm), type SysProcAttr struct, Unshareflags uintptr -pkg syscall (linux-arm-cgo), type SysProcAttr struct, Unshareflags uintptr -pkg testing, method (*B) Run(string, func(*B)) bool -pkg testing, method (*T) Run(string, func(*T)) bool -pkg testing, type InternalExample struct, Unordered bool diff --git a/src/cmd/api/run.go b/src/cmd/api/run.go index bd49dfaf37..c8433c5d3f 100644 --- a/src/cmd/api/run.go +++ b/src/cmd/api/run.go @@ -26,7 +26,7 @@ func main() { } out, err := exec.Command("go", "tool", "api", - "-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6"), + "-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7"), "-next", file("next"), "-except", file("except")).CombinedOutput() if err != nil { From 068c745e1e44875c411de5d5aea3f96574fbee12 Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Thu, 2 Jun 2016 08:53:11 +0900 Subject: [PATCH 051/120] vendor: update vendored route Updates golang.org/x/net/route to rev fac978c for: - route: fix typos in test Change-Id: I35de1d3f8e887c6bb5fe50e7299f2fc12e4426de Reviewed-on: https://go-review.googlesource.com/23660 Reviewed-by: Ian Lance Taylor --- src/vendor/golang.org/x/net/route/message_freebsd_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vendor/golang.org/x/net/route/message_freebsd_test.go b/src/vendor/golang.org/x/net/route/message_freebsd_test.go index 6d03d000a8..785c273f65 100644 --- a/src/vendor/golang.org/x/net/route/message_freebsd_test.go +++ b/src/vendor/golang.org/x/net/route/message_freebsd_test.go @@ -32,11 +32,11 @@ func TestFetchAndParseRIBOnFreeBSD(t *testing.T) { func TestFetchAndParseRIBOnFreeBSD10AndAbove(t *testing.T) { if _, err := FetchRIB(sysAF_UNSPEC, sysNET_RT_IFLISTL, 0); err != nil { - t.Skip("NET_RT_LISTL not supported") + t.Skip("NET_RT_IFLISTL not supported") } var p uintptr if kernelAlign != int(unsafe.Sizeof(p)) { - t.Skip("NET_RT_LIST vs. NET_RT_LISTL doesn't work for 386 emulation on amd64") + t.Skip("NET_RT_IFLIST vs. NET_RT_IFLISTL doesn't work for 386 emulation on amd64") } var tests = [2]struct { From d25c3eadea9bc5c8b6451c3502d6063dd618a3af Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 27 May 2016 15:41:55 +1200 Subject: [PATCH 052/120] cmd/compile: do not generate tail calls when dynamic linking on ppc64le When a wrapper method calls the real implementation, it's not possible to use a tail call when dynamic linking on ppc64le. The bad scenario is when a local call is made to the wrapper: the wrapper will call the implementation, which might be in a different module and so set the TOC to the appropriate value for that module. But if it returns directly to the wrapper's caller, nothing will reset it to the correct value for that function. Change-Id: Icebf24c9a2a0a9a7c2bce6bd6f1358657284fb10 Reviewed-on: https://go-review.googlesource.com/23468 Reviewed-by: Ian Lance Taylor Run-TryBot: Michael Hudson-Doyle TryBot-Result: Gobot Gobot --- misc/cgo/testshared/src/depBase/dep.go | 4 ++++ misc/cgo/testshared/src/exe2/exe2.go | 3 ++- src/cmd/compile/internal/gc/subr.go | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/misc/cgo/testshared/src/depBase/dep.go b/misc/cgo/testshared/src/depBase/dep.go index f9d3d7ce3a..3ceba34a2b 100644 --- a/misc/cgo/testshared/src/depBase/dep.go +++ b/misc/cgo/testshared/src/depBase/dep.go @@ -12,6 +12,10 @@ type Dep struct { X int } +func (d *Dep) Method() int { + return 10 +} + func F() int { return V } diff --git a/misc/cgo/testshared/src/exe2/exe2.go b/misc/cgo/testshared/src/exe2/exe2.go index acdb4ddcc5..675fd1f365 100644 --- a/misc/cgo/testshared/src/exe2/exe2.go +++ b/misc/cgo/testshared/src/exe2/exe2.go @@ -3,5 +3,6 @@ package main import "dep2" func main() { - dep2.W = dep2.G() + 1 + d := &dep2.Dep2{} + dep2.W = dep2.G() + 1 + d.Method() } diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index c2abff7b63..1db1cbade8 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -1860,7 +1860,13 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) { dot := adddot(NodSym(OXDOT, this.Left, method.Sym)) // generate call - if !instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !isifacemethod(method.Type) { + // It's not possible to use a tail call when dynamic linking on ppc64le. The + // bad scenario is when a local call is made to the wrapper: the wrapper will + // call the implementation, which might be in a different module and so set + // the TOC to the appropriate value for that module. But if it returns + // directly to the wrapper's caller, nothing will reset it to the correct + // value for that function. + if !instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !isifacemethod(method.Type) && !(Thearch.LinkArch.Name == "ppc64le" && Ctxt.Flag_dynlink) { // generate tail call: adjust pointer receiver and jump to embedded method. dot = dot.Left // skip final .M // TODO(mdempsky): Remove dependency on dotlist. From 17f7461ed66bbc66fef02ef7ca6901d116b6ff3d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 1 Jun 2016 21:09:58 -0700 Subject: [PATCH 053/120] doc/go1.7.html: fix spelling of cancelation We say "cancelation," not "cancellation." Fixes #15928. Change-Id: I66d545404665948a27281133cb9050eebf1debbb Reviewed-on: https://go-review.googlesource.com/23673 Reviewed-by: Ian Lance Taylor --- doc/go1.7.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.7.html b/doc/go1.7.html index 9ee377ec8f..37e1e56d24 100644 --- a/doc/go1.7.html +++ b/doc/go1.7.html @@ -362,7 +362,7 @@ packages. Go 1.7 moves the
+golang.org/x/net/contextpackage into the standard library ascontext. -This allows the use of contexts for cancellation, timeouts, and passing +This allows the use of contexts for cancelation, timeouts, and passing request-scoped data in other standard library packages, including net, From 6a0fd18016794a681580c8ca971c7d2d26f287bf Mon Sep 17 00:00:00 2001 From: Andrew GerrandDate: Thu, 2 Jun 2016 14:31:16 +1000 Subject: [PATCH 054/120] doc: mention net/http/httptrace package in release notes Updates #15810 Change-Id: I689e18409a88c9e8941aa2e98f472c331efd455e Reviewed-on: https://go-review.googlesource.com/23674 Reviewed-by: Ian Lance Taylor --- doc/go1.7.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/go1.7.html b/doc/go1.7.html index 37e1e56d24..3ae036cc5b 100644 --- a/doc/go1.7.html +++ b/doc/go1.7.html @@ -379,6 +379,13 @@ and the Go blog post “Go Concurrent Patterns: Context.” HTTP Tracing
+ ++Go 1.7 introduces
+net/http/httptrace, +a package that provides mechanisms for tracing events within HTTP requests. +Testing
From 15db3654b8e9fda6d41f4389879c8cd370f71a7e Mon Sep 17 00:00:00 2001 From: Anmol Sethi
Date: Wed, 1 Jun 2016 22:35:09 -0400 Subject: [PATCH 055/120] net/http: http.Request.Context doc fix The comment on http.Request.Context says that the context is canceled when the client's connection closes even though this has not been implemented. See #15927 Change-Id: I50b68638303dafd70f77f8f778e6caff102d3350 Reviewed-on: https://go-review.googlesource.com/23672 Reviewed-by: Andrew Gerrand --- src/net/http/request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/http/request.go b/src/net/http/request.go index e8780dea94..dc5559282d 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -275,9 +275,9 @@ type Request struct { // // For outgoing client requests, the context controls cancelation. // -// For incoming server requests, the context is canceled when either -// the client's connection closes, or when the ServeHTTP method -// returns. +// For incoming server requests, the context is canceled when the +// ServeHTTP method returns. For its associated values, see +// ServerContextKey and LocalAddrContextKey. func (r *Request) Context() context.Context { if r.ctx != nil { return r.ctx From ba22172832a971f0884106a5a8ff26a98a65623c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 2 Jun 2016 07:43:21 +0200 Subject: [PATCH 056/120] runtime: fix typo in comment Change-Id: I82e35770b45ccd1433dfae0af423073c312c0859 Reviewed-on: https://go-review.googlesource.com/23680 Reviewed-by: Andrew Gerrand --- src/runtime/traceback.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index f9d9f21eea..96f154e213 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -844,8 +844,8 @@ func isSystemGoroutine(gp *g) bool { // If the Context field is not 0, then it is a value returned by a // previous call to the context function. This case is called when the // context is no longer needed; that is, when the Go code is returning -// to its C code caller. This permits permits the context function to -// release any associated resources. +// to its C code caller. This permits the context function to release +// any associated resources. // // While it would be correct for the context function to record a // complete a stack trace whenever it is called, and simply copy that From 42c51debe824bd9b1fd93b3d50ff7187530754d3 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 1 Jun 2016 22:51:30 +0200 Subject: [PATCH 057/120] misc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS For #15919 Change-Id: I9fc38d9c8a9cc9406b551315e1599750fe212d0d Reviewed-on: https://go-review.googlesource.com/23635 Reviewed-by: David Crawshaw Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot --- misc/cgo/test/cthread.go | 4 ++++ misc/cgo/test/issue7978.go | 2 +- src/cmd/dist/test.go | 12 +----------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/misc/cgo/test/cthread.go b/misc/cgo/test/cthread.go index 1ca182c75e..af44911756 100644 --- a/misc/cgo/test/cthread.go +++ b/misc/cgo/test/cthread.go @@ -8,6 +8,7 @@ package cgotest import "C" import ( + "runtime" "sync" "testing" ) @@ -30,6 +31,9 @@ func Add(x int) { } func testCthread(t *testing.T) { + if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { + t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add") + } sum.i = 0 C.doAdd(10, 6) diff --git a/misc/cgo/test/issue7978.go b/misc/cgo/test/issue7978.go index d5f6cc71d0..e4cbf1d926 100644 --- a/misc/cgo/test/issue7978.go +++ b/misc/cgo/test/issue7978.go @@ -103,7 +103,7 @@ func test7978(t *testing.T) { if C.HAS_SYNC_FETCH_AND_ADD == 0 { t.Skip("clang required for __sync_fetch_and_add support on darwin/arm") } - if runtime.GOOS == "android" { + if runtime.GOOS == "android" || runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { t.Skip("GOTRACEBACK is not passed on to the exec wrapper") } if os.Getenv("GOTRACEBACK") != "2" { diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 33ed018245..0a384c73b2 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -465,11 +465,7 @@ func (t *tester) registerTests() { }) } } - if t.cgoEnabled && !t.iOS() { - // TODO(crawshaw): reenable on iOS - // golang.org/issue/15919 - // - // These tests are not designed to run off the host. + if t.cgoEnabled { t.tests = append(t.tests, distTest{ name: "cgo_test", heading: "../misc/cgo/test", @@ -729,12 +725,6 @@ func (t *tester) runHostTest(dirBanner, pkg string) error { func (t *tester) cgoTest(dt *distTest) error { env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) - if t.iOS() { - cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags()) - cmd.Env = env - return cmd.Run() - } - cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag("")) cmd.Env = env From 6c4f8cd0d17c8147319effcffcb608fc42eaf307 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 2 Jun 2016 15:00:34 +0200 Subject: [PATCH 058/120] misc/cgo/test: fix issue9400 test on android/386 The test for #9400 relies on an assembler function that manipulates the stack pointer. Meanwile, it uses a global variable for synchronization. However, position independent code on 386 use a function call to fetch the base address for global variables. That function call in turn overwrites the Go stack. Fix that by fetching the global variable address once before the stack register manipulation. Fixes the android/386 builder. Change-Id: Ib77bd80affaa12f09d582d09d8b84a73bd021b60 Reviewed-on: https://go-review.googlesource.com/23683 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: David Crawshaw --- misc/cgo/test/issue9400/asm_386.s | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/cgo/test/issue9400/asm_386.s b/misc/cgo/test/issue9400/asm_386.s index 83ca38531a..7f158b5c39 100644 --- a/misc/cgo/test/issue9400/asm_386.s +++ b/misc/cgo/test/issue9400/asm_386.s @@ -7,17 +7,18 @@ #include "textflag.h" TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0 + MOVL $·Baton(SB), BX // Rewind stack pointer so anything that happens on the stack // will clobber the test pattern created by the caller ADDL $(1024 * 8), SP // Ask signaller to setgid - MOVL $1, ·Baton(SB) + MOVL $1, (BX) // Wait for setgid completion loop: PAUSE - MOVL ·Baton(SB), AX + MOVL (BX), AX CMPL AX, $0 JNE loop From 14968bc1e52842b098408516472ebd3fb97e4714 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 2 Jun 2016 15:42:14 +0200 Subject: [PATCH 059/120] cmd/dist: skip an unsupported test on darwin/arm Fixes the darwin/arm builder (I hope) Change-Id: I8a3502a1cdd468d4bf9a1c895754ada420b305ce Reviewed-on: https://go-review.googlesource.com/23684 Run-TryBot: Elias Naur Reviewed-by: David Crawshaw --- src/cmd/dist/test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 0a384c73b2..e56d108ad4 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -728,7 +728,7 @@ func (t *tester) cgoTest(dt *distTest) error { cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag("")) cmd.Env = env - if t.gohostos != "dragonfly" && t.gohostarch != "ppc64le" && t.goos != "android" { + if t.gohostos != "dragonfly" && t.gohostarch != "ppc64le" && t.goos != "android" && (t.goos != "darwin" || t.goarch != "arm") { // linkmode=internal fails on dragonfly since errno is a TLS relocation. // linkmode=internal fails on ppc64le because cmd/link doesn't // handle the TOC correctly (issue 15409). From 905ced0e6ae33dca7ae6aa984d50cb02287952b1 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 2 Jun 2016 09:25:30 +0200 Subject: [PATCH 060/120] reflect: document StructOf embedded fields limitation This CL documents that StructOf currently does not generate wrapper methods for embedded fields. Updates #15924 Change-Id: I932011b1491d68767709559f515f699c04ce70d4 Reviewed-on: https://go-review.googlesource.com/23681 Reviewed-by: David Crawshaw --- src/reflect/type.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/reflect/type.go b/src/reflect/type.go index 1dff74df62..c9e14707fa 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -2351,6 +2351,9 @@ type structTypeFixed32 struct { // StructOf returns the struct type containing fields. // The Offset and Index fields are ignored and computed as they would be // by the compiler. +// +// StructOf currently does not generate wrapper methods for embedded fields. +// This limitation may be lifted in a future version. func StructOf(fields []StructField) Type { var ( hash = fnv1(0, []byte("struct {")...) From 04888c9770560e99de63fafdfc2ce39b47844bfd Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Thu, 2 Jun 2016 14:34:37 +0200 Subject: [PATCH 061/120] doc/go1.7: fix typo in nsswitch.conf name Fixes #15939 Change-Id: I120cbeac73a052fb3f328774e6d5e1534f11bf6b Reviewed-on: https://go-review.googlesource.com/23682 Reviewed-by: Ian Lance Taylor --- doc/go1.7.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.7.html b/doc/go1.7.html index 3ae036cc5b..a657fcc48a 100644 --- a/doc/go1.7.html +++ b/doc/go1.7.html @@ -795,7 +795,7 @@ Go 1.7 adds the hexadecimal encoding of the bytes, as in "?12ab".The pure Go name resolution -implementation now respects
From e90a49a0f5380c6f68502b1febfb73f696c2f610 Mon Sep 17 00:00:00 2001 From: Steve Phillipsnsswtch.conf's +implementation now respectsnsswitch.conf's stated preference for the priority of DNS lookups compared to local file (that is,/etc/hosts) lookups.Date: Thu, 2 Jun 2016 02:40:37 -0700 Subject: [PATCH 062/120] doc/go1.7.html: typo fix; replace "," at end of sentence with "." Signed-off-by: Steven Phillips Change-Id: Ie7c3253a5e1cd43be8fa12bad340204cc6c5ca76 Reviewed-on: https://go-review.googlesource.com/23677 Reviewed-by: Ian Lance Taylor --- doc/go1.7.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.7.html b/doc/go1.7.html index a657fcc48a..ae724e8a63 100644 --- a/doc/go1.7.html +++ b/doc/go1.7.html @@ -973,7 +973,7 @@ For compatibility with older mail parsers, the address encoder, namely Address'sStringmethod, -continues to escape all UTF-8 text following RFC 5322, +continues to escape all UTF-8 text following RFC 5322.
String method,
continues to escape all UTF-8 text following RFC 5322.
+
+
+The ParseAddress
+function and
+the AddressParser.Parse
+method are stricter.
+They used to ignore any characters following an e-mail address, but
+will now return an error for anything other than whitespace.
+
and
Change-Id: I5f4bf89345dc139063dcf34da653e914386bcde6
Reviewed-on: https://go-review.googlesource.com/23735
Reviewed-by: Ian Lance Taylor
---
doc/go1.7.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/go1.7.html b/doc/go1.7.html
index 2a3c3c95d2..e07933c885 100644
--- a/doc/go1.7.html
+++ b/doc/go1.7.html
@@ -401,7 +401,8 @@ See the package document
All panics started by the runtime now use panic values
-that implement both the builtin error
,
+that implement both the
+builtin error,
and
runtime.Error,
as
From cf862478c89fd94c4fe8d9ce1cb481d71e5136bf Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor
For 64-bit ARM systems, the vector register names have been
@@ -196,7 +196,7 @@ To build a toolchain that does not use frame pointers, set
make.bash, make.bat, or make.rc.
Packages using cgo may now include @@ -230,7 +230,7 @@ GCC release 6 contains the Go 1.6.1 version of gccgo. The next release, GCC 7, will likely have the Go 1.8 version of gccgo.
-
The go command's basic operation
@@ -270,7 +270,7 @@ will not work with such packages, and there are no plans to support
such packages in the “go get” command.
The “go doc” command
@@ -278,7 +278,7 @@ now groups constructors with the type they construct,
following godoc.
The “go vet” command
@@ -288,14 +288,14 @@ To avoid confusion with the new -tests check, the old, unadvertised
-test option has been removed; it was equivalent to -all -shadow.
The new subcommand “go tool dist list”
prints all supported operating system/architecture pairs.
The “go tool trace” command,
@@ -335,7 +335,7 @@ the code generation changes alone typically reduce program CPU time by 5-35%.
-
+
There have been significant optimizations bringing more than 10% improvements
to implementations in the
crypto/sha1,
@@ -470,7 +470,7 @@ made with the Go 1 promise of compatibility
in mind.
@@ -482,8 +482,9 @@ it would return an empty slice and the error ErrBufferFull.
Now it returns the entire underlying buffer, still accompanied by the error ErrBufferFull.
@@ -510,8 +511,9 @@ The
Reset to allow reuse of a Reader.
@@ -557,8 +559,9 @@ Now, it reports
io.EOF more eagerly when reading the last set of bytes.
@@ -594,8 +597,9 @@ When generating self-signed certificates, the package no longer sets the “Authority Key Identifier” field by default.
@@ -606,8 +610,9 @@ There is also a new associated error type
SystemRootsError.
@@ -621,8 +626,9 @@ help to find the compilation unit to pass to a and to identify the specific function for a given program counter.
@@ -632,8 +638,9 @@ and its many predefined constants support the S390 port.
@@ -641,8 +648,9 @@ The ASN.1 decoder now rejects non-minimal integer encodings. This may cause the package to reject some invalid but formerly accepted ASN.1 data.
@@ -706,8 +714,9 @@ so this change should be semantically backwards compatible with earlier versions even though it does change the chosen encoding.
@@ -718,8 +727,9 @@ the
adds new fields BinaryOnly, CgoFFLAGS, and FFiles.
@@ -728,8 +738,9 @@ To support the corresponding change in go test describ
indicating whether the example may generate its output lines in any order.
@@ -742,8 +753,9 @@ These constants are preferred over os.SEEK_SET, os.SEEK_CUR
but the latter will be preserved for compatibility.
@@ -756,8 +768,9 @@ so that values of type Float can now be encoded and decoded using t
package.
@@ -768,8 +781,9 @@ Previously, iteration over a map caused the section header to use a non-deterministic order.
@@ -801,8 +815,9 @@ stated preference for the priority of DNS lookups compared to
local file (that is, /etc/hosts) lookups.
@@ -888,8 +903,9 @@ this transparent decompression took place. adds support for a few new audio and video content types.
@@ -902,8 +918,9 @@ standard error away from the host process's standard error.
@@ -927,8 +944,9 @@ instead of accessing
ResponseRecorder's HeaderMap directly.
@@ -951,8 +969,9 @@ and instead.
@@ -962,8 +981,9 @@ allowing collection of traces for intervals smaller than one second. This is especially useful on busy servers.
@@ -986,8 +1006,9 @@ They used to ignore any characters following an e-mail address, but will now return an error for anything other than whitespace.
@@ -999,8 +1020,9 @@ in order to distinguish URLs without query strings (like /search)
from URLs with empty query strings (like /search?).
@@ -1015,8 +1037,9 @@ making the implementation behave as on non-Windows systems.
@@ -1027,8 +1050,9 @@ is like
Command but includes a context that can be used to cancel the command execution.
@@ -1047,8 +1071,9 @@ and the new field GroupIds in the User struct,
provides access to system-specific user group information.
@@ -1095,8 +1120,9 @@ methods of no longer return or count unexported methods.
@@ -1115,8 +1141,9 @@ The
Reset to allow reuse of a Reader.
@@ -1139,8 +1166,9 @@ cannot be found, for example on Windows. The Windows time zone abbreviation list has also been updated.
@@ -1157,3 +1185,4 @@ will call the system call before executing the new program.