]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
6 years ago[release-branch.go1.10] go1.10.2 go1.10.2
Andrew Bonventre [Mon, 30 Apr 2018 18:24:19 +0000 (14:24 -0400)]
[release-branch.go1.10] go1.10.2

Change-Id: I3d88ab55277e4386177cda06e2eb5a9b0e26cf93
Reviewed-on: https://go-review.googlesource.com/110338
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] doc: document Go 1.10.2
Andrew Bonventre [Mon, 30 Apr 2018 17:54:35 +0000 (13:54 -0400)]
[release-branch.go1.10] doc: document Go 1.10.2

Change-Id: I84334dfd02ad9a27b3fb6d46a6b1c015a3f03511
Reviewed-on: https://go-review.googlesource.com/110335
Reviewed-by: Filippo Valsorda <filippo@golang.org>
(cherry picked from commit 4bced5e9461429ae90245b0048c6fa5ff39a3947)
Reviewed-on: https://go-review.googlesource.com/110377
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years ago[release-branch.go1.10] doc: document Go 1.9.6
Andrew Bonventre [Mon, 30 Apr 2018 17:49:16 +0000 (13:49 -0400)]
[release-branch.go1.10] doc: document Go 1.9.6

Change-Id: I9699b22d3a308cda685aa684b32dcde99333df46
Reviewed-on: https://go-review.googlesource.com/110315
Reviewed-by: Filippo Valsorda <filippo@golang.org>
(cherry picked from commit 587416c1617c4d5c970ca382dead63f9576c0de5)
Reviewed-on: https://go-review.googlesource.com/110376
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years ago[release-branch.go1.10] cmd/internal/obj/mips: load/store even float registers first
James Cowgill [Wed, 28 Feb 2018 16:10:14 +0000 (16:10 +0000)]
[release-branch.go1.10] cmd/internal/obj/mips: load/store even float registers first

There is a bug in Octeon III processors where storing an odd floating
point register after it has recently been written to by a double
floating point operation will store the old value from before the double
operation (there are some extra details - the operation and store
must be a certain number of cycles apart). However, this bug does not
occur if the even register is stored first. Currently the bug only
happens on big endian because go always loads the even register first on
little endian.

Workaround the bug by always loading / storing the even floating point
register first. Since this is just an instruction reordering, it should
have no performance penalty. This follows other compilers like GCC which
will always store the even register first (although you do have to set
the ISA level to MIPS I to prevent it from using SDC1).

Fixes golang/go#24995

Change-Id: I5e73daa4d724ca1df7bf5228aab19f53f26a4976
Reviewed-on: https://go-review.googlesource.com/97735
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 423111081b87c6c4e61c4d94c94bfdf1853fa01f)
Reviewed-on: https://go-review.googlesource.com/110078
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] cmd/internal/test2json: support subtests containing colons
Daniel Martí [Sat, 3 Mar 2018 19:53:53 +0000 (19:53 +0000)]
[release-branch.go1.10] cmd/internal/test2json: support subtests containing colons

The "updates" lines, such as RUN, do not contain a colon. However,
test2json looked for one anyway, meaning that it would be thrown off if
it encountered a line like:

=== RUN   TestWithColons/[::1]

In that case, it must not use the first colon it encounters to separate
the action from the test name.

Fixes golang/go#25027

Change-Id: I82eff23e24b83dae183c0cf9f85fc5f409f51c25
Reviewed-on: https://go-review.googlesource.com/98445
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 0c5cfec84424bb453ccd270f4b5c439f21ccf617)
Reviewed-on: https://go-review.googlesource.com/110075
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] cmd/compile: fix evaluation of "" < s
Josh Bleecher Snyder [Thu, 12 Apr 2018 15:23:00 +0000 (08:23 -0700)]
[release-branch.go1.10] cmd/compile: fix evaluation of "" < s

Fixes #24935

Change-Id: Ifa79ab3dfe69297eeef85f7193cd5f85e5982bc5
Reviewed-on: https://go-review.googlesource.com/106655
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-on: https://go-review.googlesource.com/108944
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] cmd/go: fix go list .Stale computation
Russ Cox [Wed, 18 Apr 2018 20:34:45 +0000 (16:34 -0400)]
[release-branch.go1.10] cmd/go: fix go list .Stale computation

If X depends on Y and X was installed but Y is only present in the cache
(as happens when you "go install X") then we should report X as up-to-date,
not as stale.

This applies whether X is a package or a main binary.

Fixes golang/go#25026
Fixes golang/go#25032

Change-Id: I26a0b375b1f7f7ac909cc0db68e92f4e04529208
Reviewed-on: https://go-review.googlesource.com/107957
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 9e0e6981fc536c9e51ce24c425141a3d09b39e3a)
Reviewed-on: https://go-review.googlesource.com/110076
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] cmd/link: do not pass -no-pie to host linker when -linkshared...
Michael Hudson-Doyle [Wed, 4 Apr 2018 22:07:41 +0000 (10:07 +1200)]
[release-branch.go1.10] cmd/link: do not pass -no-pie to host linker when -linkshared is passed

As the comment above the code I'm changing says, when building with
-buildmode=exe, the default compiler flags produce code incompatible with PIE.
But when -linkshared is passed, the default compiler flags are not used so this
does not apply. And now I've found a system (linux/arm64 with glibc 2.27) where
this combination of flags causes a problem, albeit for reasons I don't really
understand, so stop passing -no-pie when -linkshared is passed.

Fixes golang/go#24873

Change-Id: I412ec7941dc0cb89e6d1b171fc29288aadcb9f20
Reviewed-on: https://go-review.googlesource.com/104815
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 2d26a65f8f1a6fcb0948803589061d99b94fa993)
Reviewed-on: https://go-review.googlesource.com/110035
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] cmd/go: skip TestVetWithOnlyCgoFiles when cgo is disabled
David du Colombier [Wed, 7 Mar 2018 22:03:24 +0000 (23:03 +0100)]
[release-branch.go1.10] cmd/go: skip TestVetWithOnlyCgoFiles when cgo is disabled

CL 99175 added TestVetWithOnlyCgoFiles. However, this
test is failing on platforms where cgo is disabled,
because no file can be built.

This change fixes TestVetWithOnlyCgoFiles by skipping
this test when cgo is disabled.

Fixes #24304.

Change-Id: Ibb38fcd3e0ed1a791782145d3f2866f12117c6fe
Reviewed-on: https://go-review.googlesource.com/99275
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit b1335037fad4c81ce296f652372aa631a29dcb48)
Reviewed-on: https://go-review.googlesource.com/103223
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] go1.10.1 go1.10.1
Andrew Bonventre [Thu, 29 Mar 2018 03:44:19 +0000 (23:44 -0400)]
[release-branch.go1.10] go1.10.1

Change-Id: I0636f60e705f8182d6fba4ce6199c67f94c04e36
Reviewed-on: https://go-review.googlesource.com/103168
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] runtime: identify special functions by flag instead of address
Keith Randall [Wed, 14 Mar 2018 22:21:37 +0000 (15:21 -0700)]
[release-branch.go1.10] runtime: identify special functions by flag instead of address

When there are plugins, there may not be a unique copy of runtime
functions like goexit, mcall, etc.  So identifying them by entry
address is problematic.  Instead, keep track of each special function
using a field in the symbol table.  That way, multiple copies of
the same runtime function will be treated identically.

Fixes #24351
Fixes #23133

Change-Id: Iea3232df8a6af68509769d9ca618f530cc0f84fd
Reviewed-on: https://go-review.googlesource.com/100739
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/102793
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.10] doc: update 1.9.5 release notes to include net/http/pprof
Andrew Bonventre [Thu, 29 Mar 2018 01:25:09 +0000 (21:25 -0400)]
[release-branch.go1.10] doc: update 1.9.5 release notes to include net/http/pprof

Change-Id: I7c0716711a2cadd347fdf242c792b109539f7355
Reviewed-on: https://go-review.googlesource.com/103163
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-on: https://go-review.googlesource.com/103166
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] doc: update release notes for Go 1.9.5
Andrew Bonventre [Thu, 29 Mar 2018 01:11:05 +0000 (21:11 -0400)]
[release-branch.go1.10] doc: update release notes for Go 1.9.5

Change-Id: Idf88d289bac9603d852a9d19eb4b764f8589f8d9
Reviewed-on: https://go-review.googlesource.com/103159
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-on: https://go-review.googlesource.com/103162
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] doc: document Go 1.10.1
Andrew Bonventre [Wed, 28 Mar 2018 21:51:05 +0000 (17:51 -0400)]
[release-branch.go1.10] doc: document Go 1.10.1

Change-Id: Ibba5d4fd8124db9b1e4e50b8f37366f8dd23f47e
Reviewed-on: https://go-review.googlesource.com/103217
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/103222
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] doc: document Go 1.9.5
Andrew Bonventre [Wed, 28 Mar 2018 21:42:01 +0000 (17:42 -0400)]
[release-branch.go1.10] doc: document Go 1.9.5

Change-Id: I8f12b188d2e13555e1d7634b9cc0319fc737cb1d
Reviewed-on: https://go-review.googlesource.com/103216
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/103221
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] net/http/pprof: harden handler responses
Andrew Bonventre [Fri, 23 Mar 2018 20:40:15 +0000 (16:40 -0400)]
[release-branch.go1.10] net/http/pprof: harden handler responses

A very small number of old browsers consider content as HTML
even when it is explicitly stated in the Content-Type header
that it is not. If content served is based on user-supplied
input, then an XSS is possible. Introduce three mitigations:

+ Don't reflect user input in error strings
+ Set a Content-Disposition header when requesting a resource
  that should never be displayed in a browser window
+ Set X-Content-Type-Options: nosniff on all responses

Change-Id: I81c9d6736e0439ebd1db99cd7fb701cc56d24805
Reviewed-on: https://go-review.googlesource.com/102318
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/103218
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] cmd/go: add more C compiler/linker options to whitelist
Ian Lance Taylor [Wed, 28 Mar 2018 00:06:53 +0000 (17:06 -0700)]
[release-branch.go1.10] cmd/go: add more C compiler/linker options to whitelist

Fixes #23937

Change-Id: Ie63d91355d1a724d0012d99d457d939deeeb8d3e
Reviewed-on: https://go-review.googlesource.com/102818
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-on: https://go-review.googlesource.com/103015
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] cmd/go: if -race, don't run coverage on runtime packages
Ian Lance Taylor [Sat, 17 Feb 2018 03:08:59 +0000 (19:08 -0800)]
[release-branch.go1.10] cmd/go: if -race, don't run coverage on runtime packages

Don't compile the runtime packages with coverage when using the race
detector. The user can, perhaps accidentally, request coverage for the
runtime by using -coverpkg=all. If using the race detector, the
runtime package coverage will call into the race detector before it
has been initialized. This will cause the program to crash
mysteriously on startup.

Fixes #23882

Change-Id: I9a63867a9138797d8b8afb0856ae21079accdb27
Reviewed-on: https://go-review.googlesource.com/94898
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-on: https://go-review.googlesource.com/103095
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] crypto/x509: matching any requested EKU should be sufficient.
Adam Langley [Wed, 28 Feb 2018 19:35:54 +0000 (11:35 -0800)]
[release-branch.go1.10] crypto/x509: matching any requested EKU should be sufficient.

The documentation was unclear here and I misremembered the behaviour and
changed it in 1.10: it used to be that matching any EKU was enough but
1.10 requires that all EKUs match.

Restore 1.9 behaviour and clarify the documentation to make it official.

Fixes #24162.

Change-Id: Ic9466cd0799cb27ec3a3a7e6c96f10c2aacc7020
Reviewed-on: https://go-review.googlesource.com/97720
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-on: https://go-review.googlesource.com/102790
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] go/internal/srcimporter: simplify and fix package file lookup
Hiroshi Ioka [Mon, 11 Dec 2017 23:59:01 +0000 (08:59 +0900)]
[release-branch.go1.10] go/internal/srcimporter: simplify and fix package file lookup

The old code was a blend of (copied) code that existed before go/build,
and incorrect adjustments made when go/build was introduced. This change
leaves package path determination entirely to go/build and in the process
fixes issues with relative import paths.

Fixes #23092
Fixes #24392

Change-Id: I9e900538b365398751bace56964495c5440ac4ae
Reviewed-on: https://go-review.googlesource.com/83415
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/102789
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] cmd/compile: mark LAA and LAAG as clobbering flags on s390x
Michael Munday [Mon, 19 Mar 2018 17:11:16 +0000 (13:11 -0400)]
[release-branch.go1.10] cmd/compile: mark LAA and LAAG as clobbering flags on s390x

The atomic add instructions modify the condition code and so need to
be marked as clobbering flags.

Fixes #24449.

Change-Id: Ic69c8d775fbdbfb2a56c5e0cfca7a49c0d7f6897
Reviewed-on: https://go-review.googlesource.com/101455
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102788
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Michael Munday <mike.munday@ibm.com>
6 years ago[release-branch.go1.10] net: don't let cancelation of a DNS lookup affect another...
Ian Lance Taylor [Thu, 15 Mar 2018 18:55:30 +0000 (11:55 -0700)]
[release-branch.go1.10] net: don't let cancelation of a DNS lookup affect another lookup

Updates #8602
Updates #20703
Fixes #22724

Change-Id: I27b72311b2c66148c59977361bd3f5101e47b51d
Reviewed-on: https://go-review.googlesource.com/100840
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102787
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] syscall: use Android O friendly fstatat syscall to implement...
Tobias Klauser [Thu, 15 Mar 2018 09:45:51 +0000 (10:45 +0100)]
[release-branch.go1.10] syscall: use Android O friendly fstatat syscall to implement Stat on linux/amd64

The Android O seccomp policy disallows the stat syscall on amd64, see
https://android.googlesource.com/platform/bionic/+/android-4.2.2_r1.2/libc/SYSCALLS.TXT

Use the fstatat syscall with AT_FDCWD and zero flags instead to achieve
the same behavior.

Fixes #24403

Change-Id: I36fc9ec9bc938cd8e9de30f66c0eb9d2e24debf6
Reviewed-on: https://go-review.googlesource.com/100878
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/102976
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] runtime: use Android O friendly faccessat syscall on linux...
Tobias Klauser [Thu, 15 Mar 2018 09:21:57 +0000 (10:21 +0100)]
[release-branch.go1.10] runtime: use Android O friendly faccessat syscall on linux/amd64

The Android O seccomp policy disallows the access syscall on amd64, see
https://android.googlesource.com/platform/bionic/+/android-4.2.2_r1.2/libc/SYSCALLS.TXT

Use the faccessat syscall with AT_FDCWD instead to achieve the same
behavior.

Updates #24403

Change-Id: I9db847c1c0f33987a3479b3f96e721fb9588cde2
Reviewed-on: https://go-review.googlesource.com/100877
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102995
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] runtime: add symbol for AT_FDCWD on Linux amd64 and mips64x
Tobias Klauser [Tue, 13 Feb 2018 16:07:54 +0000 (17:07 +0100)]
[release-branch.go1.10] runtime: add symbol for AT_FDCWD on Linux amd64 and mips64x

Also order the syscall number list by numerically for mips64x.

Follow-up for CL 92895.

Change-Id: I5f01f8c626132a06160997fce8a2aef0c486bb1c
Reviewed-on: https://go-review.googlesource.com/93616
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/103035
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] runtime: use Android O friendly syscalls on 64-bit machines
Jason A. Donenfeld [Thu, 8 Feb 2018 15:59:17 +0000 (16:59 +0100)]
[release-branch.go1.10] runtime: use Android O friendly syscalls on 64-bit machines

Android O disallows open on 64-bit, so let's use openat with AT_FDCWD to
achieve the same behavior.

Android O disallows epoll_wait on 64-bit, so let's use epoll_pwait with
the last argument as NULL to achieve the same behavior.

See here:
https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/arm64_app_policy.cpp
https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/mips64_app_policy.cpp
https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/x86_64_app_policy.cpp

Fixes #23750

Change-Id: If8d5a663357471e5d2c1f516151344a9d05b188a
Reviewed-on: https://go-review.googlesource.com/92895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/102792
Run-TryBot: Andrew Bonventre <andybons@golang.org>

6 years ago[release-branch.go1.10] cmd/cover: don't crash on non-gofmt'ed input
Ian Lance Taylor [Tue, 6 Mar 2018 15:57:19 +0000 (07:57 -0800)]
[release-branch.go1.10] cmd/cover: don't crash on non-gofmt'ed input

Without the change to cover.go, the new test fails with

panic: overlapping edits: [4946,4950)->"", [4947,4947)->"thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest.Count[112]++;"

The original code inserts "else{", deletes "else", and then positions
a new block just after the "}" that must come before the "else".
That works on gofmt'ed code, but fails if the code looks like "}else".
When there is no space between the "{" and the "else", the new block
is inserted into a location that we are deleting, leading to the
"overlapping edits" mentioned above.

This CL fixes this case by not deleting the "else" but just using the
one that is already there. That requires adjust the block offset to
come after the "{" that we insert.

Fixes #23927

Change-Id: I40ef592490878765bbce6550ddb439e43ac525b2
Reviewed-on: https://go-review.googlesource.com/98935
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/102786
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] cmd/go: run vet on packages with only cgo files
Ian Lance Taylor [Wed, 7 Mar 2018 15:03:46 +0000 (07:03 -0800)]
[release-branch.go1.10] cmd/go: run vet on packages with only cgo files

CgoFiles is not included in GoFiles, so we need to check both.

Fixes #24193

Change-Id: I6a67bd912e3d9a4be0eae8fa8db6fa8a07fb5df3
Reviewed-on: https://go-review.googlesource.com/99175
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102785
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] encoding/json: avoid assuming side-effect free reflect.Value...
Joe Tsai [Wed, 28 Feb 2018 21:45:06 +0000 (13:45 -0800)]
[release-branch.go1.10] encoding/json: avoid assuming side-effect free reflect.Value.Addr().Elem()

Consider the following:
type child struct{ Field string }
type parent struct{ child }

p := new(parent)
v := reflect.ValueOf(p).Elem().Field(0)
v.Field(0).SetString("hello")           // v.Field = "hello"
v = v.Addr().Elem()                     // v = *(&v)
v.Field(0).SetString("goodbye")         // v.Field = "goodbye"

It would appear that v.Addr().Elem() should have the same value, and
that it would be safe to set "goodbye".
However, after CL 66331, any interspersed calls between Field calls
causes the RO flag to be set.
Thus, setting to "goodbye" actually causes a panic.

That CL affects decodeState.indirect which assumes that back-to-back
Value.Addr().Elem() is side-effect free. We fix that logic to keep
track of the Addr() and Elem() calls and set v back to the original
after a full round-trip has occured.

Fixes #24152
Updates #24153

Change-Id: Ie50f8fe963f00cef8515d89d1d5cbc43b76d9f9c
Reviewed-on: https://go-review.googlesource.com/97796
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/102784
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] crypto/x509: parse invalid DNS names and email addresses.
Adam Langley [Thu, 22 Feb 2018 20:05:29 +0000 (12:05 -0800)]
[release-branch.go1.10] crypto/x509: parse invalid DNS names and email addresses.

Go 1.10 requires that SANs in certificates are valid. However, a
non-trivial number of (generally non-WebPKI) certificates have invalid
strings in dnsName fields and some have even put those dnsName SANs in
CA certificates.

This change defers validity checking until name constraints are checked.

Fixes #23995, #23711.

Change-Id: I2e0ebb0898c047874a3547226b71e3029333b7f1
Reviewed-on: https://go-review.googlesource.com/96378
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102783
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years ago[release-branch.go1.10] archive/zip: fix handling of Info-ZIP Unix extended timestamps
Joe Tsai [Fri, 23 Feb 2018 23:08:11 +0000 (15:08 -0800)]
[release-branch.go1.10] archive/zip: fix handling of Info-ZIP Unix extended timestamps

The Info-ZIP Unix1 extra field is specified as such:
>>>
Value    Size   Description
-----    ----   -----------
0x5855   Short  tag for this extra block type ("UX")
TSize    Short  total data size for this block
AcTime   Long   time of last access (GMT/UTC)
ModTime  Long   time of last modification (GMT/UTC)
<<<

The previous handling was incorrect in that it read the AcTime field
instead of the ModTime field.

The test-osx.zip test unfortunately locked in the wrong behavior.
Manually parsing that ZIP file shows that the encoded MS-DOS
date and time are 0x4b5f and 0xa97d, which corresponds with a
date of 2017-10-31 21:11:58, which matches the correct mod time
(off by 1 second due to MS-DOS timestamp resolution).

Fixes #23901

Change-Id: I567824c66e8316b9acd103dbecde366874a4b7ef
Reviewed-on: https://go-review.googlesource.com/96895
Run-TryBot: Joe Tsai <joetsai@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/102782
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] runtime: don't check for String/Error methods in printany
Ian Lance Taylor [Fri, 23 Feb 2018 18:34:01 +0000 (10:34 -0800)]
[release-branch.go1.10] runtime: don't check for String/Error methods in printany

They have either already been called by preprintpanics, or they can
not be called safely because of the various conditions checked at the
start of gopanic.

Fixes #24059

Change-Id: I4a6233d12c9f7aaaee72f343257ea108bae79241
Reviewed-on: https://go-review.googlesource.com/96755
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/102781
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] crypto/x509: tighten EKU checking for requested EKUs.
Adam Langley [Thu, 22 Feb 2018 20:30:44 +0000 (12:30 -0800)]
[release-branch.go1.10] crypto/x509: tighten EKU checking for requested EKUs.

There are, sadly, many exceptions to EKU checking to reflect mistakes
that CAs have made in practice. However, the requirements for checking
requested EKUs against the leaf should be tighter than for checking leaf
EKUs against a CA.

Fixes #23884

Change-Id: I05ea874c4ada0696d8bb18cac4377c0b398fcb5e
Reviewed-on: https://go-review.googlesource.com/96379
Reviewed-by: Jonathan Rudenberg <jonathan@titanous.com>
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Run-TryBot: Filippo Valsorda <hi@filippo.io>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/102780
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years ago[release-branch.go1.10] cmd/go: permit pkg-config flags in any argument position
Ian Lance Taylor [Sat, 17 Feb 2018 00:17:44 +0000 (16:17 -0800)]
[release-branch.go1.10] cmd/go: permit pkg-config flags in any argument position

Fixes #23875

Change-Id: I503af71f44d11cd6b787fef100246b55735614a0
Reviewed-on: https://go-review.googlesource.com/94896
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102779
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.10] cmd/go: restrict meta imports to valid schemes
Ian Lance Taylor [Thu, 15 Feb 2018 23:57:13 +0000 (15:57 -0800)]
[release-branch.go1.10] cmd/go: restrict meta imports to valid schemes

Before this change, when using -insecure, we permitted any meta import
repo root as long as it contained "://". When not using -insecure, we
restrict meta import repo roots to be valid URLs. People may depend on
that somehow, so permit meta import repo roots to be invalid URLs, but
require them to have valid schemes per RFC 3986.

Fixes #23867

Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d
Reviewed-on: https://go-review.googlesource.com/94603
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102778
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] doc: update devel/release.html to add Go 1.10
Andrew Bonventre [Sat, 17 Feb 2018 04:26:02 +0000 (23:26 -0500)]
[release-branch.go1.10] doc: update devel/release.html to add Go 1.10

Change-Id: I869f1607b0209ad190bc02999879f0682965fdf7
Reviewed-on: https://go-review.googlesource.com/94915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 27be37a4038e0c5e11510e7b0b6ec4f2c4cfc879)
Reviewed-on: https://go-review.googlesource.com/94916
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.10] go1.10 go1.10
Andrew Bonventre [Fri, 16 Feb 2018 04:20:11 +0000 (23:20 -0500)]
[release-branch.go1.10] go1.10

Change-Id: I3663c2156d093efa09343512a69f040ecc8331e0
Reviewed-on: https://go-review.googlesource.com/94696
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.10] cmd/go: add options to security whitelist
Ian Lance Taylor [Wed, 14 Feb 2018 01:43:16 +0000 (17:43 -0800)]
[release-branch.go1.10] cmd/go: add options to security whitelist

Also permit passing flags to pkg-config, as we used to.

Also change the error message to refer to https://golang.org/s/invalidflag.

Fixes #23749

Change-Id: I3fbeb4c346610e6fd55e8720e720b0a40e352ab5
Reviewed-on: https://go-review.googlesource.com/93836
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit f7c2a71632854050d9fe6de115c6c346fcd9774c)
Reviewed-on: https://go-review.googlesource.com/94676
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years ago[release-branch.go1.10] cmd/compile: permit go:cgo_import_dynamic anywhere
Ian Lance Taylor [Wed, 14 Feb 2018 15:42:40 +0000 (07:42 -0800)]
[release-branch.go1.10] cmd/compile: permit go:cgo_import_dynamic anywhere

It's used on Solaris to import symbols from shared libraries, e.g., in
golang.org/x/sys/unix and golang.org/x/net/internal/socket.
We could use a different directive but that would require build tags
in all the places that use it.

Updates #23672
Updates #23749

Change-Id: I47fcf72a6d2862e304204705979c2056c2f78ec5
Reviewed-on: https://go-review.googlesource.com/94018
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 4a54ff21c25f1b5d7a4f73fd33214e1f8c83a9b9)
Reviewed-on: https://go-review.googlesource.com/94675
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years ago[release-branch.go1.10] doc: add note about invalid flag errors to 1.10 release notes
Ian Lance Taylor [Thu, 15 Feb 2018 02:04:54 +0000 (18:04 -0800)]
[release-branch.go1.10] doc: add note about invalid flag errors to 1.10 release notes

Updates #23672
Updates #23749

Change-Id: I85b6493bd1e4095398508b7ef395c35463dfbde1
Reviewed-on: https://go-review.googlesource.com/94158
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit f2354d0aacdd5ce1952c5441c6a489378ccb7656)
Reviewed-on: https://go-review.googlesource.com/94655

6 years ago[release-branch.go1.10] doc: mention net/http Server Content-Type change
Brad Fitzpatrick [Tue, 5 Dec 2017 22:31:25 +0000 (22:31 +0000)]
[release-branch.go1.10] doc: mention net/http Server Content-Type change

Updates #20784

Change-Id: Ic07c78a86da5026e407ac9ecb3117d320c198048
Reviewed-on: https://go-review.googlesource.com/93695
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.10] doc: remove draft notice from Go 1.10 release notes
Ian Lance Taylor [Thu, 15 Feb 2018 02:08:19 +0000 (18:08 -0800)]
[release-branch.go1.10] doc: remove draft notice from Go 1.10 release notes

Change-Id: I063b556b59ecb8a8f4a3f121c32982b90eee2d74
Reviewed-on: https://go-review.googlesource.com/94159
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 229a8ce639f6c729700ad19321705b654890b502)
Reviewed-on: https://go-review.googlesource.com/94455

6 years ago[release-branch.go1.10] cmd/compile: fix constant folding of right shifts on s390x
Keith Randall [Wed, 14 Feb 2018 22:21:31 +0000 (14:21 -0800)]
[release-branch.go1.10] cmd/compile: fix constant folding of right shifts on s390x

Repeat previous fix on amd64 for s390x.
Sub-word right shifts should sign extend before shifting.

Update #23812

Change-Id: I2d770190c7d8a22310b0dbd9facb3fb05afa362a
Reviewed-on: https://go-review.googlesource.com/94028
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 1566bf90253097dfec83f621a48e761ded4d2144)
Reviewed-on: https://go-review.googlesource.com/94216

6 years ago[release-branch.go1.10] cmd/compile: fix constant folding of right shifts
Keith Randall [Tue, 13 Feb 2018 20:33:55 +0000 (12:33 -0800)]
[release-branch.go1.10] cmd/compile: fix constant folding of right shifts

The sub-word shifts need to sign-extend before shifting, to avoid
bringing in data from higher in the argument.

Fixes #23812

Change-Id: I0a95a0b49c48f3b40b85765bb4a9bb492be0cd73
Reviewed-on: https://go-review.googlesource.com/93716
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 755b36aa532f6b23081bf5eaf83449c1a6dd8114)
Reviewed-on: https://go-review.googlesource.com/94215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoall: restore changes from faulty merge/revert
Andrew Bonventre [Mon, 12 Feb 2018 20:13:33 +0000 (20:13 +0000)]
all: restore changes from faulty merge/revert

This reverts commit 3b6abd8a4501d816e80b4d46e6fda4df486ccb66.

Change-Id: I8ca100501c1844af78a547989786d14dac6b494a
Reviewed-on: https://go-review.googlesource.com/93456
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agoRevert "[release-branch.go1.10] all: merge master into release-branch.go1.10"
Andrew Bonventre [Mon, 12 Feb 2018 20:09:58 +0000 (20:09 +0000)]
Revert "[release-branch.go1.10] all: merge master into release-branch.go1.10"

This reverts commit b83d7f72537bdc0cec2e949d73ae40fbd42b7c63.

Reason for revert: wrong branch

Change-Id: I28ebb121f7b3e331729e8a6a00961b876f3dd0f2
Reviewed-on: https://go-review.googlesource.com/93455
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years ago[release-branch.go1.10] all: merge master into release-branch.go1.10
Andrew Bonventre [Mon, 12 Feb 2018 20:05:15 +0000 (15:05 -0500)]
[release-branch.go1.10] all: merge master into release-branch.go1.10

74b56022a1 doc: note that x509 cert parsing rejects some more certs now
c52e27e68d CONTRIBUTING: remove Pull Request bit
829b64c1ea cmd/fix: fix cast check
ee59f6dff2 doc: minor wording improvement to the diagnostics guide
c6e7330ebd all: remove PULL_REQUEST_TEMPLATE from .github
d814c2be9b doc: remove Pull Request note in README.md
104445e314 doc: document Go 1.9.4 and Go 1.8.7

Change-Id: I58bfc6800964504258690d774a9b0aeaba509086

6 years agodoc: note that x509 cert parsing rejects some more certs now
Brad Fitzpatrick [Wed, 7 Feb 2018 16:07:34 +0000 (16:07 +0000)]
doc: note that x509 cert parsing rejects some more certs now

Fixes #23711

6 years agoCONTRIBUTING: remove Pull Request bit
Brad Fitzpatrick [Sun, 11 Feb 2018 16:20:38 +0000 (16:20 +0000)]
CONTRIBUTING: remove Pull Request bit

Also remove the "Also, please do not post patches on the issue
tracker" part, since that didn't seem to reduce the number of patches
inlined into bug reports. And now that we accept PRs, people will
probably try that first. We'll see.

Fixes #23779
Updates #18517

Change-Id: I449e0afd7292718e57d9d428494799c78296a0d2
Reviewed-on: https://go-review.googlesource.com/93335
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agocmd/fix: fix cast check
Keith Randall [Fri, 9 Feb 2018 19:21:37 +0000 (11:21 -0800)]
cmd/fix: fix cast check

Need 2-result cast so we can check the result correctly.

Fixes #23762

Change-Id: Icac3a5415156fe918988f369d6022a9a29c14089
Reviewed-on: https://go-review.googlesource.com/93078
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agodoc: minor wording improvement to the diagnostics guide
JBD [Fri, 9 Feb 2018 01:14:31 +0000 (01:14 +0000)]
doc: minor wording improvement to the diagnostics guide

Change-Id: I8469fbbb934f096f04ad68c592aacdb805b6d2d4
GitHub-Last-Rev: 6d2cfcc23d0d8e6a1b6ca383dae51f0cada2e1b3
GitHub-Pull-Request: golang/go#23754
Reviewed-on: https://go-review.googlesource.com/92996
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agoall: remove PULL_REQUEST_TEMPLATE from .github
Andrew Bonventre [Fri, 9 Feb 2018 00:29:19 +0000 (19:29 -0500)]
all: remove PULL_REQUEST_TEMPLATE from .github

Update golang/go#18517

Change-Id: I76d928d5fcc5ed22beaffb86f0fa8fbf6d4ac3d7
Reviewed-on: https://go-review.googlesource.com/93035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: remove Pull Request note in README.md
Andrew Bonventre [Thu, 8 Feb 2018 23:50:16 +0000 (23:50 +0000)]
doc: remove Pull Request note in README.md

Since we now accept Pull Requests via GerritBot, this comment is obsolete.

Change-Id: I0de8ecff7d1f146320a52f143e65068f8adbeaa6
GitHub-Last-Rev: 01818bdf7a8361efde427a872b813f2e8510cef7
GitHub-Pull-Request: golang/go#23752
Reviewed-on: https://go-review.googlesource.com/92995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: document Go 1.9.4 and Go 1.8.7
Russ Cox [Wed, 7 Feb 2018 19:10:48 +0000 (14:10 -0500)]
doc: document Go 1.9.4 and Go 1.8.7

Change-Id: I50928e7747f43858fc863b53cfb5b63e208d6932
Reviewed-on: https://team-review.git.corp.google.com/213447
Reviewed-by: Andrew Bonventre <andybons@google.com>
6 years ago[release-branch.go1.10] go1.10rc2 go1.10rc2
Russ Cox [Wed, 7 Feb 2018 16:05:41 +0000 (11:05 -0500)]
[release-branch.go1.10] go1.10rc2

Change-Id: I393ff9e8599d20f71545ab9f4191993f5d6fa5a4
Reviewed-on: https://team-review.git.corp.google.com/213247
Reviewed-by: Andrew Bonventre <andybons@google.com>
6 years ago[release-branch.go1.10] all: merge master into release-branch.go1.10, for go1.10rc2
Russ Cox [Wed, 7 Feb 2018 15:37:00 +0000 (10:37 -0500)]
[release-branch.go1.10] all: merge master into release-branch.go1.10, for go1.10rc2

This adds the go get security fix.

1dcb5836 cmd/go: accept only limited compiler and linker flags in #cgo directives

Change-Id: Ib2caf2039d2cefabe3afa0bb4dcc4c0dc8d664ff

6 years agocmd/go: accept only limited compiler and linker flags in #cgo directives
Russ Cox [Thu, 1 Feb 2018 19:07:21 +0000 (14:07 -0500)]
cmd/go: accept only limited compiler and linker flags in #cgo directives

Both gcc and clang accept an option -fplugin=code.so to load
a plugin from the ELF shared object file code.so.
Obviously that plugin can then do anything it wants
during the build. This is contrary to the goal of "go get"
never running untrusted code during the build.
(What happens if you choose to run the result of
the build is your responsibility.)

Disallow this behavior by only allowing a small set of
known command-line flags in #cgo CFLAGS directives
(and #cgo LDFLAGS, etc).

The new restrictions can be adjusted by the environment
variables CGO_CFLAGS_ALLOW, CGO_CFLAGS_DISALLOW,
and so on. See the documentation.

In addition to excluding cgo-defined flags, we also have to
make sure that when we pass file names on the command
line, they don't look like flags. So we now refuse to build
packages containing suspicious file names like -x.go.

A wrinkle in all this is that GNU binutils uniformly accept
@foo on the command line to mean "if the file foo exists,
then substitute its contents for @foo in the command line".
So we must also reject @x.go, flags and flag arguments
beginning with @, and so on.

Fixes #23672, CVE-2018-6574.

Change-Id: I59e7c1355155c335a5c5ae0d2cf8fa7aa313940a
Reviewed-on: https://team-review.git.corp.google.com/209949
Reviewed-by: Ian Lance Taylor <iant@google.com>
6 years agoall: merge master into release-branch.go1.10, for go1.10rc2
Russ Cox [Wed, 7 Feb 2018 14:33:20 +0000 (09:33 -0500)]
all: merge master into release-branch.go1.10, for go1.10rc2

b2d3d6e6 cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
c07095cd cmd/cgo: revert CL 49490 "fix for function taking pointer typedef"
23e8e197 cmd/compile: use unsigned loads for multi-element comparisons
85bdd05c cmd/go: rebuild as needed for tests of packages that add methods
fd7331a8 text/template: revert CL 66410 "add break, continue actions in ranges"
f54f780d cmd/vet: unexported interface{} fields on %s are ok
a0222ec5 cmd/internal/obj/arm64: fix assemble add/adds/sub/subs/cmp/cmn(extended register) bug
59523176 cmd/go: only run -race test if -race works
4558321e doc/editors: remove feature matrix for various editors/IDEs
e6756ec1 cmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode
10d096fe cmd/go: fix import config debugging flag
f598ad58 go/internal/gccgoimporter: remove old and exp gccgo packages in test
2a8229d9 misc/cgo/test: get uintptr, not pointer, from dlopen
851e98f0 spec: remove need for separate Function production (cleanup)
cbe1a61e net: fix the kernel state name for TCP listen queue on FreeBSD
6f37fee3 cmd/go: fix TestNoCache on Plan 9
e5186895 runtime: restore RSB for sigpanic call on mips64x
3ff41cdf runtime: suppress "unexpected return pc" any time we're in cgo
d929e40e syscall: use SYS_GETDENTS64 on linux/mips64{,le}
43288467 test: add test for gccgo bug 23545
19150303 cmd/go: if unable to initialize cache, just disable it
ebe38b86 runtime: fail silently if we unwind over sigpanic into C code
5c2be42a runtime: don't unwind past asmcgocall
03e10bd9 os/signal: skip TestTerminalSignal if posix_openpt fails with EACCES
d30591c1 cmd/vendor/github.com/google/pprof: cherry-pick fix to cope with $HOME not being writable
bcc86d5f doc: add GOMIPS to source installation docs
926f2787 cmd/fix: cleanup directories created during typecheck
32a08d09 bootstrap.bash: only fetch git revision if we need it
14f8027a cmd/vet: extra args if any formats are indexed are ok
4072608b cmd/vet: %s is valid for an array of stringer
1f85917f cmd/vet: **T is not Stringer if *T has a String method
8c1f21d9 cmd/vet: disable complaint about 0 flag in print
d529aa93 doc: fix the closing tag in contribute.html
f8610bbd doc: fix two small mistakes in 1.10 release notes
5af1e7d7 cmd/go: skip external tests on plan9/arm
00587e89 doc: fix spelling mistake
3ee8c3cc os: document inheritance of thread state over exec
b5b35be2 cmd/compile: don't inline functions that call recover
651ddbdb database/sql: buffers provided to Rows.Next should not be modified by drivers
7350297e doc: remove Sarah Adams from conduct working group contacts

Change-Id: I3c04d83706cd4322252ddf732688afe5d938c1f5

6 years agocmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
Michael Hudson-Doyle [Wed, 7 Feb 2018 02:46:26 +0000 (15:46 +1300)]
cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM

The linker contains complicated logic for figuring out which float ABI to
indicate it is using on (32 bit) ARM systems: it parses a special section in
host object files to look for a flag indicating use of the hard float ABI. When
loadelf got split into its own package a bug was introduced: if the last host
object file does not contain a float ABI related tag, the ELF header's flag was
set to 0, rather than using the value from the last object file which contained
an ABI tag. Fix the code to only change the value used for the ELF header if a
tag was found.

This fixes an extremely confusing build failure on Ubuntu's armhf builders.

Change-Id: I0845d68d082d1383e4cae84ea85164cdc6bcdddb
Reviewed-on: https://go-review.googlesource.com/92515
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/cgo: revert CL 49490 "fix for function taking pointer typedef"
Ian Lance Taylor [Tue, 6 Feb 2018 23:11:59 +0000 (15:11 -0800)]
cmd/cgo: revert CL 49490 "fix for function taking pointer typedef"

CL 49490 fixed a warning when compiling the C code generated by cgo,
but it introduced typedef conflicts in Go code that cgo is supposed to
avoid.

Original CL description:

    cmd/cgo: fix for function taking pointer typedef

    Fixes #19832

Updates #19832
Fixes #23720

Change-Id: I22a732db31be0b4f7248c105277ab8ee44ef6cfb
Reviewed-on: https://go-review.googlesource.com/92455
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agocmd/compile: use unsigned loads for multi-element comparisons
Keith Randall [Tue, 6 Feb 2018 17:44:34 +0000 (09:44 -0800)]
cmd/compile: use unsigned loads for multi-element comparisons

When loading multiple elements of an array into a single register,
make sure we treat them as unsigned.  When treated as signed, the
upper bits might all be set, causing the shift-or combo to clobber
the values higher in the register.

Fixes #23719.

Change-Id: Ic87da03e9bd0fe2c60bb214b99f846e4e9446052
Reviewed-on: https://go-review.googlesource.com/92335
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
6 years agocmd/go: rebuild as needed for tests of packages that add methods
Russ Cox [Tue, 6 Feb 2018 04:57:41 +0000 (23:57 -0500)]
cmd/go: rebuild as needed for tests of packages that add methods

If A's external test package imports B, which imports A,
and A's (internal) test code also adds something to A that
invalidates anything in the export data from a build of A
without its test code, then strictly speaking we need to
rebuild B against the test-augmented version of A before
using it to build A's external test package.

We've been skating by without doing this for a very long time,
but I knew we'd need to handle it better eventually,
I planned for it in the new build cache simplifications,
and the code was ready. Now that we have a real-world
test case that needs it, turn on the "proper rebuilding" code.

It doesn't really matter how much things slow down, since
a real-world test cases that caused an internal compiler error
before is now handled correctly, but it appears to be small:
I wasn't able to measure an effect on "go test -a -c fmt".
And of course most builds won't use -a and will be cached well.

Fixes #6204.
Fixes #23701.

Change-Id: I2cd60cf400d1928428979ab05831f48ff7cee6ca
Reviewed-on: https://go-review.googlesource.com/92215
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agotext/template: revert CL 66410 "add break, continue actions in ranges"
Ian Lance Taylor [Mon, 5 Feb 2018 23:50:29 +0000 (15:50 -0800)]
text/template: revert CL 66410 "add break, continue actions in ranges"

The new break and continue actions do not work in html/template, and
fixing them requires thinking about security issues that seem too
tricky at this stage of the release. We will try again for 1.11.

Original CL description:

    text/template: add break, continue actions in ranges

    Adds the two range control actions "break" and "continue". They act the
    same as the Go keywords break and continue, but are simplified in that
    only the innermost range statement can be broken out of or continued.

    Fixes #20531

Updates #20531
Updates #23683

Change-Id: Ia7fd3c409163e3bcb5dc42947ae90b15bdf89853
Reviewed-on: https://go-review.googlesource.com/92155
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/vet: unexported interface{} fields on %s are ok
Daniel Martí [Mon, 29 Jan 2018 11:14:31 +0000 (11:14 +0000)]
cmd/vet: unexported interface{} fields on %s are ok

For example, the following program is valid:

type T struct {
f interface{}
}

func main() {
fmt.Printf("%s", T{"foo"}) // prints {foo}
}

Since the field is of type interface{}, we might have any value in it.
For example, if we had T{3}, fmt would complain. However, not knowing
what the type under the interface is, we must be conservative.

However, as shown in #17798, we should issue an error if the field's
type is statically known to implement the error or fmt.Stringer
interfaces. In those cases, the user likely wanted the %s format to call
those methods. Keep the vet error in those cases.

While at it, add more field type test cases, such as custom error types,
and interfaces that extend the error interface.

Fixes #23563.

Change-Id: I063885955555917c59da000391b603f0d6dce432
Reviewed-on: https://go-review.googlesource.com/90516
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/internal/obj/arm64: fix assemble add/adds/sub/subs/cmp/cmn(extended register...
fanzha02 [Wed, 17 Jan 2018 10:25:26 +0000 (10:25 +0000)]
cmd/internal/obj/arm64: fix assemble add/adds/sub/subs/cmp/cmn(extended register) bug

The current code encodes the wrong option value in the binary.

The fix reconstructs the function opxrrr() that does not encode the option
value into the binary value when arguments is sign or zero-extended register.

Add the relevant test cases and negative tests.

Fixes #23501
Change-Id: Ie5850ead2ad08d9a235a5664869aac5051762f1f
Reviewed-on: https://go-review.googlesource.com/88876
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agocmd/go: only run -race test if -race works
Ian Lance Taylor [Mon, 5 Feb 2018 20:19:08 +0000 (12:19 -0800)]
cmd/go: only run -race test if -race works

Updates #23694

Change-Id: I5fdad8cceacb8bbc85ca2661eb6482aa80343656
Reviewed-on: https://go-review.googlesource.com/92075
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/editors: remove feature matrix for various editors/IDEs
Andrew Bonventre [Mon, 5 Feb 2018 17:10:22 +0000 (12:10 -0500)]
doc/editors: remove feature matrix for various editors/IDEs

The speed of feature development for these products outpaces the
standard Go 6-month release cycle tied to this page. The cost of
maintaining this list is becoming a burden as we make every
attempt at being impartial. As of this writing, we believe feature
lists belong on the pages of the editors/IDEs themselves.

Change-Id: Ie2dfe0e0d47d203c913373e58cbb65cb0fb14d0c
Reviewed-on: https://go-review.googlesource.com/91976
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode
Ian Lance Taylor [Mon, 5 Feb 2018 02:45:39 +0000 (18:45 -0800)]
cmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode

Otherwise we get into a dependency loop as we try to apply coverage
analysis to sync/atomic when the coverage analysis itself requires
sync/atomic.

Fixes #23694

Change-Id: I3a74ef3881ec5c6197ed348acc7f9e175417f6c7
Reviewed-on: https://go-review.googlesource.com/91875
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/go: fix import config debugging flag
Russ Cox [Wed, 31 Jan 2018 02:16:09 +0000 (21:16 -0500)]
cmd/go: fix import config debugging flag

Was improperly bypassed in a couple places.

Change-Id: I13426b3efe68b9e67324c283540d0ef7b81b3d41
Reviewed-on: https://go-review.googlesource.com/91636
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agogo/internal/gccgoimporter: remove old and exp gccgo packages in test
Ian Lance Taylor [Fri, 2 Feb 2018 19:11:32 +0000 (11:11 -0800)]
go/internal/gccgoimporter: remove old and exp gccgo packages in test

The old and exp packages listed in gccgoinstallation_test.go have been
removed from gccgo. Remove them from the test.

Fixes #20932

Change-Id: I04a5148e18dccef332904b836c42098b55f2516c
Reviewed-on: https://go-review.googlesource.com/91656
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomisc/cgo/test: get uintptr, not pointer, from dlopen
Ian Lance Taylor [Fri, 2 Feb 2018 13:38:08 +0000 (05:38 -0800)]
misc/cgo/test: get uintptr, not pointer, from dlopen

The dlopen function returns an opaque handle, and it is possible for
it to look like a Go pointer, causing garbage collector and cgo
confusion.

Fixes #23663

Change-Id: Id080e2bbcee8cfa7ac4a457a927f96949eb913f8
Reviewed-on: https://go-review.googlesource.com/91596
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agospec: remove need for separate Function production (cleanup)
Robert Griesemer [Thu, 1 Feb 2018 22:08:45 +0000 (14:08 -0800)]
spec: remove need for separate Function production (cleanup)

The EBNF production

Function = Signature FunctionBody .

was used in FunctionDecl, MethodDecl, and FunctionLit, but only
for the latter it shortened the syntax slightly.

This change "inlines" Function which simplifies FunctionDecl and
MethodDecl and gets rid of the Function production.

This has no impact on the specified language. Also, the Function
production is never referred to by the prose, so it's safe to
remove it from the spec.

Finally, neither go/ast nor go/parser have a representation of
this production via a corresponding node or parse function, so
no possibly valuable documentation is lost, either.

Change-Id: Ia2875d31c6ec2d2079081ef481e50bad4f43c694
Reviewed-on: https://go-review.googlesource.com/91515
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agonet: fix the kernel state name for TCP listen queue on FreeBSD
Mikio Hara [Thu, 1 Feb 2018 19:25:44 +0000 (04:25 +0900)]
net: fix the kernel state name for TCP listen queue on FreeBSD

Fixes #23653.

Change-Id: Ic1e3c8f156ae576cfb5da1b4d082d4b12fae114f
Reviewed-on: https://go-review.googlesource.com/91317
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: fix TestNoCache on Plan 9
David du Colombier [Wed, 31 Jan 2018 21:56:39 +0000 (22:56 +0100)]
cmd/go: fix TestNoCache on Plan 9

CL 91097 added TestNoCache. However, this
test is failing on Plan 9 because the HOME
environment variable doesn't contain the
home directory where the Go cache is located.

This change fixes the TestNoCache test
by using the home environment variable
instead of HOME on Plan 9.

Fixes #23644.

Change-Id: Icfb7a7a4c2852f159c93032b4081411628a2787f
Reviewed-on: https://go-review.googlesource.com/91216
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: restore RSB for sigpanic call on mips64x
Austin Clements [Wed, 31 Jan 2018 19:34:36 +0000 (14:34 -0500)]
runtime: restore RSB for sigpanic call on mips64x

preparePanic must set all registers expected by Go runtime conventions
in case the sigpanic is being injected into C code. However, on
mips64x it fails to restore RSB (R28). As a result, if C code modifies
RSB and then raises a signal that turns into a sigpanic call, sigpanic
may crash when it attempts to lock runtime.debuglock (the first global
it references).

Fix this by restoring RSB in the signal context using the same
convention as main and sigtramp.

Fixes #23641.

Change-Id: Ib47e83df89e2a3eece10f480e4e91ce9e4424388
Reviewed-on: https://go-review.googlesource.com/91156
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: suppress "unexpected return pc" any time we're in cgo
Austin Clements [Wed, 31 Jan 2018 16:55:22 +0000 (11:55 -0500)]
runtime: suppress "unexpected return pc" any time we're in cgo

Currently, gentraceback suppresses the "unexpected return pc" error
for sigpanic's caller if the M was running C code.

However, there are various situations where a sigpanic is injected
into C code that can cause traceback to unwind *past* the sigpanic
before realizing that it's in trouble (the traceback beyond the
sigpanic will be wrong).

Rather than try to fix these issues for Go 1.10, this CL simply
disables complaining about unexpected return PCs if we're in cgo
regardless of whether or not they're from the sigpanic frame. Go 1.9
never complained about unexpected return PCs when printing, so this is
simply a step closer to the old behavior.

This should fix the openbsd-386 failures on the dashboard, though this
issue could affect any architecture.

Fixes #23640.

Change-Id: I8c32c1ee86a70d2f280661ed1f8caf82549e324b
Reviewed-on: https://go-review.googlesource.com/91136
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agosyscall: use SYS_GETDENTS64 on linux/mips64{,le}
Tobias Klauser [Wed, 31 Jan 2018 12:59:00 +0000 (13:59 +0100)]
syscall: use SYS_GETDENTS64 on linux/mips64{,le}

The getdents64 syscall is only available for mips64/mips64le starting
with Linux kernel 3.10. Since mips64le requires at least 4.8 according
to [1] (regarding #16848) using it should be fine.

[1] https://golang.org/wiki/MinimumRequirements

This CL changes the binary layout of type Dirent for mips64/mips64le,
but not the public API. But since the currently used layout doesn't
match the struct linux_dirent returned by the getdents syscall this
should be fine as well.

Fixes #23624

Change-Id: Iaa7306fa6e4442ad2fed41c60b37627a7314f117
Reviewed-on: https://go-review.googlesource.com/91055
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agotest: add test for gccgo bug 23545
Cherry Zhang [Thu, 25 Jan 2018 04:44:17 +0000 (23:44 -0500)]
test: add test for gccgo bug 23545

The fix is CL 91035.

Build only with gccgo at the moment, as it hits issue #23546.

Updates #23545.

Change-Id: I3a1367bb31b04773d31f71016f8fd7bd1855d7b5
Reviewed-on: https://go-review.googlesource.com/89735
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: if unable to initialize cache, just disable it
Ian Lance Taylor [Wed, 31 Jan 2018 18:02:01 +0000 (10:02 -0800)]
cmd/go: if unable to initialize cache, just disable it

Fixes #23638

Change-Id: I51967290448217f371fc7aba9259918ee9857143
Reviewed-on: https://go-review.googlesource.com/91097
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agoruntime: fail silently if we unwind over sigpanic into C code
Austin Clements [Tue, 30 Jan 2018 21:03:51 +0000 (16:03 -0500)]
runtime: fail silently if we unwind over sigpanic into C code

If we're running C code and the code panics, the runtime will inject a
call to sigpanic into the C code just like it would into Go code.
However, the return PC from this sigpanic will be in C code. We used
to silently abort the traceback if we didn't recognize a return PC, so
this went by quietly. Now we're much louder because in general this is
a bad thing. However, in this one particular case, it's fine, so if
we're in cgo and are looking at the return PC of sigpanic, silence the
debug output.

Fixes #23576.

Change-Id: I03d0c14d4e4d25b29b1f5804f5e9ccc4f742f876
Reviewed-on: https://go-review.googlesource.com/90896
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: don't unwind past asmcgocall
Austin Clements [Tue, 30 Jan 2018 21:01:33 +0000 (16:01 -0500)]
runtime: don't unwind past asmcgocall

asmcgocall switches to the system stack and aligns the SP, so
gentraceback both can't unwind over it when it appears on the system
stack (it'll read some uninitialized stack slot as the return PC).
There's also no point in unwinding over it, so don't.

Updates #23576.

Change-Id: Idfcc9599c7636b80dec5451cb65ae892b4611981
Reviewed-on: https://go-review.googlesource.com/90895
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos/signal: skip TestTerminalSignal if posix_openpt fails with EACCES
Michael Hudson-Doyle [Tue, 30 Jan 2018 21:27:49 +0000 (10:27 +1300)]
os/signal: skip TestTerminalSignal if posix_openpt fails with EACCES

This happens in a chroot and so causes failures when packaging Go 1.10 for
Debian/Ubuntu.

Change-Id: I817038c237e584ce185b2168f8c7a10b9ef27b43
Reviewed-on: https://go-review.googlesource.com/90875
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/vendor/github.com/google/pprof: cherry-pick fix to cope with $HOME not being...
Michael Hudson-Doyle [Tue, 30 Jan 2018 22:11:39 +0000 (11:11 +1300)]
cmd/vendor/github.com/google/pprof: cherry-pick fix to cope with $HOME not being writable

Upstream PRs: https://github.com/google/pprof/pull/305,
https://github.com/google/pprof/pull/306.

Change-Id: I28969118f52ee08fcaf3572ad5da015ae756fd7a
Reviewed-on: https://go-review.googlesource.com/90935
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: add GOMIPS to source installation docs
Brad Fitzpatrick [Tue, 30 Jan 2018 16:55:27 +0000 (16:55 +0000)]
doc: add GOMIPS to source installation docs

Also close </li> tags.

Fixes #23614

Change-Id: Icabcd577ef7df43e54d2b0068ee54614ba65bea1
Reviewed-on: https://go-review.googlesource.com/90815
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agocmd/fix: cleanup directories created during typecheck
Mohit Agarwal [Tue, 30 Jan 2018 12:58:50 +0000 (18:28 +0530)]
cmd/fix: cleanup directories created during typecheck

Executing

$ go tool dist test -run=^go_test:cmd/fix$

leaves a number of directories (fix_cgo_typecheck*) in TMPDIR.

Change-Id: Ia5bdc2f7d884333771d50365063faf514ebf6eae
Reviewed-on: https://go-review.googlesource.com/90795
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agobootstrap.bash: only fetch git revision if we need it
Ian Lance Taylor [Tue, 30 Jan 2018 04:35:43 +0000 (20:35 -0800)]
bootstrap.bash: only fetch git revision if we need it

Updates #22912
Fixes #23610

Change-Id: Id1c91fc3f040412d5931dba40e430685793f8eea
Reviewed-on: https://go-review.googlesource.com/90715
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/vet: extra args if any formats are indexed are ok
Daniel Martí [Mon, 29 Jan 2018 10:35:39 +0000 (10:35 +0000)]
cmd/vet: extra args if any formats are indexed are ok

For example, the following program is valid:

func main() {
fmt.Printf("%[1]d", 1, 2, 3)
}

If any of the formats are indexed, fmt will not complain about unused
extra arguments. See #22867 for more detail.

Make vet follow the same logic, to avoid erroring on programs that would
run without fmt complaining.

Fixes #23564.

Change-Id: Ic9dede5d4c37d1cd4fa24714216944897b5bb7cc
Reviewed-on: https://go-review.googlesource.com/90495
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agocmd/vet: %s is valid for an array of stringer
Daniel Martí [Mon, 29 Jan 2018 09:24:51 +0000 (09:24 +0000)]
cmd/vet: %s is valid for an array of stringer

vet was quiet for []stringer, but not for [N]stringer. The source of the
problem was how the recursive call used .Elem().Underlying() for arrays,
but .Elem() for slices. In the first case, the named type is dropped,
thus losing all information of attached methods.

Be consistent across slices and arrays, by dropping the Underlying call
that is causing trouble. Add regression tests too, including cases where
the element type does not implement fmt.Stringer.

Fixes #23552.

Change-Id: I0fde07d101f112d5768be0a79207ef0b3dc45f2e
Reviewed-on: https://go-review.googlesource.com/90455
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agocmd/vet: **T is not Stringer if *T has a String method
Daniel Martí [Mon, 29 Jan 2018 09:50:50 +0000 (09:50 +0000)]
cmd/vet: **T is not Stringer if *T has a String method

vet recorded what types had String methods defined on them, but it did
not record whether the receivers were pointer types. That information is
important, as the following program is valid:

type T string

func (t *T) String() string {
return fmt.Sprint(&t) // prints address
}

Teach vet that, if *T is Stringer, **T is not.

Fixes #23550.

Change-Id: I1062e60e6d82e789af9cca396546db6bfc3541e8
Reviewed-on: https://go-review.googlesource.com/90417
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agocmd/vet: disable complaint about 0 flag in print
Rob Pike [Tue, 30 Jan 2018 02:49:48 +0000 (13:49 +1100)]
cmd/vet: disable complaint about 0 flag in print

The problem is that vet complains about 0 as a Printf flag in some
situations where fmt allows it but probably shouldn't. The two
need to be brought in line, but it's too late in the release cycle.

The situation is messy and should be resolved properly in 1.11. This
CL is a simple fix to disable a spurious complaint for 1.10 that will be
resolved in a more thorough way in 1.11.

The workaround is just to be silent about flag 0, as suggested in
issue 23605.

Fixes #23605
Update #23498

Change-Id: Ice1a4f4d86845d70c1340a0a6430d74e5de9afd4
Reviewed-on: https://go-review.googlesource.com/90695
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: fix the closing tag in contribute.html
Mohit Agarwal [Mon, 29 Jan 2018 18:44:54 +0000 (00:14 +0530)]
doc: fix the closing tag in contribute.html

Change-Id: I802bc11d90d414e7313dd11842a04fd6b591ea06
Reviewed-on: https://go-review.googlesource.com/90595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: fix two small mistakes in 1.10 release notes
Alberto Donizetti [Mon, 29 Jan 2018 10:59:53 +0000 (11:59 +0100)]
doc: fix two small mistakes in 1.10 release notes

Change-Id: If928b14f6cd89b1d78745e8bc7a081ccbd7fd38f
Reviewed-on: https://go-review.googlesource.com/90515
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: skip external tests on plan9/arm
David du Colombier [Sun, 28 Jan 2018 18:58:25 +0000 (19:58 +0100)]
cmd/go: skip external tests on plan9/arm

CL 13166, CL 13342 and CL 33425 skipped external tests
on freebsd/arm, linux/arm and linux/mips.

This CL does the same for plan9/arm to reduce test time
on plan9/arm and prevent the Go builder to time out.

Change-Id: I16fcc5d8010a354f480673b8c4a8a11dbc833557
Reviewed-on: https://go-review.googlesource.com/90416
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: fix spelling mistake
Kevin Burke [Thu, 25 Jan 2018 19:26:54 +0000 (11:26 -0800)]
doc: fix spelling mistake

Change-Id: I7bf1a93d3377acccdd3a34c5dcef7863310496e0
Reviewed-on: https://go-review.googlesource.com/89955
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: document inheritance of thread state over exec
Austin Clements [Fri, 26 Jan 2018 18:44:28 +0000 (13:44 -0500)]
os: document inheritance of thread state over exec

Fixes #23570.

Change-Id: I462ada2960d710c2c94dc22a59d292703d83f612
Reviewed-on: https://go-review.googlesource.com/90255
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/compile: don't inline functions that call recover
Austin Clements [Thu, 25 Jan 2018 22:22:41 +0000 (17:22 -0500)]
cmd/compile: don't inline functions that call recover

recover determines whether it's being called by a deferred frame by
matching its caller's argument frame pointer with the one recorded in
the panic object. That means its caller needs a valid and unique
argument frame pointer, so it must not be inlined.

With this fix, test/recover.go passes with -l=4.

Fixes #23557.

Change-Id: I1f32a624c49e387cfc67893a0829bb248d69c3d4
Reviewed-on: https://go-review.googlesource.com/90035
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agodatabase/sql: buffers provided to Rows.Next should not be modified by drivers
Daniel Theophanes [Thu, 25 Jan 2018 18:50:02 +0000 (10:50 -0800)]
database/sql: buffers provided to Rows.Next should not be modified by drivers

Previously we allowed drivers to modify the row buffer used to scan
values when closing Rows. This is no longer acceptable and can lead
to data races.

Fixes #23519

Change-Id: I91820a6266ffe52f95f40bb47307d375727715af
Reviewed-on: https://go-review.googlesource.com/89936
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agodoc: remove Sarah Adams from conduct working group contacts
Sarah Adams [Wed, 24 Jan 2018 23:07:15 +0000 (15:07 -0800)]
doc: remove Sarah Adams from conduct working group contacts

Change-Id: Id2332332ba5ff5a3ae6e58882743aa25359c02f6
Reviewed-on: https://go-review.googlesource.com/89675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.10] go1.10rc1 go1.10rc1
Andrew Bonventre [Thu, 25 Jan 2018 16:22:38 +0000 (11:22 -0500)]
[release-branch.go1.10] go1.10rc1

Change-Id: I49ec1e476e02d403a4b46f55ea48a9c3cee54efa
Reviewed-on: https://go-review.googlesource.com/89855
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agodatabase/sql: fix TestConversions when count > 1
Daniel Theophanes [Wed, 24 Jan 2018 20:27:59 +0000 (12:27 -0800)]
database/sql: fix TestConversions when count > 1

Provide a fresh conversion table for TestConversions as it gets
modified on each test.

Change-Id: I6e2240d0c3455451271a6879e994b82222c3d44c
Reviewed-on: https://go-review.googlesource.com/89595
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>