]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
5 years ago[release-branch.go1.12] go1.12.4 go1.12.4
Andrew Bonventre [Thu, 11 Apr 2019 22:32:51 +0000 (18:32 -0400)]
[release-branch.go1.12] go1.12.4

Change-Id: I4d1b5e00ab4480b4c5adeeb4f53ddfdfa3903b71
Reviewed-on: https://go-review.googlesource.com/c/go/+/171838
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.12.4 and Go 1.11.9
Brad Fitzpatrick [Thu, 11 Apr 2019 04:57:14 +0000 (04:57 +0000)]
[release-branch.go1.12] doc: document Go 1.12.4 and Go 1.11.9

Updates #31293

Change-Id: I3d72f732be7b28059310ea6fc134c3bfac81492d
Reviewed-on: https://go-review.googlesource.com/c/go/+/171578
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
(cherry picked from commit ab2a0803383f0f019db0b2252095f2fdb7735cea)
Reviewed-on: https://go-review.googlesource.com/c/go/+/171766
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years ago[release-branch.go1.12] go1.12.3 go1.12.3
Andrew Bonventre [Mon, 8 Apr 2019 20:32:30 +0000 (16:32 -0400)]
[release-branch.go1.12] go1.12.3

Change-Id: Iab946b7c903e3c30addc388900421a7ceb803f1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/171149
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: correct link in 1.11.8 notes
Andrew Bonventre [Mon, 8 Apr 2019 20:07:49 +0000 (16:07 -0400)]
[release-branch.go1.12] doc: correct link in 1.11.8 notes

Change-Id: I09e0c2720ec0a51dc73c24b4550a749448656025
Reviewed-on: https://go-review.googlesource.com/c/go/+/171143
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 6f512c8d6696b288372c48c19058bbe9dcb79da0)
Reviewed-on: https://go-review.googlesource.com/c/go/+/171157
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: correct link in 1.12.3 notes
Andrew Bonventre [Mon, 8 Apr 2019 20:09:15 +0000 (16:09 -0400)]
[release-branch.go1.12] doc: correct link in 1.12.3 notes

Change-Id: I6dd60ea7b8a8756be97503e163c2386af16e4e12
Reviewed-on: https://go-review.googlesource.com/c/go/+/171144
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 973c0312e36fd56b6b2111a07a19de63e0dcbf03)
Reviewed-on: https://go-review.googlesource.com/c/go/+/171147
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.11.8
Andrew Bonventre [Mon, 8 Apr 2019 19:42:30 +0000 (15:42 -0400)]
[release-branch.go1.12] doc: document Go 1.11.8

Change-Id: Ia06f7005f466e55a22c76bf2b47d74ee8eb77dd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/171139
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 739a78f2b8de3139ec253719d0a688c08b8e5324)
Reviewed-on: https://go-review.googlesource.com/c/go/+/171145
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.12.3
Andrew Bonventre [Mon, 8 Apr 2019 19:43:32 +0000 (15:43 -0400)]
[release-branch.go1.12] doc: document Go 1.12.3

Change-Id: I84c9a8ddbd3101dd478e4a8a4e191863e68c6af6
Reviewed-on: https://go-review.googlesource.com/c/go/+/171140
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 8759b4d3843494b60dd9d58458b4f2774baf5fcb)
Reviewed-on: https://go-review.googlesource.com/c/go/+/171141

5 years ago[release-branch.go1.12] go1.12.2 go1.12.2
Andrew Bonventre [Fri, 5 Apr 2019 18:41:53 +0000 (14:41 -0400)]
[release-branch.go1.12] go1.12.2

Change-Id: I07e4404196886b7754414726f25092cca39861a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/170888
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] cmd/go: avoid link error when -coverpkg covers main packages...
Jay Conrod [Mon, 18 Mar 2019 22:35:44 +0000 (18:35 -0400)]
[release-branch.go1.12] cmd/go: avoid link error when -coverpkg covers main packages (more)

This fixes two problems missed in CL 164877.

First, p.Internal.BuildInfo is now part of the cache key. This is
important since p.Internal.BuildInfo causes the build action to
synthesize a new source file, which affects the output.

Second, recompileForTest is always called for test
packages. Previously, it was only called when there were internal test
sources, so the fix in CL 164877 did not apply to packages that only
had external tests.

Fixes #30937

Change-Id: Iac2d7e8914f0313f9ab4222299a866f67889eb2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/168200
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit d34548e0b6acc14a99bc6ffc225eedbb56e03d60)
Reviewed-on: https://go-review.googlesource.com/c/go/+/168717
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] runtime: fix write barrier on wasm
Austin Clements [Fri, 15 Mar 2019 17:29:40 +0000 (13:29 -0400)]
[release-branch.go1.12] runtime: fix write barrier on wasm

The current wasm write barrier implementation incorrectly implements
the "deletion" part of the barrier. It correctly greys the new value
of the pointer, but rather than also greying the old value of the
pointer, it greys the object containing the slot (which, since the old
value was just overwritten, is not going to contain the old value).

This can lead to unmarked, reachable objects.

Often, this is masked by other marking activity, but one specific
sequence that can lead to an unmarked object because of this bug is:

1. Initially, GC is off, object A is reachable from just one pointer
in the heap.

2. GC starts and scans the stack of goroutine G.

3. G copies the pointer to A on to its stack and overwrites the
pointer to A in the heap. (Now A is reachable only from G's stack.)

4. GC finishes while A is still reachable from G's stack.

With a functioning deletion barrier, step 3 causes A to be greyed.
Without a functioning deletion barrier, nothing causes A to be greyed,
so A will be freed even though it's still reachable from G's stack.

This CL fixes the wasm write barrier.

Fixes #30873.

Change-Id: I8a74ee517facd3aa9ad606e5424bcf8f0d78e754
Reviewed-on: https://go-review.googlesource.com/c/go/+/167743
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit d9db9e32e924a60bbfbb15cc0dd7cfaaf8a62a3b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167745
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] doc: document Go 1.12.2
Andrew Bonventre [Fri, 5 Apr 2019 18:29:16 +0000 (14:29 -0400)]
[release-branch.go1.12] doc: document Go 1.12.2

Change-Id: I990c451ff24844b39dee2477cec4caa9db2e8ebb
Reviewed-on: https://go-review.googlesource.com/c/go/+/170883
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 5ec938cdcf7ab59f6d397cb3fa4d17459057ef61)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170885
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.11.7
Andrew Bonventre [Fri, 5 Apr 2019 18:31:54 +0000 (14:31 -0400)]
[release-branch.go1.12] doc: document Go 1.11.7

Change-Id: Iec5e69b3ea163f42234d3b73696427a7aa8732e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/170884
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit e47ced78578c471cbcd34a7d6b223a71e84a46c8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170886
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agoRevert "[release-branch.go1.12] syscall: avoid _getdirentries64 on darwin"
Keith Randall [Fri, 5 Apr 2019 17:58:07 +0000 (17:58 +0000)]
Revert "[release-branch.go1.12] syscall: avoid _getdirentries64 on darwin"

This reverts commit 731ebf4d87dbe349e2eb60233c3965ee62a32690.

Reason for revert: It's not working for large directories.

Change-Id: Ie0f88e0ed1d36c4ea4f32d2acd4e223bd8229ca0
Reviewed-on: https://go-review.googlesource.com/c/go/+/170882
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>

5 years ago[release-branch.go1.12] syscall: avoid _getdirentries64 on darwin
Keith Randall [Wed, 20 Mar 2019 17:47:17 +0000 (10:47 -0700)]
[release-branch.go1.12] syscall: avoid _getdirentries64 on darwin

Getdirentries is implemented with the __getdirentries64 function
in libSystem.dylib. That function works, but it's on Apple's
can't-be-used-in-an-app-store-application list.

Implement Getdirentries using the underlying fdopendir/readdir_r/closedir.
The simulation isn't faithful, and could be slow, but it should handle
common cases.

Don't use Getdirentries in the stdlib, use fdopendir/readdir_r/closedir
instead (via (*os.File).readdirnames).

(Incorporates CL 170837 and CL 170698, which were small fixes to the
original tip CL.)

Fixes #31244

Update #28984

RELNOTE=yes

Change-Id: Ia6b5d003e5bfe43ba54b1e1d9cfa792cc6511717
Reviewed-on: https://go-review.googlesource.com/c/go/+/168479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 9da6530faab0a58c4c4e02b2f3f4a5c754dcbd4e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170640
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

5 years ago[release-branch.go1.12] runtime: skip broken TestLldbPython
Brad Fitzpatrick [Mon, 1 Apr 2019 22:20:06 +0000 (22:20 +0000)]
[release-branch.go1.12] runtime: skip broken TestLldbPython

It's broken on our builders (once we enabled dev mode on our Macs,
see CL 170339)

Updates #31188

Change-Id: Iceea65dc79576057b401a461bfe39254fed1f7ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/170281
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 46c3e217188043c7cea9e181f0d61825d2636ad7)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170798
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years ago[release-branch.go1.12] internal/poll: fix deadlock in Write if len(buf) > maxRW
Ian Lance Taylor [Wed, 3 Apr 2019 22:30:13 +0000 (15:30 -0700)]
[release-branch.go1.12] internal/poll: fix deadlock in Write if len(buf) > maxRW

fd.l.Lock shouldn't be called in a loop.

Manual backport of CL 165598. It could not be cherry-picked due to conflicts.

Fixes #31211

Change-Id: Ib76e679f6a276b32fe9c1594b7e9a506017a7967
Reviewed-on: https://go-review.googlesource.com/c/go/+/170680
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] cmd/compile: fix literal struct interface {} lost passing...
LE Manh Cuong [Fri, 22 Mar 2019 18:43:06 +0000 (01:43 +0700)]
[release-branch.go1.12] cmd/compile: fix literal struct interface {} lost passing by value

CL 135377 introduces pass strings and slices to convT2{E,I} by value.
Before that CL, all types, except interface will be allocated temporary
address. The CL changes the logic that only constant and type which
needs address (determine by convFuncName) will be allocated.

It fails to cover the case where type is static composite literal.
Adding condition to check that case fixes the issue.

Also, static composite literal node implies constant type, so consttype
checking can be removed.

Fixes #31209

Change-Id: Ifc750a029fb4889c2d06e73e44bf85e6ef4ce881
Reviewed-on: https://go-review.googlesource.com/c/go/+/168858
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit d47db6dc0ce72d1371c81a677b45d7bdba39ff46)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170437
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[release-branch.go1.12] net: use network and host as singleflight key during lookupIP
Cezar Sa Espinola [Thu, 7 Mar 2019 15:52:16 +0000 (12:52 -0300)]
[release-branch.go1.12] net: use network and host as singleflight key during lookupIP

In CL 120215 the cgo resolver was changed to have different logic based
on the network being queried. However, the singleflight cache key wasn't
updated to also include the network. This way it was possible for
concurrent queries to return the result for the wrong network.

This CL changes the key to include both network and host, fixing the
problem.

Fixes #31062

Change-Id: I8b41b0ce1d9a02d18876c43e347654312eba22fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/166037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit e341bae08d75611adea6566c1d01c1e3a0de57f9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170320
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] cmd/compile: copy volatile values before emitting write barri...
Cherry Zhang [Thu, 21 Mar 2019 17:40:28 +0000 (13:40 -0400)]
[release-branch.go1.12] cmd/compile: copy volatile values before emitting write barrier call

It is possible that a "volatile" value (one that can be clobbered
by preparing args of a call) to be used in multiple write barrier
calls. We used to copy the volatile value right before each call.
But this doesn't work if the value is used the second time, after
the first call where it is already clobbered. Copy it before
emitting any call.

Updates #30977.
Fixes #30996.

Change-Id: Iedcc91ad848d5ded547bf37a8359c125d32e994c
Reviewed-on: https://go-review.googlesource.com/c/go/+/168677
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit f23c601bf9f66ef4a0d9d2dcd003b95e78fb28f8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/168817
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

5 years ago[release-branch.go1.12] net/http/httputil: make ReverseProxy flush headers on FlushIn...
Jordan Liggitt [Fri, 29 Mar 2019 03:37:54 +0000 (23:37 -0400)]
[release-branch.go1.12] net/http/httputil: make ReverseProxy flush headers on FlushInterval

A regression was introduced in CL 137335 (5440bfc) that caused FlushInterval
to not be honored until the first Write() call was encountered. This change
starts the flush timer as part of setting up the maxLatencyWriter.

Fixes #31144

Change-Id: I75325bd926652922219bd1457b2b00ac6d0d41b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/170066
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 2cc347382f4df3fb40d8d81ec9331f0748b1c394)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170137

5 years ago[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries
Dmitri Shuralyov [Thu, 21 Mar 2019 17:31:32 +0000 (13:31 -0400)]
[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries

This change is a re-apply of the reverted CL 140863 with changes to
address issue #30821. Specifically, path.Split continues to be used
to split the '/'-separated import path, rather than filepath.Split.

Document the algorithm for how the default executable name is determined
in DefaultExecName.

Rename a variable returned from os.Stat from bs to fi for consistency.

CL 140863 factored out the logic to determine the default executable
name from the Package.load method into a DefaultExecName function,
and started using it in more places to avoid having to re-implement
the logic everywhere it's needed. Most previous callers already computed
the default executable name based on the import path. The load.Package
method, before CL 140863, was the exception, in that it used the p.Dir
value in GOPATH mode instead. There was a NOTE(rsc) comment that it
should be equivalent to use import path, but it was too late in Go 1.11
cycle to risk implementing that change.

This is part 1, a more conservative change for backporting to Go 1.12.2,
and it keeps the original behavior of splitting on p.Dir in GOPATH mode.
Part 2 will address the NOTE(rsc) comment and modify behavior in
Package.load to always use DefaultExecName which splits the import path
rather than directory. It is intended to be included in Go 1.13.

Updates #27283
Updates #26869
Updates #30821
Fixes #30266

Change-Id: Ib1ebb95acba7c85c24e3a55c40cdf48405af34f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/167503
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
(cherry picked from commit 94563de87fad642677ffc62a4a82766597e39123)
Reviewed-on: https://go-review.googlesource.com/c/go/+/168958
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] net: fix test after 8.8.8.8 changed its reverse DNS name
Brad Fitzpatrick [Wed, 27 Mar 2019 17:41:12 +0000 (17:41 +0000)]
[release-branch.go1.12] net: fix test after 8.8.8.8 changed its reverse DNS name

Google's 8.8.8.8 DNS server used to reports its reverse DNS name
as ending in ".google.com". Now it's "dns.google.".

Change-Id: I7dd15f03239e5c3f202e471618ab867690cb4f9d
Reviewed-on: https://go-review.googlesource.com/c/go/+/169679
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
(cherry picked from commit 3089d189569ed272eaf2bc6c4330e848a46e9999)
Reviewed-on: https://go-review.googlesource.com/c/go/+/169717

5 years ago[release-branch.go1.12] cmd/compile: better handling for PAUTOHEAP in DWARF inline gen
Than McIntosh [Fri, 22 Mar 2019 12:14:45 +0000 (08:14 -0400)]
[release-branch.go1.12] cmd/compile: better handling for PAUTOHEAP in DWARF inline gen

When generating DWARF inline info records, the post-SSA code looks
through the original "pre-inline" dcl list for the function so as to
handle situations where formal params are promoted or optimized away.
This code was not properly handling the case where an output parameter
was promoted to the heap -- in this case the param node is converted
in place from class PPARAMOUT to class PAUTOHEAP. This caused
inconsistencies later on, since the variable entry in the abstract
subprogram DIE wound up as a local and not an output parameter.

Updates #30908.
Fixes #31028.

Change-Id: Ia70b89f0cf7f9b16246d95df17ad6e307228b8c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/168818
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 68a98d52794fc324841f62732411f6bba23fc62c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/169417
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] runtime: safely load DLLs
Jason A. Donenfeld [Wed, 6 Mar 2019 18:26:29 +0000 (19:26 +0100)]
[release-branch.go1.12] runtime: safely load DLLs

While many other call sites have been moved to using the proper
higher-level system loading, these areas were left out. This prevents
DLL directory injection attacks. This includes both the runtime load
calls (using LoadLibrary prior) and the implicitly linked ones via
cgo_import_dynamic, which we move to our LoadLibraryEx. The goal is to
only loosely load kernel32.dll and strictly load all others.

Meanwhile we make sure that we never fallback to insecure loading on
older or unpatched systems.

This is CVE-2019-9634.

Fixes #30666
Updates #14959
Updates #28978
Updates #30642

Change-Id: I401a13ed8db248ab1bb5039bf2d31915cac72b93
Reviewed-on: https://go-review.googlesource.com/c/go/+/165798
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
(cherry picked from commit 9b6e9f0c8c66355c0f0575d808b32f52c8c6d21c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/168339
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] os: consistently return PathError from RemoveAll
Baokun Lee [Fri, 1 Mar 2019 10:04:14 +0000 (18:04 +0800)]
[release-branch.go1.12] os: consistently return PathError from RemoveAll

Fixes #30859
Updates #30491

Change-Id: If4070e5d39d8649643d7e90f6f3eb499642e25ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/164720
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
(cherry picked from commit d039e12b54a73796caa913994597a9f3a73e8e87)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167739
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Baokun Lee <nototon@gmail.com>
5 years ago[release-branch.go1.12] doc: add minor revisions header for 1.12
Andrew Bonventre [Thu, 14 Mar 2019 20:44:38 +0000 (16:44 -0400)]
[release-branch.go1.12] doc: add minor revisions header for 1.12

Change-Id: I0d4a55af0bee754ab1ee817780027e9f72475afb
Reviewed-on: https://go-review.googlesource.com/c/go/+/167712
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] go1.12.1 go1.12.1
Andrew Bonventre [Thu, 14 Mar 2019 18:15:58 +0000 (14:15 -0400)]
[release-branch.go1.12] go1.12.1

Change-Id: Id5f76204b8cd3fe67c21c5adfd3a4e456a8cad14
Reviewed-on: https://go-review.googlesource.com/c/go/+/167704
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.12.1
Andrew Bonventre [Thu, 14 Mar 2019 18:03:30 +0000 (14:03 -0400)]
[release-branch.go1.12] doc: document Go 1.12.1

Change-Id: I6d3a615c5f72e9aa29d23e127af98d6e836da173
Reviewed-on: https://go-review.googlesource.com/c/go/+/167699
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit f832a97e454a5e2bed336321965fd2382b2af868)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167702
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc: document Go 1.11.6
Andrew Bonventre [Thu, 14 Mar 2019 17:58:47 +0000 (13:58 -0400)]
[release-branch.go1.12] doc: document Go 1.11.6

Change-Id: I99832fa4f2c3ec28e2dad46cf7607f3766948031
Reviewed-on: https://go-review.googlesource.com/c/go/+/167698
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit d3bb45d9046bb7d12c4fc9cdaf122f36d001fd31)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167701

5 years agoRevert "[release-branch.go1.12] cmd/go: fix the default build output name for version...
Bryan C. Mills [Thu, 14 Mar 2019 14:27:26 +0000 (14:27 +0000)]
Revert "[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries"

This reverts commit 746edd459d26f07f69fcb6bddfafaaae7c5a2911 (CL 167384).

Reason for revert: Dmitri identified a potential problem in https://go-review.googlesource.com/c/go/+/140863/11#message-db0ff6bb2c7b06161ca47de771c4465afa8b1102, and we'd like more time to investigate without holding up the 1.12 release branch.

Updates #27283
Updates #30266
Updates #30821

Change-Id: I49d7bbbe200e80b81899c3bcbf7844717af010aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/167617
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] cmd/cgo: use explicit type for arg with bad pointer typedef
Ian Lance Taylor [Thu, 7 Mar 2019 01:31:04 +0000 (17:31 -0800)]
[release-branch.go1.12] cmd/cgo: use explicit type for arg with bad pointer typedef

Fixes #30816
Updates #30646

Change-Id: I5b7e986b0588e87b9781cce01445e3c55c06b6fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/165897
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit a6436a5655f56bb904871fece7db43a3ad3bf415)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167497
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

5 years ago[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries
Hana Kim [Mon, 14 Jan 2019 16:13:34 +0000 (11:13 -0500)]
[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries

`go build` has chosen the last element of the package import path
as the default output name when -o option is given. That caused
the output of a package build when the module root is the major
version component such as 'v2'.

A similar issue involving `go install` was fixed in
https://golang.org/cl/128900. This CL refactors the logic added
with the change and makes it available as
internal/load.DefaultExecName.

This CL makes 'go test' to choose the right default test binary
name when the tested package is in the module root. (E.g.,
instead of v2.test, choose pkg.test for the test of 'path/pkg/v2')

Fixes #27283
Fixes #30266

Change-Id: I6905754f0906db46e3ce069552715f45356913ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/140863
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit bf94fc3ae387fc09929443393741919fac6727af)
Reviewed-on: https://go-review.googlesource.com/c/go/+/167384
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] text/template: error on method calls on nil interfaces
Daniel Martí [Sat, 9 Feb 2019 17:50:02 +0000 (17:50 +0000)]
[release-branch.go1.12] text/template: error on method calls on nil interfaces

Trying to call a method on a nil interface is a panic in Go. For
example:

var stringer fmt.Stringer
println(stringer.String()) // nil pointer dereference

In https://golang.org/cl/143097 we started recovering panics encountered
during function and method calls. However, we didn't handle this case,
as text/template panics before evalCall is ever run.

In particular, reflect's MethodByName will panic if the receiver is of
interface kind and nil:

panic: reflect: Method on nil interface value

Simply add a check for that edge case, and have Template.Execute return
a helpful error. Note that Execute shouldn't just error if the interface
contains a typed nil, since we're able to find a method to call in that
case.

Finally, add regression tests for both the nil and typed nil interface
cases.

Fixes #30464.

Change-Id: Iffb21b40e14ba5fea0fcdd179cd80d1f23cabbab
Reviewed-on: https://go-review.googlesource.com/c/161761
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
(cherry picked from commit 15b4c71a912846530315c3e854feaaa9d0d54220)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] cmd/compile: make KeepAlive work on stack object
Cherry Zhang [Thu, 28 Feb 2019 01:43:29 +0000 (20:43 -0500)]
[release-branch.go1.12] cmd/compile: make KeepAlive work on stack object

Currently, runtime.KeepAlive applied on a stack object doesn't
actually keeps the stack object alive, and the heap object
referenced from it could be collected. This is because the
address of the stack object is rematerializeable, and we just
ignored KeepAlive on rematerializeable values. This CL fixes it.

Updates #30476.
Fixes #30478.

Change-Id: Ic1f75ee54ed94ea79bd46a8ddcd9e81d01556d1d
Reviewed-on: https://go-review.googlesource.com/c/164537
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 40df9cc6062492cd323f2251dd1583d200d1207e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164627

5 years ago[release-branch.go1.12] cmd/cgo: simplify and fix handling of untyped constants
Rémy Oudompheng [Fri, 1 Mar 2019 22:12:19 +0000 (23:12 +0100)]
[release-branch.go1.12] cmd/cgo: simplify and fix handling of untyped constants

Instead of trying to guess type of constants in the AST,
which is hard, use the "var cgo%d Type = Constant"
so that typechecking is left to the Go compiler.

The previous code could still fail in some cases
for constants imported from other modules
or defined in other, non-cgo files.

Fixes #30527

Change-Id: I2120cd90e90a74b9d765eeec53f6a3d2cfc1b642
Reviewed-on: https://go-review.googlesource.com/c/go/+/164897
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 711ea1e716b0c620cd9bcdd405eccae230d6dcbb)
Reviewed-on: https://go-review.googlesource.com/c/go/+/165748
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] fmtsort: sort interfaces deterministically
lukechampine [Thu, 28 Feb 2019 19:03:18 +0000 (19:03 +0000)]
[release-branch.go1.12] fmtsort: sort interfaces deterministically

Previously, the result of sorting a map[interface{}] containing
multiple concrete types was non-deterministic. To ensure consistent
results, sort first by type name, then by concrete value.

Fixes #30484

Change-Id: I10fd4b6a74eefbc87136853af6b2e689bc76ae9d
GitHub-Last-Rev: 1b07f0c275716e1b2834f74f9c67f897bae82882
GitHub-Pull-Request: golang/go#30406
Reviewed-on: https://go-review.googlesource.com/c/163745
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 9d40fadb1c3245a318b155ee3e19a4de139401dc)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164617
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] cmd/compile: fix ordering for short-circuiting ops
Keith Randall [Wed, 6 Mar 2019 01:42:48 +0000 (17:42 -0800)]
[release-branch.go1.12] cmd/compile: fix ordering for short-circuiting ops

Make sure the side effects inside short-circuited operations (&& and ||)
happen correctly.

Before this CL, we attached the side effects to the node itself using
exprInPlace. That caused other side effects in sibling expressions
to get reordered with respect to the short circuit side effect.

Instead, rewrite a && b like:

r := a
if r {
  r = b
}

That code we can keep correctly ordered with respect to other
side-effects extracted from part of a big expression.

exprInPlace seems generally unsafe. But this was the only case where
exprInPlace is called not at the top level of an expression, so I
don't think the other uses can actually trigger an issue (there can't
be a sibling expression). TODO: maybe those cases don't need "in
place", and we can retire that function generally.

This CL needed a small tweak to the SSA generation of OIF so that the
short circuit optimization still triggers. The short circuit optimization
looks for triangle but not diamonds, so don't bother allocating a block
if it will be empty.

Go 1 benchmarks are in the noise.

Fixes #30567

Change-Id: I19c04296bea63cbd6ad05f87a63b005029123610
Reviewed-on: https://go-review.googlesource.com/c/go/+/165617
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 4a9064ef41ccc65454564536f40cf7d5a00db8ad)
Reviewed-on: https://go-review.googlesource.com/c/go/+/165858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] cmd/go: avoid link errors when -coverpkg covers main packages
Jay Conrod [Fri, 1 Mar 2019 22:20:28 +0000 (17:20 -0500)]
[release-branch.go1.12] cmd/go: avoid link errors when -coverpkg covers main packages

The -coverpkg lets users specify a list of packages that should have
coverage instrumentation. This may include packages not transitively
imported by tests. For each tested package, the synthetic main package
imports all covered packages so they can be registered with
testing.RegisterCover. This makes it possible for a main package to
import another main package.

When we compile a package with p.Internal.BuildInfo set (set on main
packages by Package.load in module mode), we set
runtime/debug.modinfo. Multiple main packages may be passed to the
linker because of the above scenario, so this causes duplicate symbol
errors.

This change copies p.Internal.BuildInfo to the synthetic main package
instead of the internal test package. Additionally, it forces main
packages imported by the synthetic test main package to be recompiled
for testing. Recompiled packages won't have p.Internal.BuildInfo set.

Fixes #30684

Change-Id: I06f028d55905039907940ec89d2835f5a1040203
Reviewed-on: https://go-review.googlesource.com/c/go/+/164877
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 10156b678336f7628a7f1fdd84ffe2a28d66969a)
Reviewed-on: https://go-review.googlesource.com/c/go/+/166318
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] doc/go1.12: new go line in go.mod can break builds with Go...
Ian Lance Taylor [Wed, 27 Feb 2019 22:13:55 +0000 (14:13 -0800)]
[release-branch.go1.12] doc/go1.12: new go line in go.mod can break builds with Go 1.11 - 1.11.3

Updates #30446

Change-Id: If069f72fa9735f839df92f3ede3bf7b6d7a695a5
Reviewed-on: https://go-review.googlesource.com/c/164317
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit e32203f647370897c6a28018c16cfd9584849569)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164318

5 years ago[release-branch.go1.12] cmd/go/internal/modfetch: handle codeRoot == path for paths...
Bryan C. Mills [Thu, 7 Mar 2019 22:29:24 +0000 (17:29 -0500)]
[release-branch.go1.12] cmd/go/internal/modfetch: handle codeRoot == path for paths with major-version suffixes

Fixes #30665

Change-Id: Icbcfdb3907bc003ac17a8c7df17ecb41daf82eb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/166117
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
(cherry picked from commit 1ab9f6837d6da80dad41657a913e47fa13a4fee8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/166317

5 years ago[release-branch.go1.12] path/filepath: don't discard .. in EvalSymlinks
Ian Lance Taylor [Fri, 1 Mar 2019 20:31:18 +0000 (12:31 -0800)]
[release-branch.go1.12] path/filepath: don't discard .. in EvalSymlinks

EvalSymlinks was mishandling cases like "/x/../../y" or "../../../x"
where there is an extra ".." that goes past the start of the path.

Updates #30520
Fixes #30586

Change-Id: I07525575f83009032fa1a99aa270c8d42007d276
Reviewed-on: https://go-review.googlesource.com/c/go/+/164762
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 294edb272d5d145665bdf8b4254609eae0363a8d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/165197
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] os: remove unreadable directories in RemoveAll
Baokun Lee [Mon, 4 Mar 2019 19:10:38 +0000 (03:10 +0800)]
[release-branch.go1.12] os: remove unreadable directories in RemoveAll

Updates #30555
Fixes #30579

Change-Id: Ib894b4f3cdba23a18a69c9470cf69ceb83591a4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/165057
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit c74659290a473cf932ec6bc96bfa7e96a930676e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/165058
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] doc: fix bad lib/time link in 1.12 release notes
Alberto Donizetti [Sun, 3 Mar 2019 17:33:34 +0000 (18:33 +0100)]
[release-branch.go1.12] doc: fix bad lib/time link in 1.12 release notes

There's a "lib/time" sub-section in the Go 1.12 relase notes that
points to a non-existent golang.org/pkg/lib/time page.

The note is about a change in the tz database in the src/lib/time
directory, but the section's title (and the link) should probably just
refer to the time package.

Change-Id: Ibf9dacd710e72886f14ad0b7415fea1e8d25b83a
Reviewed-on: https://go-review.googlesource.com/c/164977
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 0dc62565401eba11bf9aec127c6c9f5aa4ecf1c9)
Reviewed-on: https://go-review.googlesource.com/c/164964
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years ago[release-branch.go1.12] runtime: scan defer closure in stack scan
Cherry Zhang [Wed, 27 Feb 2019 17:34:20 +0000 (12:34 -0500)]
[release-branch.go1.12] runtime: scan defer closure in stack scan

With stack objects, when we scan the stack, it scans defers with
tracebackdefers, but it seems to me that tracebackdefers doesn't
include the func value itself, which could be a stack allocated
closure. Scan it explicitly.

Alternatively, we can change tracebackdefers to include the func
value, which in turn needs to change the type of stkframe.

Updates #30453.
Fixes #30470.

Change-Id: I55a6e43264d6952ab2fa5c638bebb89fdc410e2b
Reviewed-on: https://go-review.googlesource.com/c/164118
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 4f4c2a79d4f952b96d58aec2926b4c894245071b)
Reviewed-on: https://go-review.googlesource.com/c/164629
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] cmd/go/internal/cache: disable builds if GOCACHE is not an...
Baokun Lee [Thu, 28 Feb 2019 08:40:11 +0000 (16:40 +0800)]
[release-branch.go1.12] cmd/go/internal/cache: disable builds if GOCACHE is not an absolute path

If GOCACHE is set but is not an absolute path, we cannot build.
And GOCACHE=off also returns the error message "build cache is
disabled by GOCACHE=off".

Fixes #30493

Change-Id: I24f64bc886599ca0acd757acada4714aebe4d3ae
Reviewed-on: https://go-review.googlesource.com/c/164200
Run-TryBot: Baokun Lee <nototon@gmail.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 13d24b685a6d7b05a249f85be91c390f5595f745)
Reviewed-on: https://go-review.googlesource.com/c/164717
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] doc: add 1.10.8 and 1.11.5 to the releases list
Alberto Donizetti [Wed, 27 Feb 2019 16:25:28 +0000 (17:25 +0100)]
[release-branch.go1.12] doc: add 1.10.8 and 1.11.5 to the releases list

Fixes #30431

Change-Id: I379e78a1c385942a19e1a10b91d732f9a73899e6
Reviewed-on: https://go-review.googlesource.com/c/164041
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit d7518ac51879011a732440d4a49dc7043759e2c8)
Reviewed-on: https://go-review.googlesource.com/c/164077
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] path/filepath: revert "fix Windows-specific Clean bug"
Ian Lance Taylor [Wed, 20 Feb 2019 02:12:13 +0000 (18:12 -0800)]
[release-branch.go1.12] path/filepath: revert "fix Windows-specific Clean bug"

Revert CL 137055, which changed Clean("\\somepath\dir\") to return
"\\somepath\dir" on Windows. It's not entirely clear this is correct,
as this path is really "\\server\share\", and as such the trailing
slash may be the path on that share, much like "C:\". In any case, the
change broke existing code, so roll it back for now and rethink for 1.13.

Updates #27791
Updates #30307

Change-Id: I69200b1efe38bdb6d452b744582a2bfbb3acbcec
Reviewed-on: https://go-review.googlesource.com/c/163077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
(cherry picked from commit 153c0da89bca6726545cf4451053235b552d3d51)
Reviewed-on: https://go-review.googlesource.com/c/163078
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] doc: add 1.12 to the project history
Alberto Donizetti [Tue, 26 Feb 2019 17:18:44 +0000 (18:18 +0100)]
[release-branch.go1.12] doc: add 1.12 to the project history

Go 1.12 is released, but it's currently not listed in the
https://golang.org/project page.

Change-Id: Ib5820f74245e4c986014c64eb40fa2911473e64b
Reviewed-on: https://go-review.googlesource.com/c/163837
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 467456b0afcbe8b74c49b356f0e5d41d1c6efc9f)
Reviewed-on: https://go-review.googlesource.com/c/163727
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years ago[release-branch.go1.12] cmd/internal/obj/arm64: fix the bug assembling TSTW
fanzha02 [Thu, 21 Feb 2019 07:53:15 +0000 (07:53 +0000)]
[release-branch.go1.12] cmd/internal/obj/arm64: fix the bug assembling TSTW

Current assembler reports error when it assembles
"TSTW $1689262177517664, R3", but go1.11 was building
fine.

Fixes #30334

Change-Id: I9c16d36717cd05df2134e8eb5b17edc385aff0a9
Reviewed-on: https://go-review.googlesource.com/c/163259
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ben Shi <powerman1st@163.com>
(cherry picked from commit 2ef8abb41f2565e38e520c18773308b3cf005af6)
Reviewed-on: https://go-review.googlesource.com/c/163419
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] go1.12 go1.12
Andrew Bonventre [Mon, 25 Feb 2019 21:47:57 +0000 (16:47 -0500)]
[release-branch.go1.12] go1.12

Change-Id: I2fa947f75c0ace671ad8b99c4fab3ad7b178cedf
Reviewed-on: https://go-review.googlesource.com/c/163725
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years ago[release-branch.go1.12] doc: document Go 1.12
Andrew [Mon, 25 Feb 2019 21:33:12 +0000 (21:33 +0000)]
[release-branch.go1.12] doc: document Go 1.12

Change-Id: I845375d2b3824211b80885228ba5b45503cba1a6
Reviewed-on: https://go-review.googlesource.com/c/163722
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 8bffb8546cb8ed1c849989ddf2b151edc983a616)
Reviewed-on: https://go-review.googlesource.com/c/163723
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc/go1.12: remove draft notice
Andrew [Mon, 25 Feb 2019 20:02:00 +0000 (20:02 +0000)]
[release-branch.go1.12] doc/go1.12: remove draft notice

Change-Id: Ib6a0f5c35b1efc3f3c8e7ca2a5c4f35bf8bf5e5d
Reviewed-on: https://go-review.googlesource.com/c/163720
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 9d26ec85fc5657409d415caf647b11f614dd48c8)
Reviewed-on: https://go-review.googlesource.com/c/163721
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] doc/go1.12: change go install to go get
Andrew [Mon, 25 Feb 2019 19:13:57 +0000 (19:13 +0000)]
[release-branch.go1.12] doc/go1.12: change go install to go get

Using go get prevents the failure case of when the
user doesn't have the repo on their machine.

Change-Id: I9c1174087728b5b06b578b0d52df6eeb7e8c7a3c
Reviewed-on: https://go-review.googlesource.com/c/163718
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 2f9728aacdf90d21a530f68c6887cfe545954935)
Reviewed-on: https://go-review.googlesource.com/c/163719
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years ago[release-branch.go1.12] cmd/compile: call ginsnop, not ginsnop2 on ppc64le for mid...
Lynn Boger [Thu, 21 Feb 2019 19:48:52 +0000 (14:48 -0500)]
[release-branch.go1.12] cmd/compile: call ginsnop, not ginsnop2 on ppc64le for mid-stack inlining tracebacks

A recent change to fix stacktraces for inlined functions
introduced a regression on ppc64le when compiling position
independent code. That happened because ginsnop2 was called for
the purpose of inserting a NOP to identify the location of
the inlined function, when ginsnop should have been used.
ginsnop2 is intended to be used before deferreturn to ensure
r2 is properly restored when compiling position independent code.
In some cases the location where r2 is loaded from might not be
initialized. If that happens and r2 is used to generate an address,
the result is likely a SEGV.

This fixes that problem.

Fixes #30283

Change-Id: If70ef27fc65ef31969712422306ac3a57adbd5b6
Reviewed-on: https://go-review.googlesource.com/c/163337
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 2d3474043cd35ba06d3566df520e8550c479944f)
Reviewed-on: https://go-review.googlesource.com/c/163717
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years ago[release-branch.go1.12] cmd/compile: guard against loads with negative offset from...
Cherry Zhang [Fri, 15 Feb 2019 20:01:29 +0000 (15:01 -0500)]
[release-branch.go1.12] cmd/compile: guard against loads with negative offset from readonly constants

CL 154057 adds guards agaist out-of-bound reads from readonly
constants. It turns out that in dead code, the offset can also
be negative. Guard against negative offset as well.

Fixes #30257.

Change-Id: I47c2a2e434dd466c08ae6f50f213999a358c796e
Reviewed-on: https://go-review.googlesource.com/c/162819
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit dca707b2a040642bb46aa4da4fb4eb6188cc2502)
Reviewed-on: https://go-review.googlesource.com/c/162827
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] crypto/rc4: remove false guarantees from Reset docs and depre...
Filippo Valsorda [Wed, 13 Feb 2019 08:37:57 +0000 (03:37 -0500)]
[release-branch.go1.12] crypto/rc4: remove false guarantees from Reset docs and deprecate it

Nothing in Go can truly guarantee a key will be gone from memory (see
#21865), so remove that claim. That makes Reset useless, because
unlike most Reset methods it doesn't restore the original value state,
so deprecate it.

Change-Id: I6bb0f7f94c7e6dd4c5ac19761bc8e5df1f9ec618
Reviewed-on: https://go-review.googlesource.com/c/162297
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit b35dacaac57b039205d9b07ea24098e2c3fcb12e)
Reviewed-on: https://go-review.googlesource.com/c/163438

5 years ago[release-branch.go1.12] cmd/compile: flow interface data to heap if CONVIFACE of...
Cherry Zhang [Mon, 18 Feb 2019 04:12:55 +0000 (23:12 -0500)]
[release-branch.go1.12] cmd/compile: flow interface data to heap if CONVIFACE of a non-direct interface escapes

Consider the following code:

func f(x []*T) interface{} {
return x
}

It returns an interface that holds a heap copy of x (by calling
convT2I or friend), therefore x escape to heap. The current
escape analysis only recognizes that x flows to the result. This
is not sufficient, since if the result does not escape, x's
content may be stack allocated and this will result a
heap-to-stack pointer, which is bad.

Fix this by realizing that if a CONVIFACE escapes and we're
converting from a non-direct interface type, the data needs to
escape to heap.

Running "toolstash -cmp" on std & cmd, the generated machine code
are identical for all packages. However, the export data (escape
tags) differ in the following packages. It looks to me that all
are similar to the "f" above, where the parameter should escape
to heap.

io/ioutil/ioutil.go:118
old: leaking param: r to result ~r1 level=0
new: leaking param: r

image/image.go:943
old: leaking param: p to result ~r0 level=1
new: leaking param content: p

net/url/url.go:200
old: leaking param: s to result ~r2 level=0
new: leaking param: s

(as a consequence)
net/url/url.go:183
old: leaking param: s to result ~r1 level=0
new: leaking param: s

net/url/url.go:194
old: leaking param: s to result ~r1 level=0
new: leaking param: s

net/url/url.go:699
old: leaking param: u to result ~r0 level=1
new: leaking param: u

net/url/url.go:775
old: (*URL).String u does not escape
new: leaking param content: u

net/url/url.go:1038
old: leaking param: u to result ~r0 level=1
new: leaking param: u

net/url/url.go:1099
old: (*URL).MarshalBinary u does not escape
new: leaking param content: u

flag/flag.go:235
old: leaking param: s to result ~r0 level=1
new: leaking param content: s

go/scanner/errors.go:105
old: leaking param: p to result ~r0 level=0
new: leaking param: p

database/sql/sql.go:204
old: leaking param: ns to result ~r0 level=0
new: leaking param: ns

go/constant/value.go:303
old: leaking param: re to result ~r2 level=0, leaking param: im to result ~r2 level=0
new: leaking param: re, leaking param: im

go/constant/value.go:846
old: leaking param: x to result ~r1 level=0
new: leaking param: x

encoding/xml/xml.go:518
old: leaking param: d to result ~r1 level=2
new: leaking param content: d

encoding/xml/xml.go:122
old: leaking param: leaking param: t to result ~r1 level=0
new: leaking param: t

crypto/x509/verify.go:506
old: leaking param: c to result ~r8 level=0
new: leaking param: c

crypto/x509/verify.go:563
old: leaking param: c to result ~r3 level=0, leaking param content: c
new: leaking param: c

crypto/x509/verify.go:615
old: (nothing)
new: leaking closure reference c

crypto/x509/verify.go:996
old: leaking param: c to result ~r1 level=0, leaking param content: c
new: leaking param: c

net/http/filetransport.go:30
old: leaking param: fs to result ~r1 level=0
new: leaking param: fs

net/http/h2_bundle.go:2684
old: leaking param: mh to result ~r0 level=2
new: leaking param content: mh

net/http/h2_bundle.go:7352
old: http2checkConnHeaders req does not escape
new: leaking param content: req

net/http/pprof/pprof.go:221
old: leaking param: name to result ~r1 level=0
new: leaking param: name

cmd/internal/bio/must.go:21
old: leaking param: w to result ~r1 level=0
new: leaking param: w

Fixes #29353.

Change-Id: I7e7798ae773728028b0dcae5bccb3ada51189c68
Reviewed-on: https://go-review.googlesource.com/c/162829
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 0349f29a55fc194e3d51f748ec9ddceab87a5668)
Reviewed-on: https://go-review.googlesource.com/c/163203
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] crypto/tls: don't select RSA-PSS for client certificates...
Filippo Valsorda [Tue, 19 Feb 2019 20:58:06 +0000 (15:58 -0500)]
[release-branch.go1.12] crypto/tls: don't select RSA-PSS for client certificates in TLS 1.2

In https://golang.org/cl/160998, RSA-PSS was disabled for
(most of) TLS 1.2. One place where we can't disable it is in a Client
Hello which offers both TLS 1.2 and 1.3: RSA-PSS is required by TLS 1.3,
so to offer TLS 1.3 we need to offer RSA-PSS, even if the server might
select TLS 1.2.

The good news is that we want to disable RSA-PSS mostly when we are the
signing side, as that's where broken crypto.Signer implementations will
bite us. So we can announce RSA-PSS in the Client Hello, tolerate the
server picking TLS 1.2 and RSA-PSS for their signatures, but still not
do RSA-PSS on our side if asked to provide a client certificate.

Client-TLSv12-ClientCert-RSA-PSS-Disabled changed because it was indeed
actually using RSA-PSS.

Updates #30055

Change-Id: I5ecade744b666433b37847abf55e1f08089b21d4
Reviewed-on: https://go-review.googlesource.com/c/163039
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
5 years ago[release-branch.go1.12] database/sql/driver: fix typo
Zhou Peng [Fri, 15 Feb 2019 08:41:33 +0000 (16:41 +0800)]
[release-branch.go1.12] database/sql/driver: fix typo

Change-Id: I6e7035db4b3e2a09e5655eb7646eea9d99fb7118
Reviewed-on: https://go-review.googlesource.com/c/162917
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 4c89a10fb9f4fcb2ed01b6e7325e53b4bc487fc2)
Reviewed-on: https://go-review.googlesource.com/c/162889
Reviewed-by: Zhou Peng <p@ctriple.cn>
5 years ago[release-branch.go1.12] doc/go1.12: document net/url.Parse now rejecting ASCII CTLs
Brad Fitzpatrick [Fri, 15 Feb 2019 23:42:32 +0000 (23:42 +0000)]
[release-branch.go1.12] doc/go1.12: document net/url.Parse now rejecting ASCII CTLs

Updates #27302
Updates #22907

Change-Id: Iac6957f3517265dfb9c662efb7af31192e3bfd6c
Reviewed-on: https://go-review.googlesource.com/c/162960
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit ef454fd586ee30d8b35b5895320619ebde2beb98)
Reviewed-on: https://go-review.googlesource.com/c/162826

5 years ago[release-branch.go1.12] cmd/go: add newline after module-requires-version message
Ian Lance Taylor [Fri, 15 Feb 2019 21:00:03 +0000 (13:00 -0800)]
[release-branch.go1.12] cmd/go: add newline after module-requires-version message

Updates #30263

Change-Id: Iefb3d8baf815c19eaf915a59048e1da799ca0cdf
Reviewed-on: https://go-review.googlesource.com/c/162957
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit e1acd854f754f496be341211e9deee53fc7e3404)
Reviewed-on: https://go-review.googlesource.com/c/162958

5 years ago[release-branch.go1.12] syscall: skip TestSyscallNoError when temp dir is mounted...
Brad Fitzpatrick [Fri, 15 Feb 2019 18:55:45 +0000 (18:55 +0000)]
[release-branch.go1.12] syscall: skip TestSyscallNoError when temp dir is mounted nosuid

Fixes #30258

Change-Id: I73b63eb9d3aca00f562fdc3af010e96269bb6b9c
Reviewed-on: https://go-review.googlesource.com/c/162891
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
(cherry picked from commit 5fcc24074f8e48cd8404bd250c2c268aca2bc3d2)
Reviewed-on: https://go-review.googlesource.com/c/162818
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

5 years ago[release-branch.go1.12] net/http/httptrace: fix typo
berkant ipek [Tue, 12 Feb 2019 14:45:12 +0000 (14:45 +0000)]
[release-branch.go1.12] net/http/httptrace: fix typo

Change-Id: I15279e4aa9306bde925929907a7b5e7ef5d8b642
GitHub-Last-Rev: 6bc2d66aecd424b322ec0c23b280e74cb22e08c3
GitHub-Pull-Request: golang/go#30193
Reviewed-on: https://go-review.googlesource.com/c/162018
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 1edd2a34c1bcf2133b659878e8b59e401eb8cc24)
Reviewed-on: https://go-review.googlesource.com/c/162359
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[release-branch.go1.12] doc/go1.12: soften, expand crypto/rc4 assembly removal text
Brad Fitzpatrick [Tue, 12 Feb 2019 18:33:24 +0000 (18:33 +0000)]
[release-branch.go1.12] doc/go1.12: soften, expand crypto/rc4 assembly removal text

Change-Id: I46fa43f6c5ac49386f4622e1363d8976f49c0894
Reviewed-on: https://go-review.googlesource.com/c/162019
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit c75ee696c341cef94b00409b3692f3df82af1c71)
Reviewed-on: https://go-review.googlesource.com/c/162357

5 years ago[release-branch.go1.12] doc/go1.12: note that Go 1.12 is the last release to include...
Brad Fitzpatrick [Wed, 13 Feb 2019 19:07:40 +0000 (19:07 +0000)]
[release-branch.go1.12] doc/go1.12: note that Go 1.12 is the last release to include godoc

Updates #30029

Change-Id: I88e09035d675e7a6855ada0262eb42636c9822cc
Reviewed-on: https://go-review.googlesource.com/c/162417
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit 7cf31d8f4116420e396c5e8690c043b2ce83f90a)
Reviewed-on: https://go-review.googlesource.com/c/162557

5 years ago[release-branch.go1.12] os: don't return ENOENT if directory removed before Fstatat
Ian Lance Taylor [Tue, 12 Feb 2019 18:20:28 +0000 (10:20 -0800)]
[release-branch.go1.12] os: don't return ENOENT if directory removed before Fstatat

Updates #30197

Change-Id: I08b592fbd477d6879eb5d3b7fcbbc8322ea90103
Reviewed-on: https://go-review.googlesource.com/c/162078
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 cf4dc25503e6fb630280f8de0f11112aecb94b57)
Reviewed-on: https://go-review.googlesource.com/c/162197

5 years ago[release-branch.go1.12] crypto/tls, runtime: document GODEBUG TLS 1.3 option
Brad Fitzpatrick [Wed, 13 Feb 2019 16:15:09 +0000 (16:15 +0000)]
[release-branch.go1.12] crypto/tls, runtime: document GODEBUG TLS 1.3 option

Change-Id: I6801676335924414ce50249df2b7bea08886b203
Reviewed-on: https://go-review.googlesource.com/c/162360
Reviewed-by: Filippo Valsorda <filippo@golang.org>
(cherry picked from commit 48bb61166711f47eb401f245c704a5a4887d4503)
Reviewed-on: https://go-review.googlesource.com/c/162497

5 years ago[release-branch.go1.12] runtime: scan gp._panic in stack scan
Cherry Zhang [Sun, 10 Feb 2019 04:31:59 +0000 (23:31 -0500)]
[release-branch.go1.12] runtime: scan gp._panic in stack scan

In runtime.gopanic, the _panic object p is stack allocated and
referenced from gp._panic. With stack objects, p on stack is dead
at the point preprintpanics runs. gp._panic points to p, but
stack scan doesn't look at gp. Heap scan of gp does look at
gp._panic, but it stops and ignores the pointer as it points to
the stack. So whatever p points to may be collected and clobbered.
We need to scan gp._panic explicitly during stack scan.

To test it reliably, we introduce a GODEBUG mode "clobberfree",
which clobbers the memory content when the GC frees an object.

Fixes #30150.

Change-Id: I11128298f03a89f817faa221421a9d332b41dced
Reviewed-on: https://go-review.googlesource.com/c/161778
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
(cherry picked from commit af8f4062c24cb36af4dc24fbaffd23aa7f7bde36)
Reviewed-on: https://go-review.googlesource.com/c/162358
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[release-branch.go1.12] doc: don't use "go tool vet" as an example
Ian Lance Taylor [Wed, 13 Feb 2019 04:45:45 +0000 (20:45 -0800)]
[release-branch.go1.12] doc: don't use "go tool vet" as an example

Updates #30199

Change-Id: Ib4586e3facb8c0985c8882482d94843b648b9d2f
Reviewed-on: https://go-review.googlesource.com/c/162257
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 ffd096db2b1cff6399eb1f86e5652564ee8ee362)
Reviewed-on: https://go-review.googlesource.com/c/162238
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years ago[release-branch.go1.12] go1.12rc1 go1.12rc1
Andrew Bonventre [Mon, 11 Feb 2019 20:02:50 +0000 (15:02 -0500)]
[release-branch.go1.12] go1.12rc1

Change-Id: Iac838b852061a8469e4e201670a589fa2bed9f04
Reviewed-on: https://go-review.googlesource.com/c/161900
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go/internal/modcmd: use replaced paths to break cycles in 'go mod tidy'
Bryan C. Mills [Mon, 11 Feb 2019 17:56:09 +0000 (12:56 -0500)]
cmd/go/internal/modcmd: use replaced paths to break cycles in 'go mod tidy'

Fixes #30166

Change-Id: I4704b57ed48197f512cd1b818e1f7d2fffc0d9ce
Reviewed-on: https://go-review.googlesource.com/c/161898
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc: remove last pieces of advice to set GOROOT
Daniel Martí [Fri, 8 Feb 2019 11:22:48 +0000 (11:22 +0000)]
doc: remove last pieces of advice to set GOROOT

install.html still insisted that GOROOT must be set if a binary install
of Go is set up in a custom directory. However, since 1.10, this has
been unnecessary as the GOROOT will be found based on the location of
the 'go' binary being run.

Likewise, install-source.html includes an 'export GOROOT' line in a
section that only talks about explicitly setting GOARCH and GOOS, which
is optional. We don't want to have users think it is recommended to set
GOROOT here either, so remove the unnecessary line.

Change-Id: I7dfef09f9a1d003e0253b793d63ea40d5cf1837f
Reviewed-on: https://go-review.googlesource.com/c/161758
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agosync/atomic: add 32-bit MIPS to the 64-bit alignment requirement
Ian Lance Taylor [Fri, 8 Feb 2019 00:55:17 +0000 (16:55 -0800)]
sync/atomic: add 32-bit MIPS to the 64-bit alignment requirement

runtime/internal/atomic/atomic_mipsx.go enforces 64-bit alignment.

Change-Id: Ifdc36e1c0322827711425054d10f1c52425a13fa
Reviewed-on: https://go-review.googlesource.com/c/161697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc: fix typos
alkesh26 [Sat, 9 Feb 2019 17:33:42 +0000 (17:33 +0000)]
doc: fix typos

Change-Id: I46046cddceff2d44a7b2517db1ebf7acdf5f2b90
GitHub-Last-Rev: 7fb9f26476d2764f07d068ce612bf79b1e7f44b4
GitHub-Pull-Request: golang/go#30144
Reviewed-on: https://go-review.googlesource.com/c/161718
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodatabase/sql: document Stmt lifetime
Justin Li [Wed, 23 Jan 2019 15:15:06 +0000 (15:15 +0000)]
database/sql: document Stmt lifetime

When prepared on a DB, prepared statement code in database/sql handles everything to keep the prepared statement alive as it moves across the connection pool. Understanding this is an important part of using this API correctly, but it was only documented indirectly via `(*Tx) Prepare*`.

Change-Id: Ic8757e0150d59e675d9f0252f6c15aef2cc2e831
GitHub-Last-Rev: 55dba87458542cb631baac80aeea0c3607d8f421
GitHub-Pull-Request: golang/go#29890
Reviewed-on: https://go-review.googlesource.com/c/159077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
5 years agocrypto/tls: disable RSA-PSS in TLS 1.2
Filippo Valsorda [Tue, 5 Feb 2019 20:27:56 +0000 (15:27 -0500)]
crypto/tls: disable RSA-PSS in TLS 1.2

Most of the issues that led to the decision on #30055 were related to
incompatibility with or faulty support for RSA-PSS (#29831, #29779,
v1.5 signatures). RSA-PSS is required by TLS 1.3, but is also available
to be negotiated in TLS 1.2.

Altering TLS 1.2 behavior based on GODEBUG=tls13=1 feels surprising, so
just disable RSA-PSS entirely in TLS 1.2 until TLS 1.3 is on by default,
so breakage happens all at once.

Updates #30055

Change-Id: Iee90454a20ded8895e5302e8bcbcd32e4e3031c2
Reviewed-on: https://go-review.googlesource.com/c/160998
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
5 years agocrypto/tls: make TLS 1.3 opt-in
Filippo Valsorda [Tue, 5 Feb 2019 20:29:02 +0000 (15:29 -0500)]
crypto/tls: make TLS 1.3 opt-in

Updates #30055

Change-Id: If68615c8e9daa4226125dcc6a6866f29f3cfeef1
Reviewed-on: https://go-review.googlesource.com/c/160997
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocrypto/x509: consider parents by Subject if AKID has no match
Filippo Valsorda [Mon, 4 Feb 2019 23:08:43 +0000 (18:08 -0500)]
crypto/x509: consider parents by Subject if AKID has no match

If a certificate somehow has an AKID, it should still chain successfully
to a parent without a SKID, even if the latter is invalid according to
RFC 5280, because only the Subject is authoritative.

This reverts to the behavior before #29233 was fixed in 770130659. Roots
with the right subject will still be shadowed by roots with the right
SKID and the wrong subject, but that's been the case for a long time, and
is left for a more complete fix in Go 1.13.

Updates #30079

Change-Id: If8ab0179aca86cb74caa926d1ef93fb5e416b4bb
Reviewed-on: https://go-review.googlesource.com/c/161097
Reviewed-by: Adam Langley <agl@golang.org>
5 years agotest/chan: fix broken link to Squinting at Power Series
Yasser Abdolmaleki [Wed, 6 Feb 2019 06:14:44 +0000 (22:14 -0800)]
test/chan: fix broken link to Squinting at Power Series

Change-Id: Idee94a1d93555d53442098dd7479982e3f5afbba
Reviewed-on: https://go-review.googlesource.com/c/161339
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocrypto/x509: improve CertificateRequest docs
Filippo Valsorda [Tue, 5 Feb 2019 21:08:35 +0000 (16:08 -0500)]
crypto/x509: improve CertificateRequest docs

Change-Id: If3bab2dd5278ebc621235164e9d6ff710ba326ee
Reviewed-on: https://go-review.googlesource.com/c/160898
Reviewed-by: Adam Langley <agl@golang.org>
5 years agodoc: fix a typo
alkesh26 [Tue, 5 Feb 2019 10:05:10 +0000 (10:05 +0000)]
doc: fix a typo

Change-Id: Ia830f59d6f6ca1bc506ec298ccfc154d9f94f01d
GitHub-Last-Rev: 3ab18d4fd1a8d4295713cbb7ff74f30b3838b6d3
GitHub-Pull-Request: golang/go#30067
Reviewed-on: https://go-review.googlesource.com/c/160829
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc: go1.12: document FreeBSD 12.0 requires COMPAT_FREEBSD11
Yuval Pavel Zholkover [Fri, 1 Feb 2019 15:58:01 +0000 (17:58 +0200)]
doc: go1.12: document FreeBSD 12.0 requires COMPAT_FREEBSD11

Fixes #22447
Fixes #22448

Change-Id: Ia24f42c31e014c79040ff927f1247dfb2318de4f
Reviewed-on: https://go-review.googlesource.com/c/160778
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
5 years agocmd/go: clarify @none effect on dependants modules
Alberto Donizetti [Mon, 4 Feb 2019 19:07:46 +0000 (20:07 +0100)]
cmd/go: clarify @none effect on dependants modules

Expand modules documentation to clarify why @none is useful. The
wording is the one suggested by rsc on the issue.

Fixes #26684

Change-Id: I76dc4ff87e50f1dd8536fd9ac1fd938adb29bee3
Reviewed-on: https://go-review.googlesource.com/c/161037
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocrypto/aes: replace broken extenal link to FIPS 197
spring1843 [Sun, 3 Feb 2019 05:09:55 +0000 (21:09 -0800)]
crypto/aes: replace broken extenal link to FIPS 197

Change-Id: Ib0a0d04aaaaa3c213fdb8646bd9b7dfdadae40d4
Reviewed-on: https://go-review.googlesource.com/c/160831
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agocmd/cgo: don't copy a simple variable x in &x[0]
Ian Lance Taylor [Sun, 3 Feb 2019 00:03:28 +0000 (16:03 -0800)]
cmd/cgo: don't copy a simple variable x in &x[0]

Fixes #30065

Change-Id: I3d0fb03bab397548653d5f3b386cfe2980ac1030
Reviewed-on: https://go-review.googlesource.com/c/160830
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: fix crash when memmove argument is not the right type
Keith Randall [Fri, 1 Feb 2019 23:27:53 +0000 (15:27 -0800)]
cmd/compile: fix crash when memmove argument is not the right type

Make sure the argument to memmove is of pointer type before we try to
get the element type.

This has been noticed for code that uses unsafe+linkname so it can
call runtime.memmove. Probably not the best thing to allow, but the
code is out there and we'd rather not break it unnecessarily.

Fixes #30061

Change-Id: I334a8453f2e293959fd742044c43fbe93f0b3d31
Reviewed-on: https://go-review.googlesource.com/c/160826
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoreflect: eliminate write barrier for copying result in callReflect
Cherry Zhang [Fri, 1 Feb 2019 01:29:21 +0000 (20:29 -0500)]
reflect: eliminate write barrier for copying result in callReflect

We are copying the results to uninitialized stack space. Write
barrier is not needed.

Fixes #30041.

Change-Id: Ia91d74dbafd96dc2bd92de0cb479808991dda03e
Reviewed-on: https://go-review.googlesource.com/c/160737
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agodoc: go1.12: update notes on go directive
Ian Lance Taylor [Fri, 1 Feb 2019 14:22:00 +0000 (06:22 -0800)]
doc: go1.12: update notes on go directive

Fixes #30043

Change-Id: I4ecfff7d8a9432240c1927f7484786fe1182b773
Reviewed-on: https://go-review.googlesource.com/c/160797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/cgo: ignore unrecognized GCC warning group pragmas
Yuval Pavel Zholkover [Fri, 1 Feb 2019 11:51:31 +0000 (13:51 +0200)]
cmd/cgo: ignore unrecognized GCC warning group pragmas

CL 159859 causes build failure with old clang versions (3.4.1) on FreeBSD 10.3/10.4.

Update #29962
Update #27619

Change-Id: I78264ac5d8d17eeae89a982e89aac988eb22b286
Reviewed-on: https://go-review.googlesource.com/c/160777
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agoruntime: add credit system for scavenging
Michael Anthony Knyszek [Tue, 29 Jan 2019 19:58:29 +0000 (19:58 +0000)]
runtime: add credit system for scavenging

When scavenging small amounts it's possible we over-scavenge by a
significant margin since we choose to scavenge the largest spans first.
This over-scavenging is never accounted for.

With this change, we add a scavenge credit pool, similar to the reclaim
credit pool. Any time scavenging triggered by RSS growth starts up, it
checks if it can cash in some credit first. If after using all the
credit it still needs to scavenge, then any extra it does it adds back
into the credit pool.

This change mitigates the performance impact of golang.org/cl/159500 on
the Garbage benchmark. On Go1 it suggests some improvements, but most of
that is within the realm of noise (Revcomp seems very sensitive to
GC-related changes, both postively and negatively).

Garbage: https://perf.golang.org/search?q=upload:20190131.5
Go1:     https://perf.golang.org/search?q=upload:20190131.4

Performance change with both changes:

Garbage: https://perf.golang.org/search?q=upload:20190131.7
Go1:     https://perf.golang.org/search?q=upload:20190131.6

Change-Id: I87bd3c183e71656fdafef94714194b9fdbb77aa2
Reviewed-on: https://go-review.googlesource.com/c/160297
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: scavenge memory upon allocating from scavenged memory
Michael Anthony Knyszek [Fri, 25 Jan 2019 17:40:40 +0000 (17:40 +0000)]
runtime: scavenge memory upon allocating from scavenged memory

Because scavenged and unscavenged spans no longer coalesce, memory that
is freed no longer has a high likelihood of being re-scavenged. As a
result, if an application is allocating at a fast rate, it may work fast
enough to undo all the scavenging work performed by the runtime's
current scavenging mechanisms. This behavior is exacerbated by the
global best-fit allocation policy the runtime uses, since scavenged
spans are just as likely to be chosen as unscavenged spans on average.

To remedy that, we treat each allocation of scavenged space as a heap
growth, and scavenge other memory to make up for the allocation.

This change makes performance of the runtime slightly worse, as now
we're scavenging more often during allocation. The regression is
particularly obvious with the garbage benchmark (3%) but most of the Go1
benchmarks are within the margin of noise. A follow-up change should
help.

Garbage: https://perf.golang.org/search?q=upload:20190131.3
Go1:     https://perf.golang.org/search?q=upload:20190131.2

Updates #14045.

Change-Id: I44a7e6586eca33b5f97b6d40418db53a8a7ae715
Reviewed-on: https://go-review.googlesource.com/c/159500
Reviewed-by: Austin Clements <austin@google.com>
5 years agocmd/cgo: disable GCC 9 warnings triggered by cgo code
Ian Lance Taylor [Mon, 28 Jan 2019 20:31:55 +0000 (12:31 -0800)]
cmd/cgo: disable GCC 9 warnings triggered by cgo code

GCC 9 has started emitting warnings when taking the address of a field
in a packed struct may cause a misaligned pointer. We use packed
structs in cgo to ensure that our field layout matches the C
compiler's layout. Our pointers are always aligned, so disable the warning

Fixes #29962

Change-Id: I7e290a7cf694a2c2958529e340ebed9fcd62089c
Reviewed-on: https://go-review.googlesource.com/c/159859
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoCONTRIBUTORS: second round of updates for Go 1.12
Dmitri Shuralyov [Tue, 29 Jan 2019 18:58:21 +0000 (13:58 -0500)]
CONTRIBUTORS: second round of updates for Go 1.12

This update has been automatically generated using the updatecontrib
command at CL 160277:

cd gotip
go run golang.org/x/build/cmd/updatecontrib

Actions taken (relative to CONTRIBUTORS at origin/master):

Added Aaron Cannon <cannona@fireantproductions.com>
Added Andzej Maciusovic <andzej.maciusovic@gmail.com>
Added Douglas Danger Manley <doug.manley@gmail.com>
Added Federico Bond <federicobond@gmail.com>
Added Frew Schmidt <github@frew.co>
Added GitHub User @saitarunreddy (21041941) <saitarunreddypalla@gmail.com>
Added GitHub User @tell-k (26263) <ffk2005@gmail.com>
Added Guilherme Caruso <gui.martinscaruso@gmail.com>
Added Jay Taylor <outtatime@gmail.com>
Added Juan Pablo Civile <elementohb@gmail.com>
Added Julien Kauffmann <julien.kauffmann@freelan.org>
Added Maya Rashish <maya@NetBSD.org>
Added Parminder Singh <parmsingh101@gmail.com>
Added Peter Dotchev <dotchev@gmail.com>
Added Quinten Yearsley <qyearsley@chromium.org>
Added Ross Smith II <ross@smithii.com>
Added Sean Chen <oohcode@gmail.com>
Added Sebastiaan van Stijn <github@gone.nl>
Added Sebastian Schmidt <yath@google.com>
Added Sebastien Williams-Wynn <sebastien@cytora.com>
Added Viacheslav Poturaev <vearutop@gmail.com>
Added Yohei Takeda <yo.tak0812@gmail.com>
Used GitHub User @saitarunreddy (21041941) form for saitarunreddy <saitarunreddypalla@gmail.com> https://github.com/golang/build/commit/269e03a [build]
Used GitHub User @tell-k (26263) form for tell-k <ffk2005@gmail.com> https://github.com/golang/tools/commit/85a87a81 [tools]
Used GitHub name "Akhil Indurti" for smasher164 <aindurti@gmail.com> https://github.com/golang/go/commit/a7af474359 [build go]
Used GitHub name "Guilherme Caruso" for GuilhermeCaruso <gui.martinscaruso@gmail.com> https://github.com/golang/go/commit/5fae09b738 [go]
Used GitHub name "Ivan Markin" for nogoegst <nogoegst@users.noreply.github.com> https://github.com/golang/go/commit/a1addf15df [go]
Used GitHub name "Keiji Yoshida" for yosssi <yoshida.keiji.84@gmail.com> https://github.com/golang/lint/commit/ac6833c [lint]
Used GitHub name "Marwan Sulaiman" for marwan-at-work <marwan.sameer@gmail.com> https://github.com/golang/go/commit/92caeef892 [go]
Used GitHub name "Michalis Kargakis" for kargakis <mkargaki@redhat.com> https://github.com/golang/go/commit/e243d242d7 [go]
Used GitHub name "Robin Eklind" for mewmew <rnd0x00@gmail.com> https://github.com/golang/go/commit/b8620afb8d [go proposal.git]
Used GitHub name "Sean Chen" for two <oohcode@gmail.com> https://github.com/golang/sys/commit/302c3dd [sys]
Used GitHub name "Sebastien Williams-Wynn" for GiantsLoveDeathMetal <sebastien@cytora.com> https://github.com/golang/go/commit/4e056ade24 [go]
Used GitHub name "Yohei Takeda" for yo-tak <yo.tak0812@gmail.com> https://github.com/golang/go/commit/8b7cf898af [go]

Given that the scope of updatecontrib is only to add contributors to
CONTRIBUTORS file, without having to check CLAs or deal with legal
matters, we can relax the requirement of having a space in the name
before it gets added to the CONTRIBUTORS file. That will be done
in a later change.

Updates #12042

Change-Id: I70248f3c82a836ee829256898e931e638ee45eb4
Reviewed-on: https://go-review.googlesource.com/c/160261
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc: note go tool tour removal in 1.12 release notes
Alberto Donizetti [Sat, 19 Jan 2019 17:24:32 +0000 (18:24 +0100)]
doc: note go tool tour removal in 1.12 release notes

Note the removal of the go tool tour command in the Go 1.12 release
notes.

Updates #24819

Change-Id: I258ab9401ea2cc06a83328c67299376fcf23c980
Reviewed-on: https://go-review.googlesource.com/c/158618
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agoos: treat EACCES as a permission error in RemoveAll
Ian Lance Taylor [Tue, 29 Jan 2019 23:57:41 +0000 (15:57 -0800)]
os: treat EACCES as a permission error in RemoveAll

Fixes #29983

Change-Id: I24077bde991e621c23d00973b2a77bb3a18e4ae7
Reviewed-on: https://go-review.googlesource.com/c/160180
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoos: restore RemoveAll docs by making a single copy
Ian Lance Taylor [Wed, 30 Jan 2019 00:36:25 +0000 (16:36 -0800)]
os: restore RemoveAll docs by making a single copy

Updates #29983

Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5
Reviewed-on: https://go-review.googlesource.com/c/160182
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc: remove meaningless word from Go 1.12 release notes
Ian Lance Taylor [Tue, 29 Jan 2019 21:23:07 +0000 (13:23 -0800)]
doc: remove meaningless word from Go 1.12 release notes

Change-Id: I744940e2bbde19ccec53af6c5469d46ba9161f01
Reviewed-on: https://go-review.googlesource.com/c/160179
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
5 years agoos: make openFdAt act like openFileNolog
Ian Lance Taylor [Wed, 30 Jan 2019 00:34:27 +0000 (16:34 -0800)]
os: make openFdAt act like openFileNolog

- add EINTR loop on Darwin
- return PathError on error
- call newFile rather than NewFile

This tries to minimize the possibility of any future changes.
It would be nice to put openFdAt in the same file as openFileNolog,
but build tags forbid.

Updates #29983

Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934
Reviewed-on: https://go-review.googlesource.com/c/160181
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
5 years agonet/url, net/http: relax CTL-in-URL validation to only ASCII CTLs
Brad Fitzpatrick [Tue, 29 Jan 2019 17:22:36 +0000 (17:22 +0000)]
net/url, net/http: relax CTL-in-URL validation to only ASCII CTLs

CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8,
even if sometimes they are in some contexts.

Instead, only reject ASCII CTLs.

Updates #27302
Updates #22907

Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62
Reviewed-on: https://go-review.googlesource.com/c/160178
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.12: add notes about 'go doc -src'
kim yongbin [Thu, 27 Dec 2018 02:33:15 +0000 (11:33 +0900)]
doc/go1.12: add notes about 'go doc -src'

Change-Id: Iaf67fcbb145277327e24150b29ff38f6c65f6a03
Reviewed-on: https://go-review.googlesource.com/c/155781
Reviewed-by: Ian Lance Taylor <iant@golang.org>