]> Cypherpunks repositories - gostls13.git/log
gostls13.git
8 years agonet: change "mask" to "prefix length" in ParseCIDR comment
Matt Layher [Wed, 14 Dec 2016 04:01:15 +0000 (23:01 -0500)]
net: change "mask" to "prefix length" in ParseCIDR comment

Fixes #18175

Change-Id: I0074109fa885976b22c2be9fa39641d4d0657dee
Reviewed-on: https://go-review.googlesource.com/34375
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet: document consecutive dialing in net.Dial
Kaviraj [Tue, 13 Dec 2016 12:19:28 +0000 (17:49 +0530)]
net: document consecutive dialing in net.Dial

document about the consecutive dialing introduced in Go 1.5.
If address is resolved to multiple addresses,
Dial will try each address in order until one succeeds.
Deadline is used to try each address (calculated based on
total number of resolved addresses)

Fixes: #17617
Change-Id: I56b6399edb640c8ef507675f98e0bd45a50d4e2d
Reviewed-on: https://go-review.googlesource.com/34176
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/link: improve -X doc wording
Ian Lance Taylor [Wed, 14 Dec 2016 00:57:05 +0000 (16:57 -0800)]
cmd/link: improve -X doc wording

Change-Id: I9329738ec5dd6c12f72eea7de413d66617b7b5c2
Reviewed-on: https://go-review.googlesource.com/34373
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/cgo: don't strip qualifiers from C void* pointer
Ian Lance Taylor [Tue, 13 Dec 2016 22:29:57 +0000 (14:29 -0800)]
cmd/cgo: don't strip qualifiers from C void* pointer

Now that we try to handle qualifiers correctly (as of CL 33325), don't
strip them from a void* pointer. Otherwise we break a case like "const
void**", as the "const" qualifier is dropped and the resulting
"void**" triggers a warning from the C compiler.

Fixes #18298.

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

8 years agocmd/link: explain how to find the name to use for -X
Ian Lance Taylor [Thu, 8 Dec 2016 23:57:48 +0000 (15:57 -0800)]
cmd/link: explain how to find the name to use for -X

Doc change only.

Fixes #18246.

Change-Id: I2c7b181bcec81e124d30702f6fac5aa43bb57c04
Reviewed-on: https://go-review.googlesource.com/34230
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/cgo: add required gcc flags for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 13 Dec 2016 21:03:18 +0000 (22:03 +0100)]
cmd/cgo: add required gcc flags for GOARCH=mips{,le}

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

8 years agomisc/cgo/test: skip test18146 on mips{,64}
Vladimir Stefanovic [Tue, 13 Dec 2016 18:49:41 +0000 (19:49 +0100)]
misc/cgo/test: skip test18146 on mips{,64}

Change-Id: I724f4443fc10a6ee0d027a9533f07aba39455cfa
Reviewed-on: https://go-review.googlesource.com/34312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotest/bench/go1: reduce fasta data size for mips{,64}
Vladimir Stefanovic [Tue, 13 Dec 2016 18:29:34 +0000 (19:29 +0100)]
test/bench/go1: reduce fasta data size for mips{,64}

Change-Id: I15887ee454acfdb36334dd9f0b59cc520b2b0286
Reviewed-on: https://go-review.googlesource.com/34311
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go: fix go get -t -u path/... containing vendor directories
Russ Cox [Tue, 13 Dec 2016 03:10:45 +0000 (22:10 -0500)]
cmd/go: fix go get -t -u path/... containing vendor directories

A lot of things had to line up to make this break,
but the caching of download results interacted badly
with vendor directories, "go get -t -u", and wildcard
expansion.

Fixes #18219.

Change-Id: I2676498d2f714eaeb69f399e9ed527640c12e60d
Reviewed-on: https://go-review.googlesource.com/34201
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: debug/pe.Section is not new, Section.Relocs field is
Alex Brainman [Mon, 5 Dec 2016 00:10:58 +0000 (11:10 +1100)]
doc: debug/pe.Section is not new, Section.Relocs field is

Change-Id: Ie50d68f87670de6c199016ebdc740c11ee636e9a
Reviewed-on: https://go-review.googlesource.com/33931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoos: must fixup path when 248 bytes long
Daniel Theophanes [Sun, 11 Dec 2016 16:14:38 +0000 (08:14 -0800)]
os: must fixup path when 248 bytes long

Fixes #18283

Change-Id: Ic044d2d0657579e8e7786d7264fda2037ddc5ffb
Reviewed-on: https://go-review.googlesource.com/34280
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/vet: fix panic and handling of XML in struct field tag check
Tilman Dilo [Mon, 5 Dec 2016 22:32:08 +0000 (23:32 +0100)]
cmd/vet: fix panic and handling of XML in struct field tag check

The check for duplicate struct field tags introduced in CL 16704
triggers a panic when an anonymous struct field with a duplicate name
is encountered. For such a field, the names slice of the ast.Field is
nil but accessed regardless to generate the warning message.

Additionally, the check produces false positives for XML tags in some
cases:

- When fields are encoded as XML attributes, a warning is produced when
  an attribute reuses a name previously used for an element.

  Example:
    type Foo struct {
        First int `xml:"a"`
        NoDup int `xml:"a,attr"` // warning about reuse of "a"
    }

- When XMLName is used to set the name of the enclosing struct element,
  it is treated as a regular struct field.

  Example:
    type Bar struct {
        XMLName xml.Name `xml:"a"`
        NoDup   int      `xml:"a"` // warning about reuse of "a"
    }

This commit addresses all three issues. The panic is avoided by using
the type name instead of the field name for anonymous struct fields when
generating the warning message. An additional namespace for checking XML
attribute names separately from element names is introduced. Lastly,
fields named XMLName are excluded from the check for duplicate tags.

Updates #18256

Change-Id: Ida48ea8584b56bd4d12ae3ebd588a66ced2594cc
Reviewed-on: https://go-review.googlesource.com/34070
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agoos/exec: fix race in TestStdinCloseRace
Ian Lance Taylor [Tue, 13 Dec 2016 00:53:12 +0000 (16:53 -0800)]
os/exec: fix race in TestStdinCloseRace

The test for the race detector itself had a race of a sort not
detected by the race detector.

Fixes #18286.

Change-Id: I3265eae275aaa2869a6b6d3e8675b0d88b25831b
Reviewed-on: https://go-review.googlesource.com/34287
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: update some comments
Brad Fitzpatrick [Tue, 13 Dec 2016 00:12:19 +0000 (00:12 +0000)]
net/http: update some comments

And move some code to make control flow more obvious.
No functional change.

Change-Id: Iefaa96f664070ab2accade1857e1946e56df6902
Reviewed-on: https://go-review.googlesource.com/34285
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoA+C: automated update
Brad Fitzpatrick [Tue, 13 Dec 2016 00:18:52 +0000 (00:18 +0000)]
A+C: automated update

Add Alexander Menzhinsky (individual CLA)
Add Anthony Woods (individual CLA)
Add Chris Stockton (individual CLA)
Add David Lazar (corporate CLA for Google Inc.)
Add Elliot Morrison-Reed (individual CLA)
Add Igor Bernstein (corporate CLA for Google Inc.)
Add Jesse Szwedko (individual CLA)
Add Jordan Lewis (individual CLA)
Add Kaviraj Kanagaraj (individual CLA)
Add Keegan Carruthers-Smith (individual CLA)
Add Marcel Edmund Franke (individual CLA)
Add Marin Bašić (individual CLA)
Add Martin Kreichgauer (corporate CLA for Google Inc.)
Add Max Riveiro (individual CLA)
Add Odin Ugedal (individual CLA)
Add Patrick Lee (individual CLA)
Add Rebecca Stambler (corporate CLA for Google Inc.)
Add Ryuzo Yamamoto (individual CLA)
Add Takuya Ueda (individual CLA)
Add Thordur Bjornsson (individual CLA)
Add Zac Bergquist (individual CLA)

Updates #12042

Change-Id: Idb5ffe526b26437eb7612f0b60bde62162af5abb
Reviewed-on: https://go-review.googlesource.com/34286
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: don't assemble all .s files in a single cmd/asm run
Ian Lance Taylor [Mon, 12 Dec 2016 22:37:40 +0000 (14:37 -0800)]
cmd/go: don't assemble all .s files in a single cmd/asm run

For the 1.8 release, go back to invoking the assembler once per .s
file, to avoid the problem in #18225. When the assembler is fixed, the
change to cmd/go/build.go can be rolled back, but the test in
cmd/go/go_test.go should remain.

Fixes #18225.
Update #15680.

Change-Id: Ibff8d0c638536efb50a2b2c280b41399332f4fe4
Reviewed-on: https://go-review.googlesource.com/34284
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj/mips: replace MOVD with MOVF on 32-bit to avoid unaligned memory...
Shenghou Ma [Fri, 9 Dec 2016 05:13:43 +0000 (00:13 -0500)]
cmd/internal/obj/mips: replace MOVD with MOVF on 32-bit to avoid unaligned memory access

This is the simplest CL that I can make for Go 1.8. For Go 1.9, we can revisit it
and optimize the redundant address generation instructions or just fix #599 instead.

Fixes #18140.

Change-Id: Ie4804ab0e00dc6bb318da2bece8035c7c71caac3
Reviewed-on: https://go-review.googlesource.com/34193
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agotime: parse WITA timezone correctly
Max Riveiro [Sun, 11 Dec 2016 10:54:22 +0000 (13:54 +0300)]
time: parse WITA timezone correctly

WITA stands for Asia/Makassar IANA timezone
https://en.wikipedia.org/wiki/Asia/Makassar

Fixes #18251

Change-Id: I5896efb8052593afb4e51ae4a34b574a8206d4dc
Reviewed-on: https://go-review.googlesource.com/34253
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: don't crash if signal delivered on g0 stack
Ian Lance Taylor [Fri, 9 Dec 2016 01:39:00 +0000 (17:39 -0800)]
runtime: don't crash if signal delivered on g0 stack

Also, if we changed the gsignal stack to match the stack we are
executing on, restore it when returning from the signal handler, for
safety.

Fixes #18255.

Change-Id: Ic289b36e4e38a56f8a6d4b5d74f68121c242e81a
Reviewed-on: https://go-review.googlesource.com/34239
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agodoc: remove Reddit as an official space where Code of Conduct applies
Brad Fitzpatrick [Mon, 12 Dec 2016 17:35:25 +0000 (17:35 +0000)]
doc: remove Reddit as an official space where Code of Conduct applies

Fixes #18289

Change-Id: I047e98cc36b861ef15292170aeaff8bc29243cab
Reviewed-on: https://go-review.googlesource.com/34281
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodoc: mention Go requires OpenBSD 5.9 or above in go1.8.html
Shenghou Ma [Wed, 7 Dec 2016 23:42:37 +0000 (18:42 -0500)]
doc: mention Go requires OpenBSD 5.9 or above in go1.8.html

Change-Id: Ia19e4d2f319002b5b26e50258436f5c4bd281cc7
Reviewed-on: https://go-review.googlesource.com/34113
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime, syscall: update openbsd for changes to syskill
Joel Sing [Wed, 7 Dec 2016 13:22:09 +0000 (00:22 +1100)]
runtime, syscall: update openbsd for changes to syskill

Change the openbsd runtime to use the current sys_kill and sys_thrkill
system calls.

Prior to OpenBSD 5.9 the sys_kill system call could be used with both
processes and threads. In OpenBSD 5.9 this functionality was split into
a sys_kill system call for processes (with a new syscall number) and a
sys_thrkill system call for threads. The original/legacy system call was
retained in OpenBSD 5.9 and OpenBSD 6.0, however has been removed and
will not exist in the upcoming OpenBSD 6.1 release.

Note: This change is needed to make Go work on OpenBSD 6.1 (to be
released in May 2017) and should be included in the Go 1.8 release.
This change also drops support for OpenBSD 5.8, which is already an
unsupported OpenBSD release.

Change-Id: I525ed9b57c66c0c6f438dfa32feb29c7eefc72b0
Reviewed-on: https://go-review.googlesource.com/34093
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agofmt: undo clearflags in catchPanic after error message has been printed
Martin Möhrmann [Sun, 11 Dec 2016 11:55:17 +0000 (12:55 +0100)]
fmt: undo clearflags in catchPanic after error message has been printed

Fixes #18282

Change-Id: I024ca4a03bbbcccd48a0a6245bc3ec22c6a90288
Reviewed-on: https://go-review.googlesource.com/34254
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/link: limit darwin dynlink symbol exports
David Crawshaw [Fri, 9 Dec 2016 17:38:34 +0000 (12:38 -0500)]
cmd/link: limit darwin dynlink symbol exports

The pclntable contains pointers to functions. If the function symbol
is exported in a plugin, and there is a matching symbol in the host
binary, then the pclntable of a plugin ends up pointing at the
function in the host module.

This doesn't work because the traceback code expects the pointer to
be in the same module space as the PC value.

So don't export functions that might overlap with the host binary.
This way the pointer stays in its module.

Updates #18190

Change-Id: Ifb77605b35fb0a1e7edeecfd22b1e335ed4bb392
Reviewed-on: https://go-review.googlesource.com/34196
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/x509: marshal certificate revocation times in UTC (Zulu time).
Martin Kreichgauer [Fri, 9 Dec 2016 19:29:52 +0000 (11:29 -0800)]
crypto/x509: marshal certificate revocation times in UTC (Zulu time).

This is required by RFC 5280.

Fixes #16686

Change-Id: I291c68dd97410a4f7ae7c4e524b91a2493ac50a9
Reviewed-on: https://go-review.googlesource.com/34245
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoio: update documentation on LimitedReader
Joe Tsai [Fri, 9 Dec 2016 21:11:48 +0000 (13:11 -0800)]
io: update documentation on LimitedReader

Specify that that LimitedReader returns EOF when the underlying
R returns EOF even if bytes remaining, N > 0.

Fixes #18271

Change-Id: I990a7135f1d31488d535238ae061d42ee96bacb7
Reviewed-on: https://go-review.googlesource.com/34249
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodatabase/sql: use complete sentences in new docs
Brad Fitzpatrick [Fri, 9 Dec 2016 19:58:11 +0000 (19:58 +0000)]
database/sql: use complete sentences in new docs

Change-Id: Icb842a80cab2b07b9ace1e8e14c4a19c48a92c43
Reviewed-on: https://go-review.googlesource.com/34247
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
8 years agodoc: update go1.8.html
Joe Tsai [Fri, 9 Dec 2016 07:21:48 +0000 (23:21 -0800)]
doc: update go1.8.html

Made many minor changes so that the document is consistent with itself.

Some more noticeable changes:
* CL/34141: Revert "testing: add T.Context method"
* CL/33630: net/http: document restrictions on ETag as expected by ServeContent

Change-Id: I39ae5e55c56e374895c115e6852998c940beae35
Reviewed-on: https://go-review.googlesource.com/34243
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime/pprof: track locations for goroutine profiles
Raul Silvera [Wed, 7 Dec 2016 23:36:22 +0000 (15:36 -0800)]
runtime/pprof: track locations for goroutine profiles

Must add locations to the profile when generating a profile.proto.
This fixes #18229

Change-Id: I49cd63a30759d3fe8960d7b7c8bd5a554907f8d1
Reviewed-on: https://go-review.googlesource.com/34028
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoapi: remove testing Context accessors from go1.8.txt
Brad Fitzpatrick [Fri, 9 Dec 2016 06:43:24 +0000 (06:43 +0000)]
api: remove testing Context accessors from go1.8.txt

Fixes the build.

Updates #18199

Change-Id: Ibf029ba9f9293d1f3d49c1c8773fc262159a5d5b
Reviewed-on: https://go-review.googlesource.com/34242
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agogo/build: clarify Context.HasSubdir docs
Brad Fitzpatrick [Fri, 9 Dec 2016 04:08:32 +0000 (04:08 +0000)]
go/build: clarify Context.HasSubdir docs

Fixes #17888

Change-Id: I7490b95a03b810a0f7ed1f07f37d7c7b3ac036be
Reviewed-on: https://go-review.googlesource.com/34240
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
8 years agodoc/go1.8: mention trace tool changes
Austin Clements [Thu, 8 Dec 2016 20:38:14 +0000 (15:38 -0500)]
doc/go1.8: mention trace tool changes

Fixes #18234.

Change-Id: I0f18992ea14e13f283873ac295f0b49d6b7dd8b2
Reviewed-on: https://go-review.googlesource.com/34191
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
8 years agoRevert "testing: add T.Context method"
Joe Tsai [Thu, 8 Dec 2016 07:13:50 +0000 (07:13 +0000)]
Revert "testing: add T.Context method"

This reverts commit 26827bc2fe4c80dc68b3793631d24975425c9467.

Fixes #18199

Change-Id: I42e292cb4e3d740a4fbb5d0380c6ee15ac742092
Reviewed-on: https://go-review.googlesource.com/34141
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodatabase/sql: document that drivers may not return right after cancel
Daniel Theophanes [Thu, 8 Dec 2016 21:07:35 +0000 (13:07 -0800)]
database/sql: document that drivers may not return right after cancel

Fixes #18168

Change-Id: Idbfe3d4daedd93c7caf6f1770ecd988e9af39949
Reviewed-on: https://go-review.googlesource.com/34144
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: add http.NoBody and Transport change to go1.8.html
Brad Fitzpatrick [Thu, 8 Dec 2016 23:49:54 +0000 (23:49 +0000)]
doc: add http.NoBody and Transport change to go1.8.html

Fixes #18257

Change-Id: Iafba5aa0a0641cfe36351bb0e4b57f20257fdc4e
Reviewed-on: https://go-review.googlesource.com/34210
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile/internal/obj: remove superfluous addvarint parameter and assignment
Robert Griesemer [Thu, 8 Dec 2016 06:09:15 +0000 (22:09 -0800)]
cmd/compile/internal/obj: remove superfluous addvarint parameter and assignment

Change-Id: I395625dca9b719290c52d2c46f60b53e8fb3abc4
Reviewed-on: https://go-review.googlesource.com/34139
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoall: make spelling consistent
Brad Fitzpatrick [Thu, 8 Dec 2016 22:15:40 +0000 (22:15 +0000)]
all: make spelling consistent

Fixes #17938

Change-Id: Iad12155f4976846bd4a9a53869f89e40e5b3deb3
Reviewed-on: https://go-review.googlesource.com/34147
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
8 years agodoc: remove pprof TODOs from go1.8.html
Brad Fitzpatrick [Thu, 8 Dec 2016 21:19:18 +0000 (21:19 +0000)]
doc: remove pprof TODOs from go1.8.html

There is nothing notable to mention as far as users are concerned.

Fixes #17929 (another bug tracks the remaining TODO item)

Change-Id: Id39f787581ed9d2ecd493126bb7ca27836816d4b
Reviewed-on: https://go-review.googlesource.com/34145
Reviewed-by: Michael Matloob <matloob@golang.org>
8 years agonet/http: don't retry Transport requests if they have a body
Brad Fitzpatrick [Thu, 8 Dec 2016 01:07:10 +0000 (01:07 +0000)]
net/http: don't retry Transport requests if they have a body

This rolls back https://golang.org/cl/27117 partly, softening it so it
only retries POST/PUT/DELETE etc requests where there's no Body (nil
or NoBody). This is a little useless, since most idempotent requests
have a body (except maybe DELETE), but it's late in the Go 1.8 release
cycle and I want to do the proper fix.

The proper fix will look like what we did for http2 and only retrying
the request if Request.GetBody is defined, and then creating a new request
for the next attempt. See https://golang.org/cl/33971 for the http2 fix.

Updates #15723
Fixes #18239
Updates #18241

Change-Id: I6ebaa1fd9b19b5ccb23c8d9e7b3b236e71cf57f3
Reviewed-on: https://go-review.googlesource.com/34134
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
8 years agocmd/link: do not mark go.plugin.tabs as reachable in non-plugins
Michael Hudson-Doyle [Thu, 8 Dec 2016 19:49:23 +0000 (08:49 +1300)]
cmd/link: do not mark go.plugin.tabs as reachable in non-plugins

Fixes #18250

Change-Id: I4f61591356ddb4a906c206ad8456d1839daf7b91
Reviewed-on: https://go-review.googlesource.com/34170
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agoio: fix MultiReader panic on nil reader.
Joe Tsai [Thu, 8 Dec 2016 06:25:41 +0000 (22:25 -0800)]
io: fix MultiReader panic on nil reader.

The combination of two prior CLs can cause panics:
* CL/17873: make chained multiReader Read more efficient
* CL/28533: make MultiReader nil exhausted Readers for earlier GC

The first CL allows MultiReader to "inherit" another MultiReader's list of Readers
for efficiency reasons. This is problematic when combined with the
later CL since that can set prior Readers in that list to nil for GC reasons.
This causes panics when two MultiReaders are used together (even synchronously).

To fix this, rather than setting consumed Readers as nil, we set them with
a special eofReader that always returns EOF.

Fixes #18232

Change-Id: I2a9357ab217e3d54d38ea9022d18e4d14f4182d3
Reviewed-on: https://go-review.googlesource.com/34140
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoos: document that Rename does not replace an existing directory
Ian Lance Taylor [Thu, 8 Dec 2016 01:13:35 +0000 (17:13 -0800)]
os: document that Rename does not replace an existing directory

Fixes #18240.

Change-Id: Ife951e2c1320b3f1362c85642615b24fd4291189
Reviewed-on: https://go-review.googlesource.com/34135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: misc go1.8.html fixes
Brad Fitzpatrick [Wed, 7 Dec 2016 21:41:48 +0000 (21:41 +0000)]
doc: misc go1.8.html fixes

Change-Id: I929f66b713525f5273cf0fe09579835603279b58
Reviewed-on: https://go-review.googlesource.com/34023
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agotest: add bug501.go, a gccgo compiler crash
Ian Lance Taylor [Wed, 7 Dec 2016 19:06:34 +0000 (11:06 -0800)]
test: add bug501.go, a gccgo compiler crash

Change-Id: I271707dee03fd97cd37bfb116eb00a5532034b57
Reviewed-on: https://go-review.googlesource.com/34020
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: add number of forced GCs to MemStats
Austin Clements [Tue, 6 Dec 2016 22:42:42 +0000 (17:42 -0500)]
runtime: add number of forced GCs to MemStats

This adds a counter for the number of times the application forced a
GC by, e.g., calling runtime.GC(). This is useful for detecting
applications that are overusing/abusing runtime.GC() or
debug.FreeOSMemory().

Fixes #18217.

Change-Id: I990ab7a313c1b3b7a50a3d44535c460d7c54f47d
Reviewed-on: https://go-review.googlesource.com/34067
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/internal/obj: regenerate relocation strings
David Crawshaw [Wed, 7 Dec 2016 17:23:13 +0000 (12:23 -0500)]
cmd/internal/obj: regenerate relocation strings

Change-Id: Ib9ba8f0b8785f1b0ddb29214beb8674dc06f7422
Reviewed-on: https://go-review.googlesource.com/34111
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/link: fix sym sect when splitting text on ppc64le
Lynn Boger [Wed, 7 Dec 2016 13:55:21 +0000 (07:55 -0600)]
cmd/link: fix sym sect when splitting text on ppc64le

While processing a symbol for a function, if it is determined
that a function would make the text section too large then
a new text section is created and the address of the function
is in the new text section.  But the symbol for the function
is marked as being in the previous text section, causing
incorrect codegen for the function and leading to a segv if
that function is called.  This adds code to set the sym.Sect
field to the new section if a new one is created.  Note that
this problem only happens at the point where a new section is
created.

Fixes #18218

Change-Id: Ic21ae11368d9d88ff6d5d3977f9ea72fe6477ed1
Reviewed-on: https://go-review.googlesource.com/34069
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/x509: reduce test's sought number of system certs
Brad Fitzpatrick [Wed, 7 Dec 2016 16:18:51 +0000 (16:18 +0000)]
crypto/x509: reduce test's sought number of system certs

150 is too high for some people.

Reports of 132, 145, 149 on OS X.

Fixes #18203

Change-Id: I559639aba7e87e07d1a1249f8b212b3f34a078ab
Reviewed-on: https://go-review.googlesource.com/34019
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: on stack copy, adjust BP
Keith Randall [Fri, 2 Dec 2016 23:17:52 +0000 (15:17 -0800)]
runtime: on stack copy, adjust BP

When we copy the stack, we need to adjust all BPs.
We correctly adjust the ones on the stack, but we also
need to adjust the one that is in g.sched.bp.

Like CL 33754, no test as only kernel-gathered profiles will notice.
Tests will come (in 1.9) with the implementation of #16638.

The invariant should hold that every frame pointer points to
somewhere within its stack.  After this CL, it is mostly true, but
something about cgo breaks it.  The runtime checks are disabled
until I figure that out.

Update #16638
Fixes #18174

Change-Id: I6023ee64adc80574ee3e76491d4f0fa5ede3dbdb
Reviewed-on: https://go-review.googlesource.com/33895
Reviewed-by: Austin Clements <austin@google.com>
8 years agofmt: remove unnecessary else statement
Odin Ugedal [Wed, 7 Dec 2016 08:54:42 +0000 (09:54 +0100)]
fmt: remove unnecessary else statement

Change-Id: If30ccfcf56d56fb40102ad567a980793bd39f320
Reviewed-on: https://go-review.googlesource.com/34071
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocrypto/*: document use or non-use of constant-time algorithms
Russ Cox [Thu, 20 Oct 2016 18:29:58 +0000 (14:29 -0400)]
crypto/*: document use or non-use of constant-time algorithms

Fixes #16821.

Change-Id: I63d5f3d7cfba1c76259912d754025c5f3cbe4a56
Reviewed-on: https://go-review.googlesource.com/31573
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocrypto/dsa: don't allow signing with degenerate private keys to loop forever.
Adam Langley [Wed, 30 Nov 2016 16:30:31 +0000 (08:30 -0800)]
crypto/dsa: don't allow signing with degenerate private keys to loop forever.

Previously it was possible to craft a DSA private key that would cause
Sign() to loop forever because no signature could be valid. This change
does some basic sanity checks and ensures that Sign will always
terminate.

Thanks to Yolan Romailler for highing this.

Be aware, however, that it's still possible for an attacker to simply
craft a private key with enormous values and thus cause Sign to take an
arbitrary amount of time.

Change-Id: Icd53939e511eef513a4977305dd9015d9436d0ce
Reviewed-on: https://go-review.googlesource.com/33725
Reviewed-by: Yolan Romailler <y@romailler.ch>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agonet: use baked-in port numbers as fallback if cgo port lookup fails
Brad Fitzpatrick [Tue, 6 Dec 2016 22:05:41 +0000 (22:05 +0000)]
net: use baked-in port numbers as fallback if cgo port lookup fails

Fixes TestLookupPort_Minimal on android.

Fixes #18213

Change-Id: I1b65e790525d339a4cb7f17afe7e3a02c4587302
Reviewed-on: https://go-review.googlesource.com/34014
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agomisc/cgo/test: skip test18146 on Darwin
Ian Lance Taylor [Wed, 7 Dec 2016 04:18:26 +0000 (20:18 -0800)]
misc/cgo/test: skip test18146 on Darwin

It is reported as failing for two people (issues #18202 and #18212).
The failure mode is that the system gets overloaded and other programs
fail to run.

Fixes #18202.

Change-Id: I1f1ca1f5d8eed6cc3a9dffac3289851e09fa662b
Reviewed-on: https://go-review.googlesource.com/34017
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go: ensure streaming test's stdout, stderr are same as cmd/go's
Brad Fitzpatrick [Tue, 6 Dec 2016 18:22:42 +0000 (18:22 +0000)]
cmd/go: ensure streaming test's stdout, stderr are same as cmd/go's

Fixes #18153

Change-Id: Ie8a32dd6fe306f00e51cde77dd4ea353f7109940
Reviewed-on: https://go-review.googlesource.com/34010
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: mention more binary download architectures
Brad Fitzpatrick [Tue, 6 Dec 2016 22:15:12 +0000 (22:15 +0000)]
doc: mention more binary download architectures

Fixes #18207

Change-Id: Ibe85ab0acba7553b93603a31140b31bd9e4802cf
Reviewed-on: https://go-review.googlesource.com/34015
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: mention concurrent map write/iterate detector
Keith Randall [Thu, 1 Dec 2016 16:37:48 +0000 (08:37 -0800)]
doc: mention concurrent map write/iterate detector

Mention that the best-effort race detector on maps
was upgraded to detect write/iterate races.

Fixes #18137

Change-Id: Ib6e0adde47e965126771ea712386031a2a55eba3
Reviewed-on: https://go-review.googlesource.com/33768
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoreflect: add example for StructOf
Sebastien Binet [Tue, 6 Dec 2016 09:40:31 +0000 (10:40 +0100)]
reflect: add example for StructOf

This CL adds a simple example for StructOf.
The example shows how StructOf can be used in a JSON roundtrip.

Change-Id: I9ff1ea9cb8c0cf297c5fae74e68b89931076adfd
Reviewed-on: https://go-review.googlesource.com/33953
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agonet/http: update bundled http2
Brad Fitzpatrick [Tue, 6 Dec 2016 18:42:01 +0000 (18:42 +0000)]
net/http: update bundled http2

Updates bundled x/net/http2 to git rev 8dab9293 for:

    http2: make Transport retry on server's GOAWAY graceful shutdown
    https://golang.org/cl/33971

Fixes #18083

Change-Id: I676f5eb4b490a4d86356778bb17296c451f16d90
Reviewed-on: https://go-review.googlesource.com/34011
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
8 years agocmd/link: hash packages after loading all symbols
David Crawshaw [Tue, 6 Dec 2016 04:20:20 +0000 (23:20 -0500)]
cmd/link: hash packages after loading all symbols

Conditioning on the plugin.Open symbol existing before loading all
symbols means sometimes some packages don't have a hash value.

Fixes #17928

Change-Id: I2722449aa58eca08a25117d3ce976f11f805b5ac
Reviewed-on: https://go-review.googlesource.com/33925
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.8: remove mention of #16396
Shenghou Ma [Tue, 6 Dec 2016 04:47:54 +0000 (23:47 -0500)]
doc/go1.8: remove mention of #16396

Change-Id: I811e76c9f42505e974bea634d4ded2499e4893db
Reviewed-on: https://go-review.googlesource.com/33926
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: fix static-initialization compilation failure
Matthew Dempsky [Mon, 5 Dec 2016 23:57:45 +0000 (15:57 -0800)]
cmd/compile: fix static-initialization compilation failure

Fixes #13263.

Change-Id: Ie1cafc62b6bfe6c5381c35d9a95563267b4cc9b0
Reviewed-on: https://go-review.googlesource.com/33970
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: document the mips port in install-source.html
Shenghou Ma [Fri, 2 Dec 2016 04:12:18 +0000 (23:12 -0500)]
doc: document the mips port in install-source.html

While we're at it, also mention OpenBSD/ARM support.

Change-Id: I4df4a158b67d11720146d05a235099d452295170
Reviewed-on: https://go-review.googlesource.com/33854
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agomisc/cgo/test: ignore "too many open files" in issue 18146 test
Ian Lance Taylor [Mon, 5 Dec 2016 22:10:46 +0000 (14:10 -0800)]
misc/cgo/test: ignore "too many open files" in issue 18146 test

Seen on the OpenBSD/AMD64 builder:
https://build.golang.org/log/fa34df1bcd3af12d4fc0fb0e60e3c6197a2a6f75

Update #18146.

Change-Id: I2646621488be84d50f47c312baa0817c72e3c058
Reviewed-on: https://go-review.googlesource.com/33907
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: fix typo in Request.GetBody's doc string
Chris Broadfoot [Tue, 6 Dec 2016 01:28:51 +0000 (17:28 -0800)]
net/http: fix typo in Request.GetBody's doc string

Change-Id: I84043b6fe4b20a2514d47217e07e44f26bec52ab
Reviewed-on: https://go-review.googlesource.com/33973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime/cgo: retry pthread_create on EAGAIN for OpenBSD
Ian Lance Taylor [Mon, 5 Dec 2016 19:17:59 +0000 (11:17 -0800)]
runtime/cgo: retry pthread_create on EAGAIN for OpenBSD

For reasons that I do not know, OpenBSD does not call pthread_create
directly, but instead looks it up in libpthread.so. That means that we
can't use the code used on other systems to retry pthread_create on
EAGAIN, since that code simply calls pthread_create.

This patch copies that code to an OpenBSD-specific version.

Also, check for an EAGAIN failure in the test, as that seems to be the
underlying cause of the test failure on several systems including OpenBSD.

Fixes #18146.

Change-Id: I3bceaa1e03a7eaebc2da19c9cc146b25b59243ef
Reviewed-on: https://go-review.googlesource.com/33905
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agomisc/cgo/test: skip Test18146 on DragonFly
Ian Lance Taylor [Mon, 5 Dec 2016 19:23:38 +0000 (11:23 -0800)]
misc/cgo/test: skip Test18146 on DragonFly

Fails on builder for unknown reasons.

Fixes #18198.
Update #18146.

Change-Id: Iaa85826655eee57d86e0c73d06c930ef3f4647ec
Reviewed-on: https://go-review.googlesource.com/33906
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc/go1.8: document mips port requirements
Shenghou Ma [Fri, 2 Dec 2016 04:07:53 +0000 (23:07 -0500)]
doc/go1.8: document mips port requirements

Fixes #18140.

Change-Id: I527719576bc7198c79bb8bc51d258a71b2d5b296
Reviewed-on: https://go-review.googlesource.com/33853
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime/cgo: retry pthread_create on EAGAIN
Ian Lance Taylor [Fri, 2 Dec 2016 23:32:55 +0000 (15:32 -0800)]
runtime/cgo: retry pthread_create on EAGAIN

Update #18146.

Change-Id: Ib447aabae9f203a8b61fb8c984b57d8e2bfe69c2
Reviewed-on: https://go-review.googlesource.com/33894
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: don't skip TestCgoCallbackGC on FreeBSD
Ian Lance Taylor [Mon, 5 Dec 2016 18:00:38 +0000 (10:00 -0800)]
runtime: don't skip TestCgoCallbackGC on FreeBSD

Seems to be fixed according to discussion on issue 16396.

Fixes #16396.

Change-Id: Ibac7037a24280204e48cb4d3000af524f65afd36
Reviewed-on: https://go-review.googlesource.com/33903
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: check that Version does not contain \r \n
Russ Cox [Mon, 5 Dec 2016 16:11:47 +0000 (11:11 -0500)]
runtime: check that Version does not contain \r \n

Change-Id: I8982cfa7337ec457b5235a207ebfda00ef6a2e5a
Reviewed-on: https://go-review.googlesource.com/33917
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: find last StoreWB explicitly
Cherry Zhang [Sun, 4 Dec 2016 00:17:16 +0000 (19:17 -0500)]
cmd/compile: find last StoreWB explicitly

In writebarrier phase, a chain of StoreWBs is rewritten to branchy
code to invoke write barriers, and the last store in the chain is
spliced into a Phi op to join the memory of the two branches. We
must find the last store explicitly, since the values are not
scheduled and they may not come in dependency order.

Fixes #18169.

Change-Id: If547e3c562ef0669bc5622c1bb711904dc36314d
Reviewed-on: https://go-review.googlesource.com/33915
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/go: give useful error when msan isn't supported
Dhananjay Nakrani [Sat, 3 Dec 2016 05:17:29 +0000 (21:17 -0800)]
cmd/go: give useful error when msan isn't supported

Fixes #18180.

Change-Id: I7006fe6cf08139e5aaaf35412b962a4e82109f59
Reviewed-on: https://go-review.googlesource.com/33898
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agohtml/template: lock in application/json as valid JS test
Emmanuel Odeke [Sun, 4 Dec 2016 02:45:50 +0000 (18:45 -0800)]
html/template: lock in application/json as valid JS test

CL https://go-review.googlesource.com/33899 added
application/json as a mimeType for valid JS. Let's
lock that fix in with a test.

Updates #18159

Change-Id: Ic4dfd8929aebfc5410f796688f081ca06630f672
Reviewed-on: https://go-review.googlesource.com/33901
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Nodir Turakulov <nodir@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agohtml/template: escape JS in application/json script tag
Nodir Turakulov [Sat, 3 Dec 2016 19:37:05 +0000 (11:37 -0800)]
html/template: escape JS in application/json script tag

Since ffd1c781b77aab542713b66ef387fa9307e4060b HTML templates check
MIME type in the "type" attribute of "script" tag to decide if contents
should be escaped as JavaScript. The whitelist of MIME types did not
include application/json. Include it in this CL.

Fixes #18159

Change-Id: I17a8a38f2b7789b4b7e941d14279de222eaf2b6a
Reviewed-on: https://go-review.googlesource.com/33899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/dist: remove special test timeout scale for Windows
Brad Fitzpatrick [Fri, 2 Dec 2016 23:30:09 +0000 (23:30 +0000)]
cmd/dist: remove special test timeout scale for Windows

In https://golang.org/cl/33804 I screwed up a GOOS == "windows"
check into a bogus comparison against GOARCH == "windows".

But turns out the builders are happy anyway, so remove the windows
special case.

Change-Id: I820b1d49d5b3e8cbffe4516fc39f514326dc39f8
Reviewed-on: https://go-review.googlesource.com/33893
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: skip GDB tests on mips64
Brad Fitzpatrick [Fri, 2 Dec 2016 23:27:02 +0000 (23:27 +0000)]
runtime: skip GDB tests on mips64

Updates #18173

Change-Id: I4c667c89ba3bf16433a4cef7cb01054f1798667d
Reviewed-on: https://go-review.googlesource.com/33892
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: add missing newline at end of error message
Josh Bleecher Snyder [Sat, 3 Dec 2016 00:34:03 +0000 (16:34 -0800)]
cmd/go: add missing newline at end of error message

Change-Id: I9277e869e171d9e051ff9a70ac578b8127fa74f8
Reviewed-on: https://go-review.googlesource.com/33897
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agotest: add test case for which gccgo generated incorrect GC info
Ian Lance Taylor [Thu, 1 Dec 2016 17:15:39 +0000 (09:15 -0800)]
test: add test case for which gccgo generated incorrect GC info

Change-Id: I5e33db9e63f70706882b85ab124a48509797b05a
Reviewed-on: https://go-review.googlesource.com/33790
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: fix grammar in go1.8.html > crypto/tls
Filippo Valsorda [Fri, 2 Dec 2016 19:09:08 +0000 (19:09 +0000)]
doc: fix grammar in go1.8.html > crypto/tls

Change-Id: If8200e54b3650f789c5312f10cce32201a199b80
Reviewed-on: https://go-review.googlesource.com/33775
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/link: don't overalign ELF reloc sections
Ian Lance Taylor [Fri, 2 Dec 2016 06:48:52 +0000 (22:48 -0800)]
cmd/link: don't overalign ELF reloc sections

Internal linking on an ELF system creates two reloc sections, which
must be adjacent. The default is to base section alignment on the
section size, but doing that for ELF reloc sections can introduce a
gap. Set the reloc section alignment explicitly to avoid that.

Fixes #18044.

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

8 years agodoc: correct the number of changes to the language in go1.8.html
Brad Fitzpatrick [Fri, 2 Dec 2016 06:49:17 +0000 (06:49 +0000)]
doc: correct the number of changes to the language in go1.8.html

And link it.

Change-Id: Ic0105468435299fb1638f86522f4f3ce417ec1c2
Reviewed-on: https://go-review.googlesource.com/33871
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile/internal/syntax: remove dead type declaration
Robert Griesemer [Fri, 2 Dec 2016 06:06:41 +0000 (22:06 -0800)]
cmd/compile/internal/syntax: remove dead type declaration

Change-Id: I8a3ce0fa513ff943009c5669531132cd23ecf155
Reviewed-on: https://go-review.googlesource.com/33870
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agovendor/golang_org/x/crypto/chacha20poly1305: revendor to pick up fix for #18154
Shenghou Ma [Fri, 2 Dec 2016 05:46:10 +0000 (00:46 -0500)]
vendor/golang_org/x/crypto/chacha20poly1305: revendor to pick up fix for #18154

Fixes #18154.

Change-Id: I1836b63a380b7fc2f9965e909859b1a89a3ae5d5
Reviewed-on: https://go-review.googlesource.com/33856
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: update suggested Go installation version
Kevin Burke [Fri, 2 Dec 2016 01:45:26 +0000 (17:45 -0800)]
doc: update suggested Go installation version

Previously the docs suggested downloading 1.7.2 (no good) or 1.7.3 (has
security flaw).

Change-Id: Ifabe85908df8d6591c0957ef4bb1b800fc145793
Reviewed-on: https://go-review.googlesource.com/33808
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: CL 32796 was reverted, so remove it from go1.8.html
Ian Lance Taylor [Fri, 2 Dec 2016 00:25:07 +0000 (16:25 -0800)]
doc: CL 32796 was reverted, so remove it from go1.8.html

Reversion CL was 33770.

Change-Id: I119f26796bb2b66d302e132dd118847ac3bd6633
Reviewed-on: https://go-review.googlesource.com/33807
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: revert change making NewRequest set ContentLength -1
Brad Fitzpatrick [Thu, 1 Dec 2016 22:01:35 +0000 (22:01 +0000)]
net/http: revert change making NewRequest set ContentLength -1

The introduction of NoBody and related body-peeking bug fixes also
added a "cleanup" of sorts to make NewRequest set the returned
Requests's ContentLength to -1 when it didn't know it.

Using -1 to mean unknown is what the documentation says, but then
people apparently(?) depended on it being zero so they could do this:

    req, _ := http.NewRequest("POST", url, someNonNilReaderWithUnkownSize)
    req.Body = nil
    res, err := http.DefaultClient.Do(req)

... and expect it to work.

After https://golang.org/cl/31445 the contrived(?) code above stopped
working, since Body was nil and ContentLength was -1, which has been
disallowed since Go 1.0.

So this restores the old behavior of NewRequest, not setting it to -1.
That part of the fix isn't required as of https://golang.org/cl/31726
(which added NoBody)

I still don't know whether this bug is hypothetical or actually
affected people in practice.

Let's assume it's real for now.

Fixes #18117

Change-Id: I42400856ee92a1a4999b5b4668bef97d885fbb53
Reviewed-on: https://go-review.googlesource.com/33801
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/dist: adjust default timeout scale for mips
Brad Fitzpatrick [Thu, 1 Dec 2016 23:27:25 +0000 (23:27 +0000)]
cmd/dist: adjust default timeout scale for mips

Per recommendation from imgtec.com folk.

Change-Id: I9b6f30572f257acce59842ac55362f52fe36c5ab
Reviewed-on: https://go-review.googlesource.com/33804
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: check MustHaveExternalNetwork before `go get` tests
Ian Lance Taylor [Thu, 1 Dec 2016 22:27:06 +0000 (14:27 -0800)]
cmd/go: check MustHaveExternalNetwork before `go get` tests

Also change a couple of `go get` tests to use MustHaveExternalNetwork
rather than checking testing.Short.

Change-Id: I98ccc05b8b0354f1b7486e28dac5f8341c342a07
Reviewed-on: https://go-review.googlesource.com/33802
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/internal/obj: rename obj.go to line.go
Matthew Dempsky [Thu, 1 Dec 2016 22:59:21 +0000 (14:59 -0800)]
cmd/internal/obj: rename obj.go to line.go

This file is entirely about the implementation of LineHist, and I can
never remember which generic filename in cmd/internal/obj has it.
Rename to line.go to match the already existing line_test.go.

Change-Id: Id01f3339dc550c9759569d5610d808b17bca44d0
Reviewed-on: https://go-review.googlesource.com/33803
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodatabase/sql: ensure Commit and Rollback return ErrTxDone
Daniel Theophanes [Thu, 1 Dec 2016 19:07:11 +0000 (11:07 -0800)]
database/sql: ensure Commit and Rollback return ErrTxDone

Ensure documented behavior of returning ErrTxDone if the Tx has
already been committed or rolled back.

Fixes #18147

Change-Id: I07dc75bef4dbd4dd88dd252c96dc8ab99f28c00e
Reviewed-on: https://go-review.googlesource.com/33793
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agocmd/compile: correctly parse //line filename:line where filename contains ':'
Robert Griesemer [Thu, 1 Dec 2016 21:03:54 +0000 (13:03 -0800)]
cmd/compile: correctly parse //line filename:line where filename contains ':'

This was a regression from 1.7. See the issue for details.

Fixes #18149.

Change-Id: Ic8f5a35d14edf9254b1275400316cff7aff32a27
Reviewed-on: https://go-review.googlesource.com/33799
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: fix typo in go1.8.html
Chris Broadfoot [Thu, 1 Dec 2016 21:27:32 +0000 (13:27 -0800)]
doc: fix typo in go1.8.html

Change-Id: I853da2666ed2b5f8b80bd9438f8c352f233b9c89
Reviewed-on: https://go-review.googlesource.com/33800
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: teach NewRequest that NoBody has ContentLength zero
Brad Fitzpatrick [Wed, 30 Nov 2016 18:45:56 +0000 (18:45 +0000)]
net/http: teach NewRequest that NoBody has ContentLength zero

NoBody is new in Go 1.8.

Found while investigating #18117

Change-Id: I6bda030f358e2270f090d108cb3a89c8a2665fcb
Reviewed-on: https://go-review.googlesource.com/33714
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: document go1.7.4 and go1.6.4
Chris Broadfoot [Thu, 1 Dec 2016 20:12:23 +0000 (12:12 -0800)]
doc: document go1.7.4 and go1.6.4

Change-Id: I0728afe6a1d1e0aee4701e51a5548fa9fd637b66
Reviewed-on: https://go-review.googlesource.com/33795
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: document go1.7.3 and add note to go1.7.2 that it should not be used
Chris Broadfoot [Wed, 19 Oct 2016 00:32:26 +0000 (17:32 -0700)]
doc: document go1.7.3 and add note to go1.7.2 that it should not be used

Change-Id: I3dd1513e927733ce5c63928da772cb81760ba869
Reviewed-on: https://go-review.googlesource.com/31442
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/33794

8 years agonet: fix writev tests on Android
Elias Naur [Thu, 1 Dec 2016 19:30:22 +0000 (20:30 +0100)]
net: fix writev tests on Android

Change-Id: Iacced25363f54ee2cc1e00a71605dba7fb447162
Reviewed-on: https://go-review.googlesource.com/33772
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: generate frame pointers for otherwise frameless functions
Keith Randall [Thu, 1 Dec 2016 00:15:32 +0000 (16:15 -0800)]
cmd/compile: generate frame pointers for otherwise frameless functions

func f() {
    g()
}

We mistakenly don't add a frame pointer for f.  This means f
isn't seen when walking the frame pointer linked list.  That
matters for kernel-gathered profiles, and is an impediment for
issues like #16638.

To fix, allocate a stack frame even for otherwise frameless functions
like f.  It is a bit tricky because we need to avoid some runtime
internals that really, really don't want one.

No test at the moment, as only kernel CPU profiles would catch it.
Tests will come with the implementation of #16638.

Fixes #18103

Change-Id: I411206cc9de4c8fdd265bee2e4fa61d161ad1847
Reviewed-on: https://go-review.googlesource.com/33754
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocrypto/x509: read Darwin trust settings for root CAs
Quentin Smith [Wed, 30 Nov 2016 20:16:37 +0000 (15:16 -0500)]
crypto/x509: read Darwin trust settings for root CAs

Darwin separately stores bits indicating whether a root certificate
should be trusted; this changes Go to read and use those when
initializing SystemCertPool.

Unfortunately, the trust API is very slow. To avoid a delay of up to
0.5s in initializing the system cert pool, we assume that
the trust settings found in kSecTrustSettingsDomainSystem will always
indicate trust. (That is, all root certs Apple distributes are trusted.)
This is not guaranteed by the API but is true in practice.

In the non-cgo codepath, we do not have that benefit, so we must check
the trust status of every certificate. This causes about 0.5s of delay
in initializing the SystemCertPool.

On OS X 10.11 and older, the "security" command requires a certificate
to be provided in a file and not on stdin, so the non-cgo codepath
creates temporary files for each certificate, further slowing initialization.

Updates #18141.

Change-Id: If681c514047afe5e1a68de6c9d40ceabbce54755
Reviewed-on: https://go-review.googlesource.com/33721
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: do not inline functions marked cgo_unsafe_args
David Lazar [Wed, 30 Nov 2016 22:09:07 +0000 (17:09 -0500)]
cmd/compile: do not inline functions marked cgo_unsafe_args

Now the net tests pass with -gcflags '-l=4'.

Fixes #18125.

Change-Id: I4e3a46eb0cb3a93b203e74f5bc99c5822331f535
Reviewed-on: https://go-review.googlesource.com/33722
Reviewed-by: Keith Randall <khr@golang.org>