]> Cypherpunks repositories - gostls13.git/log
gostls13.git
6 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>
6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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>
6 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>
6 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>
6 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

6 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

6 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>

6 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>
6 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

6 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

6 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

6 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

6 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>
6 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>
6 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>

6 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>

6 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>

6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 years agodoc: go1.12: mention change in text/template user function panic
Ian Lance Taylor [Tue, 29 Jan 2019 02:42:37 +0000 (18:42 -0800)]
doc: go1.12: mention change in text/template user function panic

Updates #28242

Change-Id: Ib717b64f1f368cc889895a2437ff2943ed4eab0d
Reviewed-on: https://go-review.googlesource.com/c/159998
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
6 years agocmd/link: fix confusing error on unresolved symbol
Austin Clements [Mon, 28 Jan 2019 02:03:32 +0000 (21:03 -0500)]
cmd/link: fix confusing error on unresolved symbol

Currently, if an assembly file includes a static reference to an
undefined symbol, and another package also has an undefined reference
to that symbol, the linker can report an error like:

  x: relocation target zero not defined for ABI0 (but is defined for ABI0)

Since the symbol is referenced in another package, the code in
ErrorUnresolved that looks for alternative ABI symbols finds that
symbol in the symbol table, but doesn't check that it's actually
defined, which is where the "but is defined for ABI0" comes from. The
"not defined for ABI0" is because ErrorUnresolved failed to turn the
static symbol's version back into an ABI, and it happened to print the
zero value for an ABI.

This CL fixes both of these problems. It explicitly maps the
relocation version back to an ABI and detects if it can't be mapped
back (e.g., because it's a static reference). Then, if it finds a
symbol with a different ABI in the symbol table, it checks to make
sure it's a definition, and not simply an unresolved reference.

Fixes #29852.

Change-Id: Ice45cc41c1907919ce5750f74588e8047eaa888c
Reviewed-on: https://go-review.googlesource.com/c/159518
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: mention init traceback change in Go 1.12 release notes
Ian Lance Taylor [Mon, 28 Jan 2019 18:45:26 +0000 (10:45 -0800)]
doc: mention init traceback change in Go 1.12 release notes

Updates #29919

Change-Id: Ibf92c9957f71394f08c1203a29eae35a12021585
Reviewed-on: https://go-review.googlesource.com/c/159877
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agodoc: describe change to eliminate method expression wrappers from stack traces
Keith Randall [Tue, 22 Jan 2019 21:44:32 +0000 (13:44 -0800)]
doc: describe change to eliminate method expression wrappers from stack traces

Change-Id: I824b42a1c1fdcee8712681ffc6316470761be065
Reviewed-on: https://go-review.googlesource.com/c/159858
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agopath/filepath: skip TestIssue29372 on windows, if /tmp has symilinks
Alex Brainman [Fri, 25 Jan 2019 07:22:27 +0000 (18:22 +1100)]
path/filepath: skip TestIssue29372 on windows, if /tmp has symilinks

TestIssue29372 is broken on windows when temporary directory has
symlink in its path.

Adjust the test to use filepath.EvalSymlinks of temporary directory,
instead of temporary directory on windows. This change is not a
proper fix, but at least it makes TestIssue29372 pass on windows-arm.

See issue for details.

Updates #29746

Change-Id: I2af8ebb89da7cb9daf027a5e49e32ee22dbd0e3d
Reviewed-on: https://go-review.googlesource.com/c/159578
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: hide init functions in tracebacks
Keith Randall [Fri, 25 Jan 2019 18:21:40 +0000 (10:21 -0800)]
cmd/compile: hide init functions in tracebacks

Treat compiler-generated init functions as wrappers, so they will not
be shown in tracebacks.

The exception to this rule is that we'd like to show the line number
of initializers for global variables in tracebacks. In order to
preserve line numbers for those cases, separate out the code for those
initializers into a separate function (which is not marked as
autogenerated).

This CL makes the go binary 0.2% bigger.

Fixes #29919

Change-Id: I0f1fbfc03d10d764ce3a8ddb48fb387ca8453386
Reviewed-on: https://go-review.googlesource.com/c/159717
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: base PPC64 trunc rules on final type, not op type
Ian Lance Taylor [Sat, 26 Jan 2019 19:55:00 +0000 (11:55 -0800)]
cmd/compile: base PPC64 trunc rules on final type, not op type

Whether a truncation should become a MOVWreg or a MOVWZreg doesn't
depend on the type of the operand, it depends on the type of the final
result.  If the final result is unsigned, we can use MOVWZreg.  If the
final result is signed, we can use MOVWreg.  Checking the type of the
operand does the wrong thing if truncating an unsigned value to a
signed value, or vice-versa.

Fixes #29943

Change-Id: Ia6fc7d006486fa02cffd0bec4d910bdd5b6365f8
Reviewed-on: https://go-review.googlesource.com/c/159760
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agosort: change let to let's
GiantsLoveDeathMetal [Fri, 25 Jan 2019 02:07:03 +0000 (02:07 +0000)]
sort: change let to let's

Trivial typo

Change-Id: I3804f365519453bfa19997f55ead34742ac1a9db
GitHub-Last-Rev: 0e04e928d05121099b78a2cefc1cb7531f6a7650
GitHub-Pull-Request: golang/go#29930
Reviewed-on: https://go-review.googlesource.com/c/159479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agocmd/go: mention that binary packages are going away
Ian Lance Taylor [Fri, 25 Jan 2019 02:36:00 +0000 (18:36 -0800)]
cmd/go: mention that binary packages are going away

Updates #28152
Fixes #29927

Change-Id: Iea692c90074d057a1733e98bca3928e8f3569585
Reviewed-on: https://go-review.googlesource.com/c/159557
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/compile, cmd/link: document more flags
yo-tak [Tue, 22 Jan 2019 15:11:33 +0000 (00:11 +0900)]
cmd/compile, cmd/link: document more flags

Fixes #26533

Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6
Reviewed-on: https://go-review.googlesource.com/c/138757
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 agocmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking
Bryan C. Mills [Thu, 17 Jan 2019 19:39:31 +0000 (14:39 -0500)]
cmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking

Fixes #28753
Updates #29628

Change-Id: I4a561be7d491a0d088e656b00151ae1bdbd16a84
Reviewed-on: https://go-review.googlesource.com/c/158357
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocrypto/elliptic: reduce subtraction term to prevent long busy loop
Filippo Valsorda [Tue, 22 Jan 2019 21:02:41 +0000 (16:02 -0500)]
crypto/elliptic: reduce subtraction term to prevent long busy loop

If beta8 is unusually large, the addition loop might take a very long
time to bring x3-beta8 back positive.

This would lead to a DoS vulnerability in the implementation of the
P-521 and P-384 elliptic curves that may let an attacker craft inputs
to ScalarMult that consume excessive amounts of CPU.

This fixes CVE-2019-6486.

Fixes #29903

Change-Id: Ia969e8b5bf5ac4071a00722de9d5e4d856d8071a
Reviewed-on: https://team-review.git.corp.google.com/c/399777
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-on: https://go-review.googlesource.com/c/159218
Reviewed-by: Julie Qiu <julie@golang.org>
6 years agonet/http: update bundled http2
Brad Fitzpatrick [Wed, 23 Jan 2019 20:35:37 +0000 (20:35 +0000)]
net/http: update bundled http2

Updates bundled http2 to x/net git rev ed066c81e7 for:

    http2: Revert a closed stream cannot receive data
    https://golang.org/cl/153977

Updates golang/go#28204

Change-Id: I0a489e4e8a581a107970199f64f0fa9281982efe
Reviewed-on: https://go-review.googlesource.com/c/159179
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
6 years agonet/url, net/http: reject control characters in URLs
Brad Fitzpatrick [Wed, 23 Jan 2019 19:09:07 +0000 (19:09 +0000)]
net/url, net/http: reject control characters in URLs

This is a more conservative version of the reverted CL 99135 (which
was reverted in CL 137716)

The net/url part rejects URLs with ASCII CTLs from being parsed and
the net/http part rejects writing them if a bogus url.URL is
constructed otherwise.

Updates #27302
Updates #22907

Change-Id: I09a2212eb74c63db575223277aec363c55421ed8
Reviewed-on: https://go-review.googlesource.com/c/159157
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years agodoc: mention 'go get golang.org/dl/...' in install
Daniel Martí [Thu, 10 Jan 2019 23:42:53 +0000 (23:42 +0000)]
doc: mention 'go get golang.org/dl/...' in install

I needed Go 1.10 to debug and fix a test failure on that Go version in
x/tools, but I forgot what the magic 'go get' command for this was.

Googling "download specific golang version" and similar keywords showed
no results, presumably because the golang.org/dl subrepo isn't
prominently recommended nor documented anywhere.

The most appropriate documentation page to add this to is doc/install,
since it goes into some detail and is well indexed. We only need a short
section to introduce the trick.

The example does mention a specific version, Go 1.10.7, but I couldn't
imagine a way to make it version-agnostic while still being clear on
what the commands effectively do.

Change-Id: I13158564d76d95caec412cdb35a50a4356df5863
Reviewed-on: https://go-review.googlesource.com/c/157457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agoA+C: change email address for Elias Naur
Elias Naur [Wed, 23 Jan 2019 14:05:16 +0000 (15:05 +0100)]
A+C: change email address for Elias Naur

Change-Id: I0eefaed645d5d1f56c408af496c92dbb799977c8
Reviewed-on: https://go-review.googlesource.com/c/159037
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/compile: don't bother compiling functions named "_"
Keith Randall [Tue, 22 Jan 2019 21:49:47 +0000 (13:49 -0800)]
cmd/compile: don't bother compiling functions named "_"

They can't be used, so we don't need code generated for them. We just
need to report errors in their bodies.

This is the minimal CL for 1.12. For 1.13, CL 158845 will remove
a bunch of special cases sprinkled about the compiler to handle "_"
functions, which should (after this CL) be unnecessary.

Update #29870

Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13
Reviewed-on: https://go-review.googlesource.com/c/158820
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocrypto/subtle: normalize constant time ops docs
Filippo Valsorda [Sun, 20 Jan 2019 21:18:04 +0000 (16:18 -0500)]
crypto/subtle: normalize constant time ops docs

ConstantTimeCompare is fairly useless if you can't rely on it being zero
when the slices are different, but thankfully it has that property
thanks to the final ConstantTimeByteEq.

Change-Id: Id51100ed7d8237abbbb15778a259065b162a48ad
Reviewed-on: https://go-review.googlesource.com/c/158643
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
6 years agocmd/go: copy missing bit of documentation about code generated comment
Dmitri Shuralyov [Mon, 21 Jan 2019 18:50:22 +0000 (13:50 -0500)]
cmd/go: copy missing bit of documentation about code generated comment

This CL attempts to restore the clarity of the original specification
at https://golang.org/s/generatedcode that the line may appear
anywhere. It is preferable (for human readability), and most common
for it to be early in the file, but that is merely a convention, not
a strict well-specified requirement. Document it as so.

Background

Issue #13560 was a proposal define a standard for marking files as
generated, one that is suitable to be recognized both by humans
and machine tools. It was accepted, and the final specification
was documented at https://golang.org/s/generatedcode. Its text,
copied exactly:

Generated files are marked by a line of text that matches
the regular expression, in Go syntax:

^// Code generated .* DO NOT EDIT\.$

The .* means the tool can put whatever folderol it wants in there,
but the comment must be a single line and must start with Code generated
and end with DO NOT EDIT., with a period.

The text may appear anywhere in the file.

The https://golang.org/s/generatedcode link points to a comment
in a very large GitHub issue. That makes it harder to find.
Issue #25433 was opened about moving that information somewhere else.
It was resolved via CL 118756, which added text to cmd/go documentation
at https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source:

To convey to humans and machine tools that code is generated,
generated source should have a line early in the file that
matches the following regular expression (in Go syntax):

^// Code generated .* DO NOT EDIT\.$

The CL description noted that "This change merely moves that
information to a more visible place." The intention was to preserve
the specification unmodified.

The original specification was very clear that "The text may appear
anywhere in the file." The new text in cmd/go documentation wasn't
very clear. "A line early in the file" is not a precise enough criteria
to be recognized by a machine tool, because there isn't a precise
definition of what lines are "early in the file".

Updates #13560
Updates #25433
Updates #28089

Change-Id: I4e374163b16c3f972f9591ec2647fd3d5a2dd5ae
Reviewed-on: https://go-review.googlesource.com/c/158817
Reviewed-by: Rob Pike <r@golang.org>
6 years agodoc/go1.12.html: document rejection of mangled C names
Elias Naur [Mon, 21 Jan 2019 15:12:46 +0000 (16:12 +0100)]
doc/go1.12.html: document rejection of mangled C names

Change-Id: I27ef49815f55a36379b730b77f7e9a4dd5341507
Reviewed-on: https://go-review.googlesource.com/c/158777
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/cgo: remove duplicate entry from gofmtLineReplacer
Tobias Klauser [Sun, 20 Jan 2019 18:14:58 +0000 (19:14 +0100)]
cmd/cgo: remove duplicate entry from gofmtLineReplacer

CL 158457 added a duplicate entry for the ",\n" -> "," replacement to
gofmtLineReplacer. Remove the duplicate.

Change-Id: I17684fcd19cbc96fa7a7b53bf7c1a6382bf1114f
Reviewed-on: https://go-review.googlesource.com/c/158619
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoflag: improve docs for PrintDefaults; clarify how to change output destination
Aaron Cannon [Sat, 27 Oct 2018 16:21:00 +0000 (11:21 -0500)]
flag: improve docs for PrintDefaults; clarify how to change output destination

The existing docs only mention that it is possible to change the output
destination of PrintDefaults from the default of standard error, but fail to
mention how to actually do so. This change fixes this lack by directing users
to CommandLine.SetOutput.

Fixes #15024

Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3
Reviewed-on: https://go-review.googlesource.com/c/145203
Reviewed-by: Rob Pike <r@golang.org>
6 years agocrypto/tls: send a "handshake failure" alert if the RSA key is too small
Filippo Valsorda [Fri, 18 Jan 2019 22:33:49 +0000 (17:33 -0500)]
crypto/tls: send a "handshake failure" alert if the RSA key is too small

Fixes #29779

Change-Id: I7eb8b4db187597e07d8ec7d3ff651f008e2ca433
Reviewed-on: https://go-review.googlesource.com/c/158639
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/cgo: print the right error if mangling detection gccgo fails
Ian Lance Taylor [Sun, 20 Jan 2019 15:46:18 +0000 (07:46 -0800)]
cmd/cgo: print the right error if mangling detection gccgo fails

Change-Id: I2324f6f51d2bf8a4ae1b139b3933bc78dfa75835
Reviewed-on: https://go-review.googlesource.com/c/158718
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agodoc/go1.12: mention small RSA keys will cause some TLS handshakes to fail
Filippo Valsorda [Fri, 18 Jan 2019 22:32:30 +0000 (17:32 -0500)]
doc/go1.12: mention small RSA keys will cause some TLS handshakes to fail

Updates #29779

Change-Id: I9becaba41ab4cd0bac25b4bedf3f8b19761d8158
Reviewed-on: https://go-review.googlesource.com/c/158638
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocrypto/tls: expand Config.CipherSuites docs
Filippo Valsorda [Fri, 18 Jan 2019 22:31:45 +0000 (17:31 -0500)]
crypto/tls: expand Config.CipherSuites docs

Fixes #29349

Change-Id: Iec16eb2b20b43250249ec85c3d78fd64d1b6e3f3
Reviewed-on: https://go-review.googlesource.com/c/158637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/go1.12: mention heap sampling change
Hana (Hyang-Ah) Kim [Fri, 18 Jan 2019 19:45:25 +0000 (14:45 -0500)]
doc/go1.12: mention heap sampling change

This is about a minor change but worthy of note because this
may affect the profile results users will see.

Change-Id: Ie2c4358b248f868662dbc71db587576481aa7238
Reviewed-on: https://go-review.googlesource.com/c/158577
Reviewed-by: Raul Silvera <rauls5382@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoA+C: add author, rename contributor to a real name
tkivisik [Fri, 18 Jan 2019 20:45:41 +0000 (20:45 +0000)]
A+C: add author, rename contributor to a real name

Renamed from github user to use my real name in CONTRIBUTORS, added my name
to AUTHORS.

Change-Id: I671638f1525d44bcc2b0a08d0dcff6adb1717510
GitHub-Last-Rev: b989e185de9ad2d1207085043fcdc821d851c562
GitHub-Pull-Request: golang/go#29823
Reviewed-on: https://go-review.googlesource.com/c/158540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: sample large heap allocations correctly
Raul Silvera [Fri, 18 Jan 2019 00:14:29 +0000 (00:14 +0000)]
runtime: sample large heap allocations correctly

Remove an unnecessary check on the heap sampling code that forced sampling
of all heap allocations larger than the sampling rate. This need to follow
a poisson process so that they can be correctly unsampled. Maintain a check
for MemProfileRate==1 to provide a mechanism for full sampling, as
documented in https://golang.org/pkg/runtime/#pkg-variables.

Additional testing for this change is on cl/129117.

Fixes #26618

Change-Id: I7802bde2afc655cf42cffac34af9bafeb3361957
GitHub-Last-Rev: 471f747af845395d458096bea26daa93b91120be
GitHub-Pull-Request: golang/go#29791
Reviewed-on: https://go-review.googlesource.com/c/158337
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
6 years agocmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH
Ian Lance Taylor [Mon, 17 Dec 2018 00:06:13 +0000 (16:06 -0800)]
cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH

Fixes #29263

Change-Id: I06ba135dc491fd01fc06ccaad4ef98103d4b86c4
Reviewed-on: https://go-review.googlesource.com/c/154460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/cgo: don't replace newlines with semicolons in expressions
Ian Lance Taylor [Fri, 18 Jan 2019 02:35:43 +0000 (18:35 -0800)]
cmd/cgo: don't replace newlines with semicolons in expressions

Fixes #29781

Change-Id: Id032d07a54b8c24f0c6d3f6e512932f76920ee04
Reviewed-on: https://go-review.googlesource.com/c/158457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: clarify Transport connection reuse docs a bit
Brad Fitzpatrick [Thu, 17 Jan 2019 23:22:47 +0000 (15:22 -0800)]
net/http: clarify Transport connection reuse docs a bit

Updates #26095 (or fixes it)

Change-Id: I92488dabe823b82e1ba534648fe6d63d25d0ae9f
Reviewed-on: https://go-review.googlesource.com/c/158417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agomath/big: document that Rat.SetString accepts _decimal_ float representations
Robert Griesemer [Thu, 17 Jan 2019 22:49:30 +0000 (14:49 -0800)]
math/big: document that Rat.SetString accepts _decimal_ float representations

Updates #29799.

Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c
Reviewed-on: https://go-review.googlesource.com/c/158397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: don't coalesce scavenged spans with unscavenged spans
Michael Anthony Knyszek [Wed, 16 Jan 2019 00:15:34 +0000 (00:15 +0000)]
runtime: don't coalesce scavenged spans with unscavenged spans

As a result of changes earlier in Go 1.12, the scavenger became much
more aggressive. In particular, when scavenged and unscavenged spans
coalesced, they would always become scavenged. This resulted in most
spans becoming scavenged over time. While this is good for keeping the
RSS of the program low, it also causes many more undue page faults and
many more calls to madvise.

For most applications, the impact of this was negligible. But for
applications that repeatedly grow and shrink the heap by large amounts,
the overhead can be significant. The overhead was especially obvious on
older versions of Linux where MADV_FREE isn't available and
MADV_DONTNEED must be used.

This change makes it so that scavenged spans will never coalesce with
unscavenged spans. This  results in fewer page faults overall. Aside
from this, the expected impact of this change is more heap growths on
average, as span allocations will be less likely to be fulfilled. To
mitigate this slightly, this change also coalesces spans eagerly after
scavenging, to at least ensure that all scavenged spans and all
unscavenged spans are coalesced with each other.

Also, this change adds additional logic in the case where two adjacent
spans cannot coalesce. In this case, on platforms where the physical
page size is larger than the runtime's page size, we realign the
boundary between the two adjacent spans to a physical page boundary. The
advantage of this approach is that "unscavengable" spans, that is, spans
which cannot be scavenged because they don't cover at least a single
physical page are grown to a size where they have a higher likelihood of
being discovered by the runtime's scavenging mechanisms when they border
a scavenged span. This helps prevent the runtime from accruing pockets
of "unscavengable" memory in between scavenged spans, preventing them
from coalescing.

We specifically choose to apply this logic to all spans because it
simplifies the code, even though it isn't strictly necessary. The
expectation is that this change will result in a slight loss in
performance on platforms where the physical page size is larger than the
runtime page size.

Update #14045.

Change-Id: I64fd43eac1d6de6f51d7a2ecb72670f10bb12589
Reviewed-on: https://go-review.googlesource.com/c/158078
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: de-duplicate coalescing code
Michael Anthony Knyszek [Tue, 15 Jan 2019 23:48:57 +0000 (23:48 +0000)]
runtime: de-duplicate coalescing code

Currently the code surrounding coalescing is duplicated between merging
with the span before the span considered for coalescing and merging with
the span after. This change factors out the shared portions of these
codepaths into a local closure which acts as a helper.

Change-Id: I7919fbed3f9a833eafb324a21a4beaa81f2eaa91
Reviewed-on: https://go-review.googlesource.com/c/158077
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: refactor coalescing into its own method
Michael Anthony Knyszek [Mon, 14 Jan 2019 21:27:29 +0000 (21:27 +0000)]
runtime: refactor coalescing into its own method

The coalescing process is complex and in a follow-up change we'll need
to do it in more than one place, so this change factors out the
coalescing code in freeSpanLocked into a method on mheap.

Change-Id: Ia266b6cb1157c1b8d3d8a4287b42fbcc032bbf3a
Reviewed-on: https://go-review.googlesource.com/c/157838
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agodoc/go1.12: link to ABIInternal design document
Austin Clements [Thu, 17 Jan 2019 02:42:00 +0000 (21:42 -0500)]
doc/go1.12: link to ABIInternal design document

The ABI changes should be completely transparent to Go code, but could
cause linking issues in certain situations involving assembly code
reaching across package boundaries. If users encounter linking
problems, point them to the "Compatibility" section of the ABI design
document, which gives some guidance.

Change-Id: I4156d164562e2ec0de7ae8f9a3631a32ec45b317
Reviewed-on: https://go-review.googlesource.com/c/158237
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agotesting: report the failing test in a late log panic
Ian Lance Taylor [Fri, 11 Jan 2019 22:06:45 +0000 (14:06 -0800)]
testing: report the failing test in a late log panic

Updates #29388

Change-Id: Icb0e6048d05fde7a5486b923ff62147edb5c8dac
Reviewed-on: https://go-review.googlesource.com/c/157617
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
6 years agonet: increase TestNotTemporaryRead server sleep
Clément Chigot [Wed, 16 Jan 2019 08:03:57 +0000 (09:03 +0100)]
net: increase TestNotTemporaryRead server sleep

On aix/ppc64, if the server closes before the client calls Accept,
this test will fail.

Increasing the time before the server closes should resolve this
timeout.

Updates #29685

Change-Id: Iebb849d694fc9c37cf216ce1f0b8741249b98016
Reviewed-on: https://go-review.googlesource.com/c/158038
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go/internal/clean: fix clean -testcache does not clean test cache
Baokun Lee [Wed, 16 Jan 2019 10:53:35 +0000 (18:53 +0800)]
cmd/go/internal/clean: fix clean -testcache does not clean test cache

Truncate changes the size of the file. It does not change the I/O offset.

Fixes #29757

Change-Id: I1aa9223a86d6a8ce3c0efc3ac1d7d7647b77f589
Reviewed-on: https://go-review.googlesource.com/c/158117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agoencoding/json: add comment for mashalererror struct
GuilhermeCaruso [Tue, 15 Jan 2019 23:24:52 +0000 (23:24 +0000)]
encoding/json: add comment for mashalererror struct

Change-Id: Iaabbfe5a4c1bbedd19d4087f1b79e5a38bdd3878
GitHub-Last-Rev: 55c91fc19074dacc66623aa7ff2286b11ccd5340
GitHub-Pull-Request: golang/go#29752
Reviewed-on: https://go-review.googlesource.com/c/157958
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix wording issue in comment
Daniel Martí [Tue, 15 Jan 2019 18:29:15 +0000 (18:29 +0000)]
cmd/go: fix wording issue in comment

golang.org/cl/157097 modified this comment, but left a trailing comma.
While at it, make the sentence a bit clearer.

Change-Id: I376dda4fd18ddbcae4485dd660a79b9f66ad6da4
Reviewed-on: https://go-review.googlesource.com/c/158037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/cgo: don't replace newlines with semicolons in composite literals
Ian Lance Taylor [Tue, 15 Jan 2019 15:46:39 +0000 (07:46 -0800)]
cmd/cgo: don't replace newlines with semicolons in composite literals

Fixes #29748

Change-Id: I2b19165bdb3c99df5b79574390b5d5f6d40462dc
Reviewed-on: https://go-review.googlesource.com/c/157961
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/go: remove init() to fix precedence issue when setting debug mod info
Viacheslav Poturaev [Wed, 9 Jan 2019 12:54:50 +0000 (12:54 +0000)]
cmd/go: remove init() to fix precedence issue when setting debug mod info

Fixes #29628

Change-Id: I95dabed797ef7a1a770b6f4219840f653306af7e
GitHub-Last-Rev: 9275dd8f1c6a0cfa16ae882fcfc100991f8338f7
GitHub-Pull-Request: golang/go#29630
Reviewed-on: https://go-review.googlesource.com/c/157097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agopath/filepath: skip part of TestNTNamespaceSymlink
Alex Brainman [Tue, 15 Jan 2019 08:37:17 +0000 (19:37 +1100)]
path/filepath: skip part of TestNTNamespaceSymlink

Recent CL 156398 extended TestNTNamespaceSymlink. But new code
fails, if user running the test does not have sufficient privilege
to create file symlink. Skip part of TestNTNamespaceSymlink, if
user cannot create symlink.

Fixes #29745

Change-Id: Ie4176429ba9dd98553ce9e91fd19851cc7353f42
Reviewed-on: https://go-review.googlesource.com/c/157917
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
6 years agoruntime: keep FuncForPC from crashing for PCs between functions
Keith Randall [Mon, 14 Jan 2019 21:47:14 +0000 (13:47 -0800)]
runtime: keep FuncForPC from crashing for PCs between functions

Reuse the strict mechanism from FileLine for FuncForPC, so we don't
crash when asking the pcln table about bad pcs.

Fixes #29735

Change-Id: Iaffb32498b8586ecf4eae03823e8aecef841aa68
Reviewed-on: https://go-review.googlesource.com/c/157799
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomisc/sortac: delete sortac command
Dmitri Shuralyov [Thu, 10 Jan 2019 02:01:41 +0000 (21:01 -0500)]
misc/sortac: delete sortac command

The sortac command is no longer needed as of CL 157238, and
can be deleted. Its functionality has been directly integrated
into the new x/build/cmd/updatecontrib command. A previous version
of updatecontrib was the only user of sortac.

Updates #12042

Change-Id: If7442ebee11d05d095ff875a37eed3973c0fd9ca
Reviewed-on: https://go-review.googlesource.com/c/157257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: when merging instructions, prefer line number of faulting insn
Keith Randall [Tue, 8 Jan 2019 21:46:49 +0000 (13:46 -0800)]
cmd/compile: when merging instructions, prefer line number of faulting insn

Normally this happens when combining a sign extension and a load.  We
want the resulting combo-instruction to get the line number of the
load, not the line number of the sign extension.

For each rule, compute where we should get its line number by finding
a value on the match side that can fault.  Use that line number for
all the new values created on the right-hand side.

Fixes #27201

Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3
Reviewed-on: https://go-review.googlesource.com/c/156937
Reviewed-by: David Chase <drchase@google.com>