]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
6 years agodoc, api: add type Srcset string change to go1.10 notes and API go1.10beta2
Andrew Bonventre [Thu, 11 Jan 2018 16:30:49 +0000 (11:30 -0500)]
doc, api: add type Srcset string change to go1.10 notes and API

Change-Id: I13afaa894292bd566510b40a5e4bbbe4d72d4d08
Reviewed-on: https://go-review.googlesource.com/87395
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocrypto/x509: parse multiple URLs in a single CRLDP.
Adam Langley [Wed, 10 Jan 2018 21:59:51 +0000 (13:59 -0800)]
crypto/x509: parse multiple URLs in a single CRLDP.

Previously we would only extract a single URL from a given CRLDP, but
https://tools.ietf.org/html/rfc5280#section-4.2.1.13 permits multiple
URLs for a single distribution point.

Fixes #23403

Change-Id: I2eaed1537df02d0627db1b86bcd9c94506236bea
Reviewed-on: https://go-review.googlesource.com/87299
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: avoid for-loop if possible
Kunpei Sakai [Thu, 11 Jan 2018 00:58:16 +0000 (09:58 +0900)]
net/http: avoid for-loop if possible

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

6 years agocmd/compile/internal/syntax: don't record semi position if there's none
Robert Griesemer [Thu, 11 Jan 2018 01:14:20 +0000 (17:14 -0800)]
cmd/compile/internal/syntax: don't record semi position if there's none

Fixes #23406.

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

6 years agocrypto: clarify that some files come from CRYPTOGAMS
Ian Lance Taylor [Wed, 10 Jan 2018 23:45:18 +0000 (15:45 -0800)]
crypto: clarify that some files come from CRYPTOGAMS

and that they are covered by the CRYPTOGAMS license.

Fixes #22637

Change-Id: I75b8e08d3a8b569edf383c078bb11c796b766c81
Reviewed-on: https://go-review.googlesource.com/87315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: redirect host-based patterns to trailing slash
Terin Stock [Mon, 18 Dec 2017 23:17:02 +0000 (15:17 -0800)]
net/http: redirect host-based patterns to trailing slash

Handlers can be registered for specific hosts by specifying the host as
part of the mux pattern. If a trailing slash route is registered for
these host-based patterns, shouldRedirect should indicate that
a redirect is required.

This change modifies shouldRedirect to also take the host of the
request, and now considers host-based patterns while determining if
a request should be redirected.

Fixes #23183
Change-Id: If8753e130d5d877acdc55344833e3b289bbed2b4
Reviewed-on: https://go-review.googlesource.com/84695
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agonet/http: fix "http2: no cached connection..." error with x/net/http2
Brad Fitzpatrick [Wed, 10 Jan 2018 21:50:13 +0000 (21:50 +0000)]
net/http: fix "http2: no cached connection..." error with x/net/http2

The net/http Transport was testing for a sentinel x/net/http2 error
value with ==, which meant it was only testing the bundled version. If
a user enabled http2 via golang.org/x/net/http2, the error value had a
different name.

This also updates the bundled x/net/http2 to git rev ab555f36 for:

    http2: add internal function isNoCachedConnError to test for ErrNoCachedConn
    https://golang.org/cl/87297

Fixes #22091

Change-Id: I3fb85e2b7ba7d145dd66767e1795a56de633958c
Reviewed-on: https://go-review.googlesource.com/87298
Reviewed-by: Tom Bergan <tombergan@google.com>
6 years agocmd/cgo: support niladic macros for gccgo
Ian Lance Taylor [Sat, 6 Jan 2018 00:52:53 +0000 (16:52 -0800)]
cmd/cgo: support niladic macros for gccgo

https://golang.org/cl/43970 changed writeOutputFunc to support niladic
function-like macros; apply the corresponding change to
writeGccgoOutputFunc.

Updates #10715
Updates #18720

Change-Id: I5decb1d37ec71507466ade2eeda4b89c8785eaef
Reviewed-on: https://go-review.googlesource.com/86475
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agocmd/go: check for another GCC error message
Ian Lance Taylor [Wed, 10 Jan 2018 14:28:59 +0000 (06:28 -0800)]
cmd/go: check for another GCC error message

GCC always recognizes the -fsplit-stack option, but then tests whether
it is supported by the selected target. If not, it reports
    cc1: error: ‘-fsplit-stack’ is not supported by this compiler configuration
Check for that error message when deciding whether a compiler option works.

Change-Id: I2eef8d550bbecba3a087869df2c7351280c77290
Reviewed-on: https://go-review.googlesource.com/87136
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agocmd/go: limit test input file change detection to local GOROOT/GOPATH tree
Russ Cox [Tue, 9 Jan 2018 20:16:29 +0000 (15:16 -0500)]
cmd/go: limit test input file change detection to local GOROOT/GOPATH tree

We've had a series of problems with tests unexpectedly (and innocently)
looking at system files that appear to (but don't) change in meaningful ways,
like /dev/null on OS X having a modification time set to the current time.

Cut all these off by only applying file change detection to the local package
root: the GOROOT or specific sub-GOPATH in which the package being tested
is found.

(This means that if you test reads /tmp/x and you change /tmp/x, the cached
result will still be used. Don't do that, or else use -count=1.)

Fixes #23390.

Change-Id: I30b6dd194835deb645a040aea5e6e4f68af09edb
Reviewed-on: https://go-review.googlesource.com/87015
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agogo/importer,os/exec: use testenv.GoToolPath
Daniel Martí [Wed, 10 Jan 2018 17:01:31 +0000 (17:01 +0000)]
go/importer,os/exec: use testenv.GoToolPath

These were the last two occurences of exec.Command("go", ...) in all of
std cmd. Checked with:

gogrep '$(f is(func))("go", $*_)' std cmd

Also changed lp_windows_test to use a test package name to avoid a
circular dependency, since internal/testenv imports os/exec.

Change-Id: I9a18948600dfecc8507ad76172e219e78b791ffd
Reviewed-on: https://go-review.googlesource.com/87200
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos/exec: skip TestContextCancel on the Windows XP builder
Brad Fitzpatrick [Wed, 10 Jan 2018 19:15:36 +0000 (19:15 +0000)]
os/exec: skip TestContextCancel on the Windows XP builder

Updates #17245

Change-Id: I3d7ea362809040fbbba4b33efd57bf2d27d4c390
Reviewed-on: https://go-review.googlesource.com/87257
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 agodoc/go1.10: document that Go 1.11 will remove Windows XP support
Russ Cox [Wed, 10 Jan 2018 16:18:59 +0000 (11:18 -0500)]
doc/go1.10: document that Go 1.11 will remove Windows XP support

Fixes #23380.

Change-Id: Ia9a086eada21b5561f110833afcf93e542a04407
Reviewed-on: https://go-review.googlesource.com/87175
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agogo/internal/gccgoimporter: parse optional escape info in export data
Robert Griesemer [Tue, 9 Jan 2018 18:28:29 +0000 (10:28 -0800)]
go/internal/gccgoimporter: parse optional escape info in export data

Fixes #23324.

Change-Id: Ie2383bad35f0bcc1344a8a1683be08d5fd0eea96
Reviewed-on: https://go-review.googlesource.com/86977
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agocmd/compile: workaround for inconsistent receiver param srcpos
Than McIntosh [Wed, 10 Jan 2018 02:20:10 +0000 (21:20 -0500)]
cmd/compile: workaround for inconsistent receiver param srcpos

Given an inlinable method M in package P:

   func (r *MyStruct) M(...) {

When M is compiled within its home package, the source position that
the compiler records for 'r' (receiver parameter variable) is
accurate, whereas if M is built as part of the compilation of some
other package (body read from export data), the declaration line
assigned to 'r' will be the line number of the 'import' directive, not
the source line from M's source file.

This inconsistency can cause differences in the size of abstract
parameter DIEs (due to variable-length encoding), which can then in
turn result in bad abstract origin offsets, which in turn triggers
build failures on iOS (dsymutil crashes when it encounters an
incorrect abstract origin reference).

Work around the problem by removing the "declaration line number"
attribute within the abstract parameter abbreviation table entry. The
decl line attribute doesn't contribute a whole lot to the debugging
experience, and it gets rid of the inconsistencies that trigger the
dsymutil crashes.

Updates #23374.

Change-Id: I0fdc8e19a48db0ccd938ceadf85103936f89ce9f
Reviewed-on: https://go-review.googlesource.com/87055
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agohtml/template: check for duplicates when inserting escapers
Samuel Tan [Thu, 14 Dec 2017 06:38:18 +0000 (22:38 -0800)]
html/template: check for duplicates when inserting escapers

Ensure that we do not insert any escapers into pipelines that
already contain an equivalent escaper. This prevents overescaping
from occuring even when an aliased parse tree that has already
been escaped is escaped again.

Fixes #21844

Change-Id: Ic00d5e01c97ef09a4e49407009cf71b0d07f5c0e
Reviewed-on: https://go-review.googlesource.com/83920
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agodoc/go1.10: fix typo of "preserves"
kim yongbin [Wed, 10 Jan 2018 16:49:45 +0000 (01:49 +0900)]
doc/go1.10: fix typo of "preserves"

Change-Id: Ib5f5d20200284850c14c2431687bc102696ef8ae
Reviewed-on: https://go-review.googlesource.com/87215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: run the real test binary if the test link was cached
Ian Lance Taylor [Fri, 15 Dec 2017 20:38:59 +0000 (12:38 -0800)]
cmd/go: run the real test binary if the test link was cached

Fixes #23150

Change-Id: Ia82c2d482a8dc53cabb3f173e4301fee66288821
Reviewed-on: https://go-review.googlesource.com/84376
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agonet/url: reject invalid userinfo values when parsing URLs
Brad Fitzpatrick [Tue, 9 Jan 2018 21:33:54 +0000 (21:33 +0000)]
net/url: reject invalid userinfo values when parsing URLs

Fixes #23392

Change-Id: I5822b082b14d886b9c3b5ad7beebb2c01a77851b
Reviewed-on: https://go-review.googlesource.com/87038
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoall: use Fatalf instead of Fatal if format is given
Kunpei Sakai [Tue, 9 Jan 2018 11:34:33 +0000 (20:34 +0900)]
all: use Fatalf instead of Fatal if format is given

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

6 years agodoc/go1.10: fix more TODOs
Russ Cox [Tue, 9 Jan 2018 21:45:27 +0000 (16:45 -0500)]
doc/go1.10: fix more TODOs

Change-Id: I7be69a543841343a6ccbb335c7277009528fa0da
Reviewed-on: https://go-review.googlesource.com/87024
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: fix grammar nit
Russ Cox [Tue, 9 Jan 2018 20:49:40 +0000 (15:49 -0500)]
os: fix grammar nit

There should not be a comma before "and" in the original text,
because what follows is not a complete sentence. Rewrite.

Change-Id: Ie99f204cc87e911fb46149e2eb65e132fa1eb63a
Reviewed-on: https://go-review.googlesource.com/87020
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agospec: use consistent quoting style in prose
Robert Griesemer [Tue, 9 Jan 2018 20:42:28 +0000 (12:42 -0800)]
spec: use consistent quoting style in prose

Fixes #23389.

Change-Id: Id6e86eebe44809db12a0e14014c474bf4fbf5108
Reviewed-on: https://go-review.googlesource.com/87035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix path for go tool in test
Keith Randall [Tue, 9 Jan 2018 21:23:13 +0000 (13:23 -0800)]
cmd/compile: fix path for go tool in test

Fixes #23326

Change-Id: I6abc353ab004aadc6a4cbefbff3198f848640d7f
Reviewed-on: https://go-review.googlesource.com/87036
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agostrings: prevent copyCheck from forcing Builder to escape and allocate
Brad Fitzpatrick [Tue, 9 Jan 2018 18:08:43 +0000 (18:08 +0000)]
strings: prevent copyCheck from forcing Builder to escape and allocate

All credit and blame goes to Ian for this suggestion, copied from the
runtime.

Fixes #23382
Updates #7921

Change-Id: I3d5a9ee4ab730c87e0f3feff3e7fceff9bcf9e18
Reviewed-on: https://go-review.googlesource.com/86976
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoreflect: fix doc nit
Russ Cox [Tue, 9 Jan 2018 20:52:01 +0000 (15:52 -0500)]
reflect: fix doc nit

Type values being comparable implies that Type is a valid map key type.
As previously written, they sound unrelated.

Change-Id: I8e2235275d62898bfb47de850e8257b51ab5cbd6
Reviewed-on: https://go-review.googlesource.com/87021
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: remove interior <code> spaces in debugging, diagnostics docs
Russ Cox [Tue, 9 Jan 2018 20:32:22 +0000 (15:32 -0500)]
doc: remove interior <code> spaces in debugging, diagnostics docs

Change-Id: I20de6207d386635025dbb603c57219218e9a9af5
Reviewed-on: https://go-review.googlesource.com/87019
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/debugging_with_gdb: soften text about disabling optimizations
Russ Cox [Tue, 9 Jan 2018 20:31:45 +0000 (15:31 -0500)]
doc/debugging_with_gdb: soften text about disabling optimizations

Don't suggest that it's always necessary to disable optimizations.
(The text can be misread that way, even if it's not what was meant.)

Change-Id: I9a2dff6a75ce4a3f9210cdf4f5bad6aaaeae9b29
Reviewed-on: https://go-review.googlesource.com/87018
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: s/tool chain/toolchain/
Russ Cox [Tue, 9 Jan 2018 20:26:21 +0000 (15:26 -0500)]
doc: s/tool chain/toolchain/

We were not being consistent.
Standardize on toolchain.

Change-Id: Id0e756b5214ce4a1341f733634ed95263f03a61c
Reviewed-on: https://go-review.googlesource.com/87017
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: adjust import config debugging flag
Russ Cox [Tue, 9 Jan 2018 19:49:08 +0000 (14:49 -0500)]
cmd/go: adjust import config debugging flag

Change-Id: I3afaefc154f9ccfac353cedac7aefcfb70afe265
Reviewed-on: https://go-review.googlesource.com/86996
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/link: set runtime.GOROOT default during link
Russ Cox [Mon, 8 Jan 2018 16:59:29 +0000 (11:59 -0500)]
cmd/link: set runtime.GOROOT default during link

Suppose you build the Go toolchain in directory A,
move the whole thing to directory B, and then use
it from B to build a new program hello.exe, and then
run hello.exe, and hello.exe crashes with a stack
trace into the standard library.

Long ago, you'd have seen hello.exe print file names
in the A directory tree, even though the files had moved
to the B directory tree. About two years ago we changed
the compiler to write down these files with the name
"$GOROOT" (that literal string) instead of A, so that the
final link from B could replace "$GOROOT" with B,
so that hello.exe's crash would show the correct source
file paths in the stack trace. (golang.org/cl/18200)

Now suppose that you do the same thing but hello.exe
doesn't crash: it prints fmt.Println(runtime.GOROOT()).
And you run hello.exe after clearing $GOROOT from the
environment.

Long ago, you'd have seen hello.exe print A instead of B.
Before this CL, you'd still see hello.exe print A instead of B.
This case is the one instance where a moved toolchain
still divulges its origin. Not anymore. After this CL, hello.exe
will print B, because the linker sets runtime/internal/sys.DefaultGoroot
with the effective GOROOT from link time.
This makes the default result of runtime.GOROOT once again
match the file names recorded in the binary, after two years
of divergence.

With that cleared up, we can reintroduce GOROOT into the
link action ID and also reenable TestExecutableGOROOT/RelocatedExe.

When $GOROOT_FINAL is set during link, it is used
in preference to $GOROOT, as always, but it was easier
to explain the behavior above without introducing that
complication.

Fixes #22155.
Fixes #20284.
Fixes #22475.

Change-Id: Ifdaeb77fd4678fdb337cf59ee25b2cd873ec1016
Reviewed-on: https://go-review.googlesource.com/86835
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/link: apply -X options after loading symbols
Russ Cox [Tue, 9 Jan 2018 15:10:46 +0000 (10:10 -0500)]
cmd/link: apply -X options after loading symbols

The linker has been applying -X options before loading symbols,
meaning that when it sees -X y=z it creates a symbol named y
and initializes its string data to z. The symbol named y is marked
"DUPOK" so that when the actual packages are loaded, no error is
emitted when the real y is seen. The predefined y's data is used
instead of whatever the real y says.

If we define -X y=z and we never load y, then the predefined symbol
is dropped during dead code elimination, but not in shared library
builds. Shared library builds must include all symbols, so we have to
be more careful about not defining symbols that wouldn't have
appeared anyway.

To be more careful, save the -X settings until after all the symbols
are loaded from the packages, and then apply the string changes
to whatever symbols are known (but ignore the ones that were not
loaded at all). This ends up being simpler anyway, since it doesn't
depend on DUPOK magic.

Makes CL 86835 safe.

Fixes #23273.

Change-Id: Ib4c9b2d5eafa97c5a8114401dbec0134c76be54f
Reviewed-on: https://go-review.googlesource.com/86915
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoRevert "html/template: prevent aliasing of parse Trees via AddParseTree"
Samuel Tan [Thu, 14 Dec 2017 06:38:00 +0000 (22:38 -0800)]
Revert "html/template: prevent aliasing of parse Trees via AddParseTree"

This reverts commit cd0a5f08293e1bf1fac41ae6438d495318cd52fb, which
unnecessarily restricts the use of AddParseTree.

Change-Id: I1155214a20ba08981d604404e79fff54874fd8e4
Reviewed-on: https://go-review.googlesource.com/83919
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/test2json: emit Benchmark name output early
Russ Cox [Mon, 8 Jan 2018 17:11:00 +0000 (12:11 -0500)]
cmd/test2json: emit Benchmark name output early

When benchmarks run, they print lines like:

  BenchmarkGenericNoMatch-8   3000000 385 ns/op

The first field, padded by spaces and followed by a tab,
is printed when the benchmark begins running.
The rest of the line is printed when the benchmark ends.
Tools and people can watch the timing of these prints
to see which benchmark is running.

To allow tools consuming json output to continue to be
able to see which benchmark is running, this CL adds a
special case to the usual "line at a time" behavior to flush
the benchmark name if it is observed separately from the
rest of the line.

Fixes #23352.

Change-Id: I7b6410698d78034eec18745d7f57b7d8e9575dbb
Reviewed-on: https://go-review.googlesource.com/86695
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocontainer/list: document nil values more
Brad Fitzpatrick [Mon, 8 Jan 2018 16:01:52 +0000 (16:01 +0000)]
container/list: document nil values more

Fixes #23372

Change-Id: Ie99fb4d84cb49efa66c0ff480d2656c33ef11e6d
Reviewed-on: https://go-review.googlesource.com/86676
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agoA+C: update late Go 1.10 contributors
Brad Fitzpatrick [Sat, 6 Jan 2018 03:03:58 +0000 (03:03 +0000)]
A+C: update late Go 1.10 contributors

Add Brad Burch (individual CLA)
Add Charles Fenwick Elliott (individual CLA)
Add Geoff Berry (corporate CLA for Qualcomm Data Center, Inc.)
Add Igor Vashyst (individual CLA)
Add Jiulong Wang (individual CLA)
Add Junya Hayashi (individual CLA)
Add Matthijs Kooijman (individual CLA)
Add Paul PISCUC (individual CLA)
Add Steve Gilbert (individual CLA)
Add Tad Fisher (individual CLA)
Add Yukihiro Nishinaka (individual CLA)

Updates #12042

Change-Id: Ib7a3c7a4d38d15530c2ea42fe8d359ae10c9a19e
Reviewed-on: https://go-review.googlesource.com/86478
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocrypto/x509: update iOS root certs.
Giovanni Bajo [Mon, 13 Nov 2017 00:54:08 +0000 (01:54 +0100)]
crypto/x509: update iOS root certs.

Apple changed the format of its support page, so we need to
restructure the HTML parser. The HTML table is now parsed using
regular expressions, and certificates are then found in macOS
trust store by their fingerprint.

Fixes #22181

Change-Id: I29e7a40d37770bb005d728f1832299c528691f7e
Reviewed-on: https://go-review.googlesource.com/77252
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
6 years agodoc/go1.10: remove ReverseProxy TODO
Brad Fitzpatrick [Sat, 6 Jan 2018 01:16:09 +0000 (01:16 +0000)]
doc/go1.10: remove ReverseProxy TODO

No longer needs to be done.

Updates #23009
Updates #21255

Change-Id: I78e9e29a923dc03dea89ff3a5bf60f2e0bd0c0aa
Reviewed-on: https://go-review.googlesource.com/86476
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoRevert "net/http/httputil: allow ReverseProxy to call ModifyResponse on failed requests"
Brad Fitzpatrick [Fri, 5 Jan 2018 21:35:51 +0000 (21:35 +0000)]
Revert "net/http/httputil: allow ReverseProxy to call ModifyResponse on failed requests"

This reverts commit https://golang.org/cl/54030

Reason for revert: to not paint ourselves into a corner.
See https://github.com/golang/go/issues/23009

Fixes #23009
Updates #21255

Change-Id: I68caab078839b9d2bf645a7bbed8405a5a30cd22
Reviewed-on: https://go-review.googlesource.com/86435
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http: document cloning of Server.TLSConfig
Brad Fitzpatrick [Fri, 5 Jan 2018 21:31:57 +0000 (21:31 +0000)]
net/http: document cloning of Server.TLSConfig

Updates #22018

Change-Id: I8a85324e9d53dd4d279ed05cdb93f50d55cf767b
Reviewed-on: https://go-review.googlesource.com/86415
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: add support for build IDs with gccgo
Ian Lance Taylor [Wed, 27 Dec 2017 22:07:01 +0000 (14:07 -0800)]
cmd/go: add support for build IDs with gccgo

This just adds support on ELF systems, which is OK for now since that
is all that gccgo works on.

For the archive file generated by the compiler we add a new file
_buildid.o that has a section .go.buildid containing the build ID.
Using a new file lets us set the SHF_EXCLUDE bit in the section header,
so the linker will discard the section. It would be nicer to use
`objcopy --add-section`, but objcopy doesn't support setting the
SHF_EXCLUDE bit.

For an executable we just use an ordinary GNU build ID. Doing this
required modifying cmd/internal/buildid to look for a GNU build ID,
and use it if there is no other Go-specific note.

This CL fixes a minor bug in gccgoTOolchain.link: it was using .Target
instead of .built, so it failed for a cached file.

This CL fixes a bug reading note segments: the notes are aligned as
reported by the PT_NOTE's alignment field.

Updates #22472

Change-Id: I4d9e9978ef060bafc5b9574d9af16d97c13f3102
Reviewed-on: https://go-review.googlesource.com/85555
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agocmd/test2json: fix processing of --- BENCH: output
Russ Cox [Fri, 5 Jan 2018 21:06:47 +0000 (16:06 -0500)]
cmd/test2json: fix processing of --- BENCH: output

If a benchmark calls b.Log without failing (without b.Error/b.Fatal/b.FailNow)
then that turns into output very much like a test passing,
except it says BENCH instead of PASS.
Benchmarks failing say FAIL just like tests failing.

Fixes #23346.

Change-Id: Ib188e695952da78057ab4a13f90d49937aa3c232
Reviewed-on: https://go-review.googlesource.com/86396
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/debugging_with_gdb: mention delve as an alternative.
Hana Kim [Tue, 19 Dec 2017 20:21:05 +0000 (15:21 -0500)]
doc/debugging_with_gdb: mention delve as an alternative.

Fixes #23108

Change-Id: I9b3d0f0c399c0b4cb488adaf3c002bc55d5d21d9
Reviewed-on: https://go-review.googlesource.com/84795
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agogo/constant: make string addition compute actual string lazily
Russ Cox [Fri, 5 Jan 2018 18:20:08 +0000 (13:20 -0500)]
go/constant: make string addition compute actual string lazily

It is natural for tools to take a large string concatenation like

"1" + "1" + "1" + ... + "1"

and translate that into a sequence of go/constant calls:

x := constant.MakeString("1")
x = constant.BinaryOp(x, token.ADD, constant.MakeString("1"))
x = constant.BinaryOp(x, token.ADD, constant.MakeString("1"))
x = constant.BinaryOp(x, token.ADD, constant.MakeString("1"))
x = constant.BinaryOp(x, token.ADD, constant.MakeString("1"))
...

If the underlying representation of a string constant is a Go string,
then this leads to O(N²) memory for the concatenation of N strings,
allocating memory for "1", "11", "111", "1111", and so on.
This makes go/types and in particular cmd/vet run out of memory
(or at least use far too much) on machine-generated string concatenations,
such as those generated by go-bindata.

This CL allows code like the above to operate efficiently, by delaying
the evaluation of the actual string constant value until it is needed.
Now the representation of a string constant is either a string or an
explicit addition expression. The addition expression is turned into
a string the first time it is requested and then cached for future use.
This slows down the use of single strings, but analyses are likely not
dominated by that use anyway. It speeds up string concatenations,
especially large ones, significantly.

On my Mac running 32-bit code:

name               old time/op    new time/op    delta
StringAdd/1-8         160ns ± 2%     183ns ± 1%  +13.98%  (p=0.000 n=10+10)
StringAdd/4-8         650ns ± 1%     927ns ± 4%  +42.73%  (p=0.000 n=10+10)
StringAdd/16-8       3.93µs ± 1%    2.78µs ± 2%  -29.12%  (p=0.000 n=8+9)
StringAdd/64-8       37.3µs ± 9%    10.1µs ± 5%  -73.06%  (p=0.000 n=10+10)
StringAdd/256-8       513µs ± 5%      38µs ± 1%  -92.63%  (p=0.000 n=10+10)
StringAdd/1024-8     5.67ms ± 4%    0.14ms ± 2%  -97.45%  (p=0.000 n=8+10)
StringAdd/4096-8     77.1ms ± 9%     0.7ms ± 2%  -99.10%  (p=0.000 n=10+9)
StringAdd/16384-8     1.33s ± 7%     0.00s ±10%  -99.64%  (p=0.000 n=10+10)
StringAdd/65536-8     21.5s ± 4%      0.0s ± 8%  -99.89%  (p=0.000 n=10+10)

name               old alloc/op   new alloc/op   delta
StringAdd/1-8          232B ± 0%      256B ± 0%  +10.34%  (p=0.000 n=10+10)
StringAdd/4-8        1.20kB ± 0%    1.24kB ± 0%   +3.33%  (p=0.000 n=10+10)
StringAdd/16-8       14.7kB ± 0%     4.6kB ± 0%  -68.87%  (p=0.000 n=10+10)
StringAdd/64-8        223kB ± 0%      16kB ± 0%  -92.66%  (p=0.000 n=10+10)
StringAdd/256-8      3.48MB ± 0%    0.07MB ± 0%  -98.07%  (p=0.000 n=10+10)
StringAdd/1024-8     55.7MB ± 0%     0.3MB ± 0%  -99.53%  (p=0.000 n=10+10)
StringAdd/4096-8      855MB ± 0%       1MB ± 0%  -99.88%  (p=0.000 n=10+10)
StringAdd/16384-8    13.5GB ± 0%     0.0GB ± 0%  -99.97%  (p=0.000 n=9+10)
StringAdd/65536-8     215GB ± 0%       0GB ± 0%  -99.99%  (p=0.000 n=10+10)

name               old allocs/op  new allocs/op  delta
StringAdd/1-8          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
StringAdd/4-8          9.00 ± 0%     11.00 ± 0%  +22.22%  (p=0.000 n=10+10)
StringAdd/16-8         33.0 ± 0%      25.0 ± 0%  -24.24%  (p=0.000 n=10+10)
StringAdd/64-8          129 ± 0%        75 ± 0%  -41.86%  (p=0.000 n=10+10)
StringAdd/256-8         513 ± 0%       269 ± 0%  -47.56%  (p=0.000 n=10+10)
StringAdd/1024-8      2.05k ± 0%     1.04k ± 0%  -49.29%  (p=0.000 n=10+10)
StringAdd/4096-8      8.19k ± 0%     4.12k ± 0%  -49.77%  (p=0.000 n=10+10)
StringAdd/16384-8     32.8k ± 0%     16.4k ± 0%  -49.97%  (p=0.000 n=9+10)
StringAdd/65536-8      131k ± 0%       66k ± 0%  -50.11%  (p=0.000 n=10+10)

https://perf.golang.org/search?q=upload:20180105.2

Fixes #23348 (originally reported as cmd/vet failures in comments on #23222).

This makes constant.Values of Kind String no longer meaningful for ==, which
required fixes in go/types. While there, also fix go/types handling of constant.Values
of Kind Int (for uint64), Float, and Complex.

Change-Id: I80867bc9c4232c5c9b213443ff16645434a68b36
Reviewed-on: https://go-review.googlesource.com/86395
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocmd/go: skip long tests in -short mode
Russ Cox [Thu, 4 Jan 2018 22:22:29 +0000 (17:22 -0500)]
cmd/go: skip long tests in -short mode

I marked every test that takes more than 0.5 seconds on my machine
as something to run only when not in -short mode, or in -short mode
on the beefy linux/amd64, windows/amd64, and darwin/amd64 builders.

I also shortened a few needlessly-expensive tests where possible.

Cuts the time for go test -short cmd/go from 45s to 15s on my machine.
Should help even more on some of our builders and slower user machines.

Fixes #23287.

Change-Id: I0e36003ef947b0ebe4224a1373731f9fa9216843
Reviewed-on: https://go-review.googlesource.com/86252
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http: document internal error errServerClosedIdle more
Brad Fitzpatrick [Fri, 5 Jan 2018 17:03:51 +0000 (17:03 +0000)]
net/http: document internal error errServerClosedIdle more

Updates #19943

Change-Id: Iea249be51a7af3264bee9ee2b28dbd91043275fc
Reviewed-on: https://go-review.googlesource.com/86375
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http: don't validate WriteHeader code if header's already been sent
Brad Fitzpatrick [Thu, 4 Jan 2018 22:26:20 +0000 (22:26 +0000)]
net/http: don't validate WriteHeader code if header's already been sent

Also vendors x/net/http git rev 42fe2e1c for:

    http2: don't check WriteHeader status if we've already sent the header
    https://golang.org/cl/86255

Fixes #23010

Change-Id: I4f3dd63acb52d5a34a0350aaf847a7a376d6968f
Reviewed-on: https://go-review.googlesource.com/86275
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http: document CONNECT more
Brad Fitzpatrick [Thu, 4 Jan 2018 23:36:16 +0000 (23:36 +0000)]
net/http: document CONNECT more

Fixes #22554

Change-Id: I624f2883489a46d7162c11f489c2f0a0ec5a836f
Reviewed-on: https://go-review.googlesource.com/86277
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http: soften wording around when the Transport reuses connections
Brad Fitzpatrick [Thu, 4 Jan 2018 23:06:31 +0000 (23:06 +0000)]
net/http: soften wording around when the Transport reuses connections

The docs were too specific. Make it vaguer. There are conditions for
which the Transport will try to reuse a connection anyway, even if the
Response Body isn't read to EOF or closed, but we don't need to get
into all the details in the docs.

Fixes #22954

Change-Id: I3b8ae32aeb1a61b396d0026e129552afbfecceec
Reviewed-on: https://go-review.googlesource.com/86276
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix build failure in -x test
Russ Cox [Thu, 4 Jan 2018 20:09:21 +0000 (15:09 -0500)]
cmd/go: fix build failure in -x test

CL 84735 strengthened the -x test to make sure commands succeed,
using set -e, but the gcc flag tests can fail. Change them to say || true.

Fixes #23337.

Change-Id: I01e4017cb36ceb147b56935c2636de52ce7bdfdb
Reviewed-on: https://go-review.googlesource.com/86239
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocrypto/tls: optional "certificate_status" with OCSP
Brad Burch [Thu, 4 Jan 2018 06:42:10 +0000 (00:42 -0600)]
crypto/tls: optional "certificate_status" with OCSP

Follows the wording in RFC4366 more precisely which allows a server
to optionally return a "certificate_status" when responding to a
client hello containing "status_request" extension.

fixes #8549

Change-Id: Ib02dc9f972da185b25554568fe6f8bc411d9c0b7
Reviewed-on: https://go-review.googlesource.com/86115
Reviewed-by: Adam Langley <agl@golang.org>
6 years agomath/rand: typo fixed in documentation of seedPos
Paul PISCUC [Thu, 4 Jan 2018 20:25:04 +0000 (21:25 +0100)]
math/rand: typo fixed in documentation of seedPos

In the comment of seedPost, the word: condiiton was changed to: condition

Change-Id: I8967cc0e9f5d37776bada96cc1443c8bf46e1117
Reviewed-on: https://go-review.googlesource.com/86156
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agospec: consistently use "element" rather than "value" for map entry values
Robert Griesemer [Wed, 3 Jan 2018 18:33:11 +0000 (10:33 -0800)]
spec: consistently use "element" rather than "value" for map entry values

The spec refers to a map's key and element types; thus the respective
values are "keys" and "elements". Also, a map value is the value of
the entire map.

Similar fix for channels, where appropriate.

Fixes #23254.

Change-Id: I6f03ea6d86586c7b0b3e84f0c2e9446b8109fa53
Reviewed-on: https://go-review.googlesource.com/85999
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agosync: document when and when not to use Map
Russ Cox [Wed, 13 Dec 2017 16:49:26 +0000 (11:49 -0500)]
sync: document when and when not to use Map

Fixes #21587.

Change-Id: I47eb181d65da67a3b530c7f8acac9c0c619ea474
Reviewed-on: https://go-review.googlesource.com/83796
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/test2json: fix test log output containing test output
Russ Cox [Thu, 4 Jan 2018 18:25:31 +0000 (13:25 -0500)]
cmd/test2json: fix test log output containing test output

If test case framing appears in ordinary test output,
then test2json can get confused. If the fake framing is being
saved with t.Logf/t.Errorf/etc then we can already
distinguish it from real framing, and the code did.
It just forgot to write that framing as output (1-line fix).

If the fake framing is being generated by printing directly
to stdout/stderr, then test2json will simply get confused.
There's not a lot to do at that point (maybe it's even a feature).

Fixes #23036.

Change-Id: I29449c7ace304172b89d8babe23de507c0500455
Reviewed-on: https://go-review.googlesource.com/86238
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix caching of test -json outputs
Russ Cox [Thu, 14 Dec 2017 19:53:40 +0000 (14:53 -0500)]
cmd/go: fix caching of test -json outputs

go test -json was inadvertently disabling caching. Fix that.

Fixes #22984.

Change-Id: Ic933a8c8ac00ce8253e934766954b1ccc6ac0cec
Reviewed-on: https://go-review.googlesource.com/84075
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix coverage rebuild corner case
Russ Cox [Thu, 4 Jan 2018 18:07:44 +0000 (13:07 -0500)]
cmd/go: fix coverage rebuild corner case

If you have a package p1 with an xtest (package p1_test)
that imports p2, where p2 itself imports p1, then when
trying to do coverage for p1 we need to make sure to
recompile p2. The problem was that the overall package
import graph looked like:

    main -> p1_test -> p2 -> p1

Since we were recompiling p1 with coverage, we correctly
figured out that because p2 depends on a package being
recompiled due to coverage, p2 also needs to be split (forked) to
insert the dependency on the modified p1. But then we used
the same logic to split p1_test and main, with the effect that
the changes to p2 and p1_test and main were lost, since the
caller was still holding on to the original main, not the split version.

Change the code to treat main and p1_test as "already split"
and just update them in place.

Fixes #23314.

Change-Id: If7edeca6e39cdaeb5b9380d00b0c7d8c5891f086
Reviewed-on: https://go-review.googlesource.com/86237
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix compile -p flag for building test of main package
Russ Cox [Thu, 4 Jan 2018 17:27:32 +0000 (12:27 -0500)]
cmd/go: fix compile -p flag for building test of main package

Fixes #23180.

Change-Id: I52404ee98dcc60b96972d4242c13db0ec4340d0d
Reviewed-on: https://go-review.googlesource.com/86235
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: avoid race on allp in findrunnable
Austin Clements [Thu, 4 Jan 2018 15:43:29 +0000 (10:43 -0500)]
runtime: avoid race on allp in findrunnable

findrunnable loops over allp to check run queues *after* it has
dropped its own P. This is unsafe because allp can change when nothing
is blocking safe-points. Hence, procresize could change allp
concurrently with findrunnable's loop. Beyond generally violating Go's
memory model, in the best case this could findrunnable to observe a
nil P pointer if allp has been grown but the new slots not yet
initialized. In the worst case, the reads of allp could tear, causing
findrunnable to read a word that isn't even a valid *P pointer.

Fix this by taking a snapshot of the allp slice header (but not the
backing store) before findrunnable drops its P and iterating over this
snapshot. The actual contents of allp are immutable up to len(allp),
so this fixes the race.

Updates #23098 (may fix).

Change-Id: I556ae2dbfffe9fe4a1bf43126e930b9e5c240ea8
Reviewed-on: https://go-review.googlesource.com/86215
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: add -v option in the usage section for get
Agniva De Sarker [Thu, 4 Jan 2018 09:37:03 +0000 (15:07 +0530)]
cmd/go: add -v option in the usage section for get

Updates #23332

Change-Id: I964d36ed751ef1844ab6c40f61047297ff1443a3
Reviewed-on: https://go-review.googlesource.com/85797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/buildid: fix rewrite algorithm
Hiroshi Ioka [Tue, 19 Dec 2017 14:59:56 +0000 (23:59 +0900)]
cmd/buildid: fix rewrite algorithm

Update rewrite algorithm by coping code from
go/internal/work/buildid:updateBuildID.

Probably, this is not the best option. We could provide high-level API
in cmd/internal/buildid in the future.

Fixes #23181

Change-Id: I336a7c50426ab39bc9998b55c372af61a4fb21a7
Reviewed-on: https://go-review.googlesource.com/84735
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agodoc/diagnostics: update gc flags recommended for debugging
Hana Kim [Tue, 19 Dec 2017 20:06:57 +0000 (15:06 -0500)]
doc/diagnostics: update gc flags recommended for debugging

After 1.10, gcflags apply to only the immediate target.

Change-Id: I3bf331c76041e7b533076cb2f3274e44aafff58a
Reviewed-on: https://go-review.googlesource.com/84775
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agoencoding/gob: avoid race on idToType
Ian Lance Taylor [Thu, 4 Jan 2018 01:50:47 +0000 (17:50 -0800)]
encoding/gob: avoid race on idToType

Fixes #23328

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

6 years agocmd/go, testing: test names don't have to be alphanumeric
Ian Lance Taylor [Wed, 3 Jan 2018 19:27:26 +0000 (11:27 -0800)]
cmd/go, testing: test names don't have to be alphanumeric

In func TestXxxx(*testing.T) the Xxxx can be anything that can appear
in an identifier, but can't start with a lowercase letter. Clarify the docs.

Fixes #23322

Change-Id: I5c297916981f7e3890ee955d12bc7422a75488e2
Reviewed-on: https://go-review.googlesource.com/86001
Reviewed-by: Rob Pike <r@golang.org>
6 years agonet: set CLOEXEC on sockets used for capability probes
Ian Lance Taylor [Wed, 3 Jan 2018 20:59:09 +0000 (12:59 -0800)]
net: set CLOEXEC on sockets used for capability probes

Fixes #22349

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

6 years agotime: revert CL 78735 (was: space padding using underscore)
Ian Lance Taylor [Wed, 3 Jan 2018 18:24:29 +0000 (10:24 -0800)]
time: revert CL 78735 (was: space padding using underscore)

CL 78735 description:

    time: add space padding layout strings(using underscore) for not only day but others

    As mentioned in #22802, only day component of layout string has space
    padding(represented by one underscore before its placeholder). This
    commit expands the rule for month, hour, minute and second.

    Updates #22802 (maybe fixes it)

Revert this CL because it breaks currently working formats that happen
to use underscores.

Fixes #23259

Change-Id: I64acaaca9b5b74785ee0f0be7910574e87daa649
Reviewed-on: https://go-review.googlesource.com/85998
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
6 years agonet: ignore TestDialerLocalAddr timeout failures on Darwin
Ian Lance Taylor [Wed, 3 Jan 2018 18:57:36 +0000 (10:57 -0800)]
net: ignore TestDialerLocalAddr timeout failures on Darwin

I don't know why these errors occur. Ignore them to avoid breaking the
build.

Updates #22019

Change-Id: Ia048e6d9b928e8e237b311ff3a364e7a23af4aa4
Reviewed-on: https://go-review.googlesource.com/86000
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: report connect error as coming from "connect"
Ian Lance Taylor [Wed, 3 Jan 2018 18:09:35 +0000 (10:09 -0800)]
net: report connect error as coming from "connect"

We retrieve an error using getsockopt with SO_ERROR. We were reporting
the error as coming from "getsockopt", but really it is coming from
"connect". It is not getsockopt that failed.

Fixes #19302

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

6 years agocmd/go: on Windows, disable cache if LocalAppData is not set
Ian Lance Taylor [Wed, 3 Jan 2018 17:55:02 +0000 (09:55 -0800)]
cmd/go: on Windows, disable cache if LocalAppData is not set

Fixes #23146

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

6 years agoruntime: always use 1MB stacks on 32-bit Windows
Austin Clements [Tue, 18 Jul 2017 14:42:45 +0000 (10:42 -0400)]
runtime: always use 1MB stacks on 32-bit Windows

Commit c2c07c7989 (CL 49331) changed the linker and runtime to always
use 2MB stacks on 64-bit Windows. This is the corresponding change to
make 32-bit Windows always use large (1MB) stacks because it's
difficult to detect when Windows applications will call into arbitrary
C code that may expect a large stack.

This is done as a separate change because it's possible this will
cause too much address space pressure for a 32-bit address space. On
the other hand, cgo binaries on Windows already use 1MB stacks and
there haven't been complaints.

Updates #20975.

Change-Id: I8ce583f07cb52254fb4bd47250f1ef2b789bc490
Reviewed-on: https://go-review.googlesource.com/49610
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agodatabase/sql: fix nil pointer use within withLock
Daniel Theophanes [Thu, 21 Dec 2017 17:31:39 +0000 (09:31 -0800)]
database/sql: fix nil pointer use within withLock

During the refactor in 1126d1483f0397648905fcd4590ae45352cabd69 I
introduced a logical error within one withLock function that used
the result of the call before checking for the error. Change
the order so that the error is checked before the result is used.

None of the other withLock uses have similar issues.

Fixes #23208

Change-Id: I6c5dcf262e36bad4369c850f1e0131066360a82e
Reviewed-on: https://go-review.googlesource.com/85175
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc/go1.10: mention new os.IsTimeout function
Ian Lance Taylor [Wed, 3 Jan 2018 00:37:48 +0000 (16:37 -0800)]
doc/go1.10: mention new os.IsTimeout function

Change-Id: I84fd3912163ca262df5d7d4690c0dd7e136e79ca
Reviewed-on: https://go-review.googlesource.com/85938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: disable "redundant zeroextensions" optimization for Select on AMD64
Cherry Zhang [Tue, 2 Jan 2018 20:20:19 +0000 (15:20 -0500)]
cmd/compile: disable "redundant zeroextensions" optimization for Select on AMD64

A Select Op could produce a value with upper 32 bits NOT zeroed,
for example, Div32 is lowered to (Select0 (DIVL x y)).

In theory, we could look into the argument of a Select to decide
whether the upper bits are zeroed. As it is late in release cycle,
just disable this optimization for Select for now.

Fixes #23305.

Change-Id: Icf665a2af9ccb0a7ba0ae00c683c9e349638bf85
Reviewed-on: https://go-review.googlesource.com/85736
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
6 years agonet/http: relax the matching of strace output in test
Caio Marcelo de Oliveira Filho [Tue, 2 Jan 2018 01:17:14 +0000 (17:17 -0800)]
net/http: relax the matching of strace output in test

Modify the regex in TestLinuxSendfile to not match the parameters of
the syscall, just its name and the opening parenthesis. This is enough
to recognize that the syscall was invoked.

This fixes the TestLinuxSendfile test when running in Clear Linux,
where strace always execute with -yy implied, having output with extra
information in the parameters:

    [pid  5336] sendfile(6<TCP:[127.0.0.1:35007->127.0.0.1:55170]>, 8</home/c/src/go/src/net/http/testdata/index.html>, NULL, 22) = 22

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

6 years agomath: correct result for Pow(x, ±.5)
Brian Kessler [Sat, 30 Dec 2017 08:27:28 +0000 (01:27 -0700)]
math: correct result for Pow(x, ±.5)

Fixes #23224

The previous Pow code had an optimization for
powers equal to ±0.5 that used Sqrt for
increased accuracy/speed.  This caused special
cases involving powers of ±0.5 to disagree with
the Pow spec.  This change places the Sqrt optimization
after all of the special case handling.

Change-Id: I6bf757f6248256b29cc21725a84e27705d855369
Reviewed-on: https://go-review.googlesource.com/85660
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoreflect: explicitly state that Type values can be used as map keys
Tim Cooper [Mon, 1 Jan 2018 16:11:58 +0000 (12:11 -0400)]
reflect: explicitly state that Type values can be used as map keys

Fixes #6535

Change-Id: I34974c0050424c96d19ad69bf4522bb69cde2fd5
Reviewed-on: https://go-review.googlesource.com/85815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: 2018 is the Year of the Gopher
Brad Fitzpatrick [Mon, 1 Jan 2018 02:04:51 +0000 (02:04 +0000)]
doc: 2018 is the Year of the Gopher

Change-Id: Ie167512e000f3a8be0ff8a6a9edd52bd74f45115
Reviewed-on: https://go-review.googlesource.com/85775
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agocrypto/tls: document VerifyPeerCertificate behavior in relation to ClientAuth
Filippo Valsorda [Sat, 16 Dec 2017 13:35:52 +0000 (09:35 -0400)]
crypto/tls: document VerifyPeerCertificate behavior in relation to ClientAuth

Change-Id: I3ff478912a5a178492d544d2f4ee9cc7570d9acc
Reviewed-on: https://go-review.googlesource.com/84475
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/xml: remove duplicate test of element presence
Igor Vashyst [Sat, 30 Dec 2017 21:13:28 +0000 (23:13 +0200)]
encoding/xml: remove duplicate test of element presence

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

6 years agoos: document that StartProcess's argv starts with the binary name
Brad Fitzpatrick [Fri, 29 Dec 2017 01:15:23 +0000 (01:15 +0000)]
os: document that StartProcess's argv starts with the binary name

Fixes #23277

Change-Id: Idbe09913c95dc951b9b195eb7ff1e75d2bb4d63d
Reviewed-on: https://go-review.googlesource.com/85675
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/vendor/golang.org/x/arch: revendor at commit 98fd8d9
Cherry Zhang [Wed, 27 Dec 2017 13:33:45 +0000 (08:33 -0500)]
cmd/vendor/golang.org/x/arch: revendor at commit 98fd8d9

Pick up CL 85476 to fix #23237.

Updates #23237.

Change-Id: I31a48ef39ce90bc1424334762452281ae706d273
Reviewed-on: https://go-review.googlesource.com/85495
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet: revert CL 82975
Jeff Johnson [Fri, 22 Dec 2017 16:30:39 +0000 (08:30 -0800)]
net: revert CL 82975

this solution as it stands doesn't work with
non-english device names (golang/go#23191 (which has a fix))
and names some devices differently (golang/go#23153) probably due to the
fact that this test previously only ran on Server 2008.

Re-opens golang/go#20073

Change-Id: I5c36774ddd85ac07620b4015372d564acbb169ad
Reviewed-on: https://go-review.googlesource.com/85315
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agospec: provide some (minimal) intuition for the notion of "terminating statement"
Robert Griesemer [Thu, 21 Dec 2017 23:17:35 +0000 (15:17 -0800)]
spec: provide some (minimal) intuition for the notion of "terminating statement"

Fixes #23215.

Change-Id: Ib20825bf08915b4daaabbfd91f168e24973c512d
Reviewed-on: https://go-review.googlesource.com/85215
Reviewed-by: Rob Pike <r@golang.org>
6 years agocmd/compile: additional test cleanup
David Chase [Wed, 20 Dec 2017 20:27:44 +0000 (15:27 -0500)]
cmd/compile: additional test cleanup

Refactoring to make it slightly easier to add tests,
easier to add variable-printing-support for Delve,
and made naming and tagging more consistent.

No changes to the content of the test itself or when it is
run.

Change-Id: I374815b65a203bd43b27edebd90b859466d1c33b
Reviewed-on: https://go-review.googlesource.com/84979
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
6 years agocmd/internal/obj/arm: fix wrong encoding of NMULAF/NMULAD/NMULSF/NMULSD
Ben Shi [Thu, 21 Dec 2017 11:29:24 +0000 (11:29 +0000)]
cmd/internal/obj/arm: fix wrong encoding of NMULAF/NMULAD/NMULSF/NMULSD

NMULAF/NMULAD/NMULSF/NMULSD are incorrectly encoded by the arm
assembler.

Instruction            Right binary      Current wrong binary
"NMULAF F5, F6, F7"    0xee167a45        0xee167a05
"NMULAD F5, F6, F7"    0xee167b45        0xee167b05
"NMULSF F5, F6, F7"    0xee167a05        0xee167a45
"NMULSD F5, F6, F7"    0xee167b05        0xee167b45

This patch fixes this issue.

fixes issue #23212

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

6 years agogo/types: document Typ slice
Robert Griesemer [Wed, 20 Dec 2017 23:14:05 +0000 (15:14 -0800)]
go/types: document Typ slice

Fixes #22628.

Change-Id: Ib7aff8043e477af18c448d6b778f159b23fb5a92
Reviewed-on: https://go-review.googlesource.com/85075
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/trace: init goroutine info entries with GoCreate event
Hana Kim [Tue, 12 Dec 2017 23:20:06 +0000 (18:20 -0500)]
cmd/trace: init goroutine info entries with GoCreate event

golang.org/cl/81315 attempted to distinguish system goroutines
by examining the function name in the goroutine stack. It assumes that
the information would be available when GoSysBlock or GoInSyscall
events are processed, but it turned out the stack information is
set too late (when the goroutine gets a chance to run).

This change initializes the goroutine information entry when
processing GoCreate event which should be one of the very first
events for the every goroutine in trace.

Fixes #22574

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

6 years agocmd/compile: second attempt at fix for issue 23179
Than McIntosh [Wed, 20 Dec 2017 14:54:13 +0000 (09:54 -0500)]
cmd/compile: second attempt at fix for issue 23179

My previous fix for issue 23179 was incomplete; it turns out that if
an unnamed parameter is below a specific size threshold, it gets
register-promoted away by the compiler (hence not encountered during
some parts of DWARF inline info processing), but if it is sufficiently
large, it is allocated to the stack as a named variable and treated as
a regular parameter by DWARF generation. Interestingly, something in
the ppc64le build of k8s causes an unnamed parameter to be retained
(where on amd64 it is deleted), meaning that this wasn't caught in my
amd64 testing.

The fix is to insure that "_" params are treated in the same way that
"~r%d" return temps are when matching up post-optimization inlined
routine params with pre-inlining declarations. I've also updated the
test case to include a "_" parameter with a very large size, which
also triggers the bug on amd64.

Fixes #23179.

Change-Id: I961c84cc7a873ad3f8f91db098a5e13896c4856e
Reviewed-on: https://go-review.googlesource.com/84975
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agocmd/doc: suppress the error message for *package.ident embedded in struct type
elpinal [Sat, 16 Dec 2017 06:04:05 +0000 (15:04 +0900)]
cmd/doc: suppress the error message for *package.ident embedded in struct type

The current implementation prints a log, "invalid program: unexpected
type for embedded field", when the form *package.ident is embedded in
a struct declaration.

Note that since valid qualified identifiers must be exported, the result
for a valid program does not change.

Change-Id: If8b9d7056c56b6a6c5482eb749168a63c65ef685
Reviewed-on: https://go-review.googlesource.com/84436
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/compile: fix spelling error
Kevin Burke [Tue, 19 Dec 2017 20:31:14 +0000 (12:31 -0800)]
cmd/compile: fix spelling error

Change-Id: Ifc533ee98a7684060d20340087c1b29f722ae46b
Reviewed-on: https://go-review.googlesource.com/84835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix corner case in DWARF inline info generation
Than McIntosh [Tue, 19 Dec 2017 17:08:32 +0000 (12:08 -0500)]
cmd/compile: fix corner case in DWARF inline info generation

The helper routine for returning pre-inlining parameter declarations
wasn't properly handling the case where you have more than one
parameter named "_" in a function signature; this triggered a map
collision later on when the function was inlined and DWARF was
generated for the inlined routine instance.

Fixes #23179.

Change-Id: I12e5d6556ec5ce08e982a6b53666a4dcc1d22201
Reviewed-on: https://go-review.googlesource.com/84755
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agodatabase/sql/driver: update Value doc, can be driver supported type
Daniel Theophanes [Mon, 18 Dec 2017 20:13:17 +0000 (12:13 -0800)]
database/sql/driver: update Value doc, can be driver supported type

The driver.Value type may be more then the documented 6 types if the
database driver supports it. Document that fact.

Updates #23077

Change-Id: If7e2112fa61a8cc4e155bb31e94e89b20c607242
Reviewed-on: https://go-review.googlesource.com/84636
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/internal/link: disable selected DWARF tests on Solaris
Than McIntosh [Mon, 18 Dec 2017 18:58:41 +0000 (13:58 -0500)]
cmd/internal/link: disable selected DWARF tests on Solaris

Disable the three linker DWARF tests that invoke the compiler in
non-debug mode on Solaris, since this seems to trigger a split stack
overflow. These can be turned back on once the issue in question is
resolved.

Updates #23168.

Change-Id: I5be1b098e33e8bad3bc234a0964eab1dee7e7954
Reviewed-on: https://go-review.googlesource.com/84655
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>

6 years agogo/types: rename (historic) flag "-list" used for go/types testing
Robert Griesemer [Sat, 16 Dec 2017 01:06:43 +0000 (17:06 -0800)]
go/types: rename (historic) flag "-list" used for go/types testing

Rename -list flag to -errlist to avoid confusion with the go
test flag -list (introduced later).

This flag is only needed to get an error list when running the
go/types test harness manually on select files, e.g., as in:

go test -run=Check -files=x.go -errlist

Change-Id: I67febcf968d2d8f4ff00c81eea7b2df723560eac
Reviewed-on: https://go-review.googlesource.com/84378
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: clean up debug_test.go
David Chase [Thu, 14 Dec 2017 18:41:13 +0000 (13:41 -0500)]
cmd/compile: clean up debug_test.go

Exercise of preparing a how-to document motivated me to
clean up some of the stupider wonkier bits.  Since this
does not run for test -short, expect no change for trybots,
did pass testing with OSX gdb and a refreshed copy of Delve.

Change-Id: I58edd10599b172c4787ff5f110db078f6c2c81c5
Reviewed-on: https://go-review.googlesource.com/83957
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agocmd/link: make inlining+locationlist test depend on GOARCH
David Chase [Fri, 15 Dec 2017 20:56:51 +0000 (15:56 -0500)]
cmd/link: make inlining+locationlist test depend on GOARCH

Location lists are only supported on x86 and amd64, so the
test expecting them failed everywhere else. Make that test
skip unless GOARCH is x86 or amd64.

Change-Id: Id86b34d30c6a0b97e6fa0cd5aca31f51ed84f556
Reviewed-on: https://go-review.googlesource.com/84395
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoos: mention the influence of umask in docs
Matthijs Kooijman [Wed, 13 Dec 2017 15:45:09 +0000 (16:45 +0100)]
os: mention the influence of umask in docs

Change-Id: Ia05fac3298334d6b44267ce02bffcd7bf8a54c72
Reviewed-on: https://go-review.googlesource.com/83775
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/dist: let misc/cgo/testshared test timeout be scaled by slow builder
Brad Fitzpatrick [Fri, 15 Dec 2017 16:34:39 +0000 (16:34 +0000)]
cmd/dist: let misc/cgo/testshared test timeout be scaled by slow builder

The default test timeout is 10 minutes if unspecified.

The misc/cgo/testshared test didn't use t.timeout(sec), which respects
GO_TEST_TIMEOUT_SCALE, so all builders got the default 10 minute
timeout. arm5 needs more, though, so specify 10 minutes explicitly,
which will then get scaled accordingly on slower builders.

Change-Id: I19ecfdcd9c865f2b69524484415b8fbd2852718e
Reviewed-on: https://go-review.googlesource.com/84315
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agocmd/compile: fixes for bad DWARF abstract origin references
Than McIntosh [Mon, 11 Dec 2017 20:53:31 +0000 (15:53 -0500)]
cmd/compile: fixes for bad DWARF abstract origin references

Change the compiler's DWARF inline info generation to be more careful
about producing consistent instances of abstract function DIEs. The
new strategy is to insure that the only params/variables created in an
abstract subprogram DIE are those corresponding to declarations in the
original pre-inlining version of the code. If a concrete subprogram
winds up with other vars as part of the compilation process (return
temps, for example, or scalars generated by splitting a structure into
pieces) these are emitted as regular param/variable DIEs instead of
concrete DIEs.

The linker dwarf test now has a couple of new testpoints that include
checks to make sure that all abstract DIE references are
sane/resolvable; this will help catch similar problems in the future.

Fixes #23046.

Change-Id: I9b0030da8673fbb80b7ad50461fcf8c6ac823a37
Reviewed-on: https://go-review.googlesource.com/83675
Run-TryBot: Than McIntosh <thanm@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: symbolize morestack caller in throwsplit panic
Austin Clements [Thu, 14 Dec 2017 20:32:12 +0000 (15:32 -0500)]
runtime: symbolize morestack caller in throwsplit panic

This attempts to symbolize the PC of morestack's caller when there's a
stack split at a bad time. The stack trace starts at the *caller* of
the function that attempted to grow the stack, so this is useful if it
isn't obvious what's being called at that point, such as in #21431.

Change-Id: I5dee305d87c8069611de2d14e7a3083d76264f8f
Reviewed-on: https://go-review.googlesource.com/84115
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>