Bryan C. Mills [Thu, 15 Dec 2016 22:21:13 +0000 (14:21 -0800)]
runtime: preserve callee-saved C registers in sigtramp
This fixes Linux and the *BSD platforms on 386/amd64.
A few OS/arch combinations were already saving registers and/or doing
something that doesn't clearly resemble the SysV C ABI; those have
been left alone.
Fixes #18328.
Change-Id: I6398f6c71020de108fc8b26ca5946f0ba0258667
Reviewed-on: https://go-review.googlesource.com/34501
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Brad Fitzpatrick [Thu, 15 Dec 2016 16:18:45 +0000 (16:18 +0000)]
net/http: deflake TestServerTimeouts maybe
I haven't been able to reproduce this one, but change a few suspect
things in this test. Notably, using the global "Get" function and thus
using the DefaultTransport was buggy in a parallel test. Then add some error
checks and close a TCP connection.
Hopefully the failure wasn't timing-related.
Fixes #18036 (I hope)
Change-Id: I4904e42e40b26d488cf82111424a1d4d46f42dae
Reviewed-on: https://go-review.googlesource.com/34490
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara [Thu, 15 Dec 2016 09:00:12 +0000 (18:00 +0900)]
net: fix comment on IPv4bcast
In Go 1.8, almost all the platforms except NaCl provide network
interface and address identification and applications can use IPv4
limited or directed broadcast addresses appropriately.
Raul Silvera [Wed, 14 Dec 2016 21:32:18 +0000 (13:32 -0800)]
cmd/pprof: search for sample types in profile
Search the sample types in the profile being processed to map
sample type options to indices in the profile sample type array.
Previously these were hardcoded, which caused issues when the
sample types for a profile type changed. For instance, this was
triggered by the native generation of profiles in profile.proto
format.
This fixes #18230. A similar mechanism already exists on the upstream
pprof.
Change-Id: I945d8d842a0c2ca14299dabefe83124746ecd7e2
Reviewed-on: https://go-review.googlesource.com/34382 Reviewed-by: Michael Matloob <matloob@golang.org>
David Crawshaw [Wed, 14 Dec 2016 19:48:58 +0000 (14:48 -0500)]
cmd/go, plugin: disable plugins on darwin
We are seeing a bad stack map in #18190. In a copystack, it is
mistaking a slot for a pointer.
Presumably this is caused either by our fledgling dynlink support on
darwin, or a consequence of having two copies of the runtime in the
process. But I have been unable to work out which in the 1.8 window,
so pushing darwin support to 1.9 or later.
Change-Id: I7fa4d2dede75033d9a428f24c1837a4613bd2639
Reviewed-on: https://go-review.googlesource.com/34391 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Brad Fitzpatrick [Wed, 14 Dec 2016 23:17:13 +0000 (23:17 +0000)]
net/http/httptrace: clarify WroteRequest may be called multiple times
Updates #18305
Change-Id: I63b28d511df1a6c54e32c8bfc7e2264f94e38cd7
Reviewed-on: https://go-review.googlesource.com/34386 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Vladimir Stefanovic [Tue, 13 Dec 2016 21:35:26 +0000 (22:35 +0100)]
test: enable fixedbugs/issue10607 test on GOARCH=mips{,le}
Change-Id: I00c97c36e8fdc79582eaed21877e4c8f44568666
Reviewed-on: https://go-review.googlesource.com/34316 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Vladimir Stefanovic [Tue, 13 Dec 2016 21:54:19 +0000 (22:54 +0100)]
cmd/objdump: disable objdump_test with external linking on GOARCH=mips{,le}
Updates #12559.
Change-Id: I5e8f4cf7071d0d71618527a6b6096e771d5eeb28
Reviewed-on: https://go-review.googlesource.com/34317 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
David Crawshaw [Sat, 10 Dec 2016 18:30:13 +0000 (13:30 -0500)]
cmd/link: do not export plugin C symbols
Explicitly filter any C-only cgo functions out of pclntable,
which allows them to be duplicated with the host binary.
Updates #18190.
Change-Id: I50d8706777a6133b3e95f696bc0bc586b84faa9e
Reviewed-on: https://go-review.googlesource.com/34199 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Brad Fitzpatrick [Wed, 14 Dec 2016 18:57:13 +0000 (18:57 +0000)]
net/http: deflake TestClientTimeout_Headers_h2 on Windows
The client code was using time.Now() (wall time) to determine whether
the cause of a non-nil error meant that a timeout had occured. But on
Windows, the clock used for timers (time.After, time.Sleep, etc) is
much more accurate than the time.Now clock, which doesn't update
often.
But it turns out that as of the recent https://golang.org/cl/32478 we
already have the answer available easily. It just wasn't in scope.
Instead of passing this information along by decorating the errors
(risky this late in Go 1.8, especially with #15935 unresolved), just
passing along the "didTimeout" func internally for now. We can remove
that later in Go 1.9 if we overhaul Transport errors.
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>
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>
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>
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>
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>
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>
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>
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.
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.
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>
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>
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
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>
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>
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>
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.
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>
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().
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>
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.
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.
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>
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>
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>
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>
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>