]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
8 years ago[release-branch.go1.6] cmd/newlink: remove from release branch go1.6rc1
Chris Broadfoot [Wed, 27 Jan 2016 23:44:35 +0000 (15:44 -0800)]
[release-branch.go1.6] cmd/newlink: remove from release branch

Change-Id: Iec73b9a4279b5d6b458615c265e75b6becff320e
Reviewed-on: https://go-review.googlesource.com/19023
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years ago[release-branch.go1.6] go1.6rc1
Chris Broadfoot [Wed, 27 Jan 2016 23:23:52 +0000 (15:23 -0800)]
[release-branch.go1.6] go1.6rc1

Change-Id: If8b5d7fd5f93d6aef2f746ae3cfd937b259be79e
Reviewed-on: https://go-review.googlesource.com/19022
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: handle kindString in cgoCheckArg
Ian Lance Taylor [Wed, 27 Jan 2016 22:07:25 +0000 (14:07 -0800)]
runtime: handle kindString in cgoCheckArg

It's awkward to get a string value in cgoCheckArg, but SWIG testing
revealed that it is possible.  The new handling of extra files in the
ptr.go test emulates what SWIG does with an exported function that
returns a string.

Change-Id: I453717f867b8a49499576c28550e7c93053a0cf8
Reviewed-on: https://go-review.googlesource.com/19020
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agomisc/cgo/test: disable sigaltstack test on darwin/386
Russ Cox [Wed, 27 Jan 2016 22:24:03 +0000 (17:24 -0500)]
misc/cgo/test: disable sigaltstack test on darwin/386

It doesn't work there ("out of memory") and doesn't really matter.
Fixes build (now that we enable cgo on the darwin/386 builder.)

Change-Id: I1d91e51ecb88c54eae39ac9a76f2c0b4e45263b0
Reviewed-on: https://go-review.googlesource.com/19004
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: deflake TestNumGoroutine
Russ Cox [Wed, 27 Jan 2016 21:21:33 +0000 (16:21 -0500)]
runtime: deflake TestNumGoroutine

Fixes #14107.

Change-Id: Icd9463b1a77b139c7ebc2d8732482d704ea332d0
Reviewed-on: https://go-review.googlesource.com/19002
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime/cgo: more +build cgo tags
Russ Cox [Wed, 27 Jan 2016 21:27:03 +0000 (16:27 -0500)]
runtime/cgo: more +build cgo tags

Followup to CL 19001.

Change-Id: I7fa838b1ee8df53229e9dd29a231c2f9b2aa3f69
Reviewed-on: https://go-review.googlesource.com/19003
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/internal/obj/x86: skip test when GOHOSTARCH is set
Brad Fitzpatrick [Wed, 27 Jan 2016 21:18:35 +0000 (13:18 -0800)]
cmd/internal/obj/x86: skip test when GOHOSTARCH is set

It's causing the darwin-386 builder to fail with:

--- FAIL: TestDynlink (0.07s)
    obj6_test.go:118: error exit status 3 output go tool: no such tool "asm"
FAIL
FAIL    cmd/internal/obj/x86    0.073s

So skip it for now. It's tested in enough other places.

Change-Id: I9a98ad7b8be807005750112d892ac6c676c17dd5
Reviewed-on: https://go-review.googlesource.com/18989
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime/cgo: add cgo build tag to C files
Russ Cox [Wed, 27 Jan 2016 20:58:52 +0000 (15:58 -0500)]
runtime/cgo: add cgo build tag to C files

This makes "CGO_ENABLED=0 go list runtime/cgo" work,
which fixes the current cmd/go test failure.

Change-Id: Ia55ce3ba1dbb09f618ae5f4c8547722670360f59
Reviewed-on: https://go-review.googlesource.com/19001
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime/race: run tests with GOMAXPROCS=1
Dmitry Vyukov [Wed, 27 Jan 2016 18:22:28 +0000 (19:22 +0100)]
runtime/race: run tests with GOMAXPROCS=1

We set GOMAXPROCS=1 to prevent test flakiness.
There are two sources of flakiness:
1. Some tests rely on particular execution order.
   If the order is different, race does not happen at all.
2. Ironically, ThreadSanitizer runtime contains a logical race condition
   that can lead to false negatives if racy accesses happen literally at the same time.
Tests used to work reliably in the good old days of GOMAXPROCS=1.
So let's set it for now. A more reliable solution is to explicitly annotate tests
with required execution order by means of a special "invisible" synchronization primitive
(that's what is done for C++ ThreadSanitizer tests). This is issue #14119.

This reduces flakes on RaceAsFunc3 test from 60/3000 to 1/3000.

Fixes #14086
Fixes #14079
Fixes #14035

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

8 years agoruntime: remove redundant empty function call from Breakpoint on arm
Richard Miller [Wed, 27 Jan 2016 19:10:11 +0000 (19:10 +0000)]
runtime: remove redundant empty function call from Breakpoint on arm

CL 18964 included an extra patch (sorry, my first experience of
git-codereview) which defined the conventional breakpoint instruction
used by Plan 9 on arm, but also introduced a benign but unneeded
call to runtime.emptyfunc.  This CL removes the redundant call again.

This completes the series of CLs which add support for Plan 9 on arm.

Change-Id: Id293cfd40557c9d79b4b6cb164ed7ed49295b178
Reviewed-on: https://go-review.googlesource.com/19010
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: mention ServeFile change in go1.6.html
Russ Cox [Wed, 27 Jan 2016 16:02:45 +0000 (11:02 -0500)]
doc: mention ServeFile change in go1.6.html

Also fix a few bad links.

Change-Id: If04cdd312db24a827a3c958a9974c50ab148656c
Reviewed-on: https://go-review.googlesource.com/18979
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go: refine definition of 'standard' import paths to include vendored code
Russ Cox [Wed, 27 Jan 2016 15:05:18 +0000 (10:05 -0500)]
cmd/go: refine definition of 'standard' import paths to include vendored code

The vendored copy of golang.org/x/net/http/hpack was being treated
as not standard, which in turn was making it not subject to the mtime
exception for rebuilding the standard library in a release, which in turn
was making net/http look out of date.

One fix and three tests:

- Fix the definition of standard.
- Test that everything in $GOROOT/src/ is standard during 'go test cmd/go'.
(In general there can be non-standard things in $GOROOT/src/, but this
test implies that you can do that or you can run 'go test cmd/go',
but not both. That's fine.)
- Test that 'go list std cmd' shows our vendored code.
- Enforce that no standard package can depend on a non-standard one.

Also fix a few error printing nits.

Fixes #13713.

Change-Id: I1f943f1c354174c199e9b52075c11ee44198e81b
Reviewed-on: https://go-review.googlesource.com/18978
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agounsafe: clarify wording in recent Alignof changes
Ian Lance Taylor [Wed, 27 Jan 2016 17:23:48 +0000 (09:23 -0800)]
unsafe: clarify wording in recent Alignof changes

Change-Id: I595379d2f02b0a43735f0375758e4997ce3b64a7
Reviewed-on: https://go-review.googlesource.com/18986
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: mention signal changes for c-archive/c-shared
Ian Lance Taylor [Wed, 27 Jan 2016 14:42:10 +0000 (06:42 -0800)]
doc: mention signal changes for c-archive/c-shared

Change-Id: Ibba7fccba9617612e026bd0a208eb12918de465a
Reviewed-on: https://go-review.googlesource.com/18985
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet/http: add protections against misuse of ServeFile
Brad Fitzpatrick [Tue, 26 Jan 2016 19:57:19 +0000 (19:57 +0000)]
net/http: add protections against misuse of ServeFile

Martin Lenord pointed out that bad patterns have emerged in online
examples of how to use ServeFile, where people pass r.URL.Path[1:] to
ServeFile. This is unsafe. Document that it's unsafe, and add some
protections.

Fixes #14110

Change-Id: Ifeaa15534b2b3e46d3a8137be66748afa8fcd634
Reviewed-on: https://go-review.googlesource.com/18939
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agocmd/go: recognise plan9_arm object files
Richard Miller [Wed, 27 Jan 2016 11:27:50 +0000 (11:27 +0000)]
cmd/go: recognise plan9_arm object files

Add magic word for Plan 9 ARM object header to objectMagic table.

Change-Id: I21eb8845a2ee2e8cdddc0849eedf43481aee9cde
Reviewed-on: https://go-review.googlesource.com/18963
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/link: correct byte ordering in plan9_arm object header
Richard Miller [Wed, 27 Jan 2016 11:49:58 +0000 (11:49 +0000)]
cmd/link: correct byte ordering in plan9_arm object header

Fields in Plan 9 object headers are big-endian, on all architectures.

Change-Id: If95ad29750b776338178d660646568bf26a4abda
Reviewed-on: https://go-review.googlesource.com/18964
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agounsafe: clarify that Alignof returns required alignment
Ian Lance Taylor [Wed, 27 Jan 2016 01:23:33 +0000 (17:23 -0800)]
unsafe: clarify that Alignof returns required alignment

Also document the special behavior of Alignof(s.f), and mention the
correspondence between Alignof and reflect.Type.{Align,FieldAlign}.

Change-Id: I6f81047a04c86887f1b1164473225616cae45a26
Reviewed-on: https://go-review.googlesource.com/18949
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodatabase/sql: implement Scan of time.Time, document, clarify Scan error text
Brad Fitzpatrick [Tue, 26 Jan 2016 20:58:00 +0000 (20:58 +0000)]
database/sql: implement Scan of time.Time, document, clarify Scan error text

Fixes #9157

Change-Id: Iadf305a172a0ec53ae91e1b2db3f3351691a48ff
Reviewed-on: https://go-review.googlesource.com/18935
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: fix upper bound on out-of-memory print
Russ Cox [Wed, 27 Jan 2016 03:13:01 +0000 (22:13 -0500)]
runtime: fix upper bound on out-of-memory print

It's possible for arena_start+MaxArena32 to wrap.
We do the right thing in the bounds check but not in the print.

For #13992 (to fix the print there, not the bug).

Change-Id: I4df845d0c03f0f35461b128e4f6765d3ccb71c6d
Reviewed-on: https://go-review.googlesource.com/18975
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: guard against array out of bounds in GoroutineProfile
Russ Cox [Wed, 27 Jan 2016 04:00:41 +0000 (23:00 -0500)]
runtime: guard against array out of bounds in GoroutineProfile

The previous CL is the real fix. This one is just insurance.

Fixes #14046 again.

Change-Id: I553349504bb1789e4b66c888dbe4034568918ad6
Reviewed-on: https://go-review.googlesource.com/18977
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: fix crash in GoroutineProfile
Russ Cox [Wed, 27 Jan 2016 03:58:59 +0000 (22:58 -0500)]
runtime: fix crash in GoroutineProfile

It was just completely broken if you gave it the number
of records it asked for. Make it impossible for that particular
inconsistency to happen again.

Also make it exclude system goroutines, to match both
NumGoroutine and Stack.

Fixes #14046.

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

8 years agocmd/go: disable broken test for code.google.com
Russ Cox [Wed, 27 Jan 2016 01:03:32 +0000 (20:03 -0500)]
cmd/go: disable broken test for code.google.com

For Go 1.7 we can remove all the code.google.com code
(except maybe the shutdown warning).

See #10193.

Change-Id: I4b8182eb66494f0bf373b40ca5da6ae4738342be
Reviewed-on: https://go-review.googlesource.com/18974
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: add more debug info to flaky TestNumGoroutine
Brad Fitzpatrick [Wed, 27 Jan 2016 00:09:50 +0000 (00:09 +0000)]
runtime: add more debug info to flaky TestNumGoroutine

This has been flaking on the new OpenBSD 5.8 builders lately:
https://storage.googleapis.com/go-build-log/808270e7/openbsd-amd64-gce58_61ce2663.log
(as one example)

Add more debug info when it fails.

Updates #14107

Change-Id: Ie30bc0c703d2e9ee993d1e232ffc5f2d17e65c97
Reviewed-on: https://go-review.googlesource.com/18938
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoruntime: make p.gcBgMarkWorker a guintptr
Austin Clements [Tue, 26 Jan 2016 19:44:58 +0000 (14:44 -0500)]
runtime: make p.gcBgMarkWorker a guintptr

Currently p.gcBgMarkWorker is a *g. Change it to a guintptr. This
eliminates a write barrier during the subtle mark worker parking dance
(which isn't known to be causing problems, but may).

Change-Id: Ibf12c05ac910820448059e69a68e5b882c993ed8
Reviewed-on: https://go-review.googlesource.com/18970
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: acquire stack lock in traceEvent
Austin Clements [Tue, 26 Jan 2016 22:26:55 +0000 (17:26 -0500)]
runtime: acquire stack lock in traceEvent

traceEvent records system call events after a G has already entered
_Gsyscall, which means the garbage collector could be installing stack
barriers in the G's stack during the traceEvent. If traceEvent
attempts to capture the user stack during this, it may observe a
inconsistent stack barriers and panic. Fix this by acquiring the stack
lock around the stack walk in traceEvent.

Fixes #14101.

Change-Id: I15f0ab0c70c04c6e182221f65a6f761c5a896459
Reviewed-on: https://go-review.googlesource.com/18973
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: attach mark workers to P after they park
Austin Clements [Wed, 20 Jan 2016 03:45:37 +0000 (22:45 -0500)]
runtime: attach mark workers to P after they park

Currently mark workers attach to their designated Ps before parking,
either during initialization or after performing a phase transition.
However, in both of these cases, it's possible that the mark worker is
running on a different P than the one it attaches to. This is a
problem, because as soon as the worker attaches to a P, that P's
scheduler can execute the worker. If the worker hasn't yet parked on
the P it's actually running on, this means the worker G will be
running in two places at once. The most visible consequence of this is
that once the first instance of the worker does park, it will clear
g.m and the second instance will crash shortly when it tries to use
g.m.

Fix this by moving the attach to the gopark callback. At this point,
the G is genuinely stopped and the callback is running on the system
stack, so it's safe for another P's scheduler to pick up the worker G.

Fixes #13363. Fixes #13978.

Change-Id: If2f7c4a4174f9511f6227e14a27c56fb842d1cc8
Reviewed-on: https://go-review.googlesource.com/18761
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>

8 years agocmd/internal/obj/arm64: adjust literal pool flush for span-dependent jump enlargement
Russ Cox [Tue, 26 Jan 2016 20:26:09 +0000 (15:26 -0500)]
cmd/internal/obj/arm64: adjust literal pool flush for span-dependent jump enlargement

The current code delays the literal pool until the very last moment,
but based on the assumption that span-dependent jumps are as
short as possible. If they need to be enlarged in a later round, that
very last moment may be too late. Flush a little early to prevent that.

Fixes #13579.

Change-Id: I759b5db5c43a977bf2b940872870cbbc436ad141
Reviewed-on: https://go-review.googlesource.com/18972
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agoarchive/zip: clarify expectations of RegisterCompressor and RegisterDecompressor
Joe Tsai [Thu, 14 Jan 2016 08:38:48 +0000 (00:38 -0800)]
archive/zip: clarify expectations of RegisterCompressor and RegisterDecompressor

Clarify that Compressor and Decompressor callbacks must support being invoked
concurrently, but that the writer or reader returned need not be.

Updates #8359

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

8 years agocmd/compile: remove -h spam
Russ Cox [Tue, 26 Jan 2016 16:50:51 +0000 (11:50 -0500)]
cmd/compile: remove -h spam

This debugging print crept into an earlier CL of mine.

Change-Id: If6e8609e69a60aec50c06889c2d98a8b8a4bd02b
Reviewed-on: https://go-review.googlesource.com/18971
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/rsa: expand on documentation and add some examples.
Adam Langley [Mon, 11 Jan 2016 02:30:27 +0000 (18:30 -0800)]
crypto/rsa: expand on documentation and add some examples.

In some cases the documentation for functions in this package was
lacking from the beginning and, in order cases, the documentation didn't
keep pace as the package grew.

This change somewhat addresses that.

Updates #13711.

Change-Id: I25b2bb1fcd4658c5417671e23cf8e644d08cb9ab
Reviewed-on: https://go-review.googlesource.com/18486
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agodoc: mention the need for a C compiler for cgo support
Brad Fitzpatrick [Tue, 26 Jan 2016 22:56:08 +0000 (22:56 +0000)]
doc: mention the need for a C compiler for cgo support

Fixes #13954

Change-Id: I4c01e9bb3fb08e8b9fa14d4c59b7ea824ba3f0c9
Reviewed-on: https://go-review.googlesource.com/18937
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agoruntime/pprof: retry failed tests with longer duration
Austin Clements [Fri, 15 Jan 2016 19:23:43 +0000 (14:23 -0500)]
runtime/pprof: retry failed tests with longer duration

Currently we run profiling tests for around 200ms in short mode.
However, even on platforms with good profiling, these tests are
inherently flaky, especially on loaded systems like the builders.

To mitigate this, modify the profiling test harness so that if a test
fails in a way that could indicate there just weren't enough samples,
it retries with a longer duration.

This requires some adjustment to the profile checker to distinguish
"fatal" and "retryable" errors. In particular, we no longer consider
it a fatal error to get a profile with zero samples (which we
previously treated as a parse error). We replace this with a retryable
check that the total number of samples is reasonable.

Fixes #13943. Fixes #13871. Fixes #13223.

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

8 years agonet/http: quiet http2 log spam
Brad Fitzpatrick [Tue, 26 Jan 2016 20:33:21 +0000 (20:33 +0000)]
net/http: quiet http2 log spam

Updates x/net/http2 to git rev eb066e3 for https://golang.org/cl/18932

Fixes #13925
Fixes #14061

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

8 years agonet/http: document TimeFormat more
Brad Fitzpatrick [Tue, 26 Jan 2016 18:55:35 +0000 (18:55 +0000)]
net/http: document TimeFormat more

Fixes #14103

Change-Id: I89963643eccc902b809e04b7a14153acb0d242e1
Reviewed-on: https://go-review.googlesource.com/18933
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: update install from source instructions for go1.5.3
Alberto Donizetti [Tue, 19 Jan 2016 19:47:59 +0000 (20:47 +0100)]
doc: update install from source instructions for go1.5.3

Fixes #14020

Change-Id: I454c2613912a7efcb464c6e6f3ac2e0ec89fb719
Reviewed-on: https://go-review.googlesource.com/18750
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/link: add -extar option to set ar program for c-archive
Ian Lance Taylor [Mon, 25 Jan 2016 19:44:02 +0000 (11:44 -0800)]
cmd/link: add -extar option to set ar program for c-archive

People who want to use -buildmode=c-archive in unusual cross-compilation
setups will need something like this.  It could also be done via (yet
another) environment variable but I use -extar by analogy with the
existing -extld.

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

8 years agonet/http: fix nit in test
Mikio Hara [Tue, 26 Jan 2016 07:29:47 +0000 (16:29 +0900)]
net/http: fix nit in test

Change-Id: I8c647e709d93a76636e04375609fceadf3754aa1
Reviewed-on: https://go-review.googlesource.com/18954
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto: document that Signer.Sign does not hash
Russ Cox [Sun, 24 Jan 2016 04:43:08 +0000 (23:43 -0500)]
crypto: document that Signer.Sign does not hash

Fixes #13938.

Change-Id: I0b4842b8bc22dc79323d6894c123cde638f52d3f
Reviewed-on: https://go-review.googlesource.com/18856
Reviewed-by: Adam Langley <agl@golang.org>
8 years agonet/url: allow spaces in IPv6 zone identifier for Windows
Russ Cox [Sun, 24 Jan 2016 04:31:23 +0000 (23:31 -0500)]
net/url: allow spaces in IPv6 zone identifier for Windows

Windows: putting spaces where they don't belong since Windows NT 3.1.

Fixes #14002.

Change-Id: I48ba8a7bfe3f27f83c8aa8355a8d355933d6c5df
Reviewed-on: https://go-review.googlesource.com/18855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocrypto/cipher: Add AES-GCM encryption and decryption example
Kevin Kirsche [Fri, 22 Jan 2016 16:04:07 +0000 (11:04 -0500)]
crypto/cipher: Add AES-GCM encryption and decryption example

Add example of how to use the aes package to
implement AES encryption and decryption
within an application.

Per feedback, use more secure AES-GCM implementation as an
example in crypto/cipher instead of AES directly.

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

8 years agotime: fix comment about use of Location.cacheEnd
Ian Lance Taylor [Tue, 26 Jan 2016 13:28:20 +0000 (05:28 -0800)]
time: fix comment about use of Location.cacheEnd

Fixes #14099.

Change-Id: I122e918bdc55fb185f4a4a797489b160219542d2
Reviewed-on: https://go-review.googlesource.com/18943
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/asm: add amd64 HADDPD/HADDPS
Russ Cox [Sun, 24 Jan 2016 20:20:36 +0000 (15:20 -0500)]
cmd/asm: add amd64 HADDPD/HADDPS

Was part of #13822 but not in the first message, so I missed it.

Fixes #13822 again.

Change-Id: I775004fa8d47b6af293124605521ec396573e267
Reviewed-on: https://go-review.googlesource.com/18900
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go/testdata: fix nits in test
Mikio Hara [Tue, 26 Jan 2016 07:35:52 +0000 (16:35 +0900)]
cmd/go/testdata: fix nits in test

Change-Id: I85fa5e672a476098f8711dcbb5b20ea1a3fa630d
Reviewed-on: https://go-review.googlesource.com/18953
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: don't check sigaltstack on darwin/{arm,arm64}
Ian Lance Taylor [Mon, 25 Jan 2016 23:22:03 +0000 (15:22 -0800)]
runtime: don't check sigaltstack on darwin/{arm,arm64}

Use of the alternate signal stack on darwin/{arm,arm64} is reportedly
buggy, and the runtime function sigaltstack does nothing.  So don't
check the sigaltstack result to decide how to handle the signal stack.

Fixes #14070.

Change-Id: Ie97ede8895fad721e3acc79225f2cafcbe1f3a81
Reviewed-on: https://go-review.googlesource.com/18940
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years agonet/http: don't retain *http.Request in Transport's HTTP/2 path
Brad Fitzpatrick [Sun, 24 Jan 2016 22:59:45 +0000 (22:59 +0000)]
net/http: don't retain *http.Request in Transport's HTTP/2 path

Fixes #14084

Change-Id: Icbef5678ab3c4fd7eed2693006c47aca6d831d90
Reviewed-on: https://go-review.googlesource.com/18873
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http/httputil: clarify docs on the Dump functions
Brad Fitzpatrick [Wed, 20 Jan 2016 19:00:32 +0000 (19:00 +0000)]
net/http/httputil: clarify docs on the Dump functions

Also don't nil out the Request or Response Body on error. Just leave
it in its previous broken state. The docs now say it's undefined, but
it always was.

Fixes #14036

Change-Id: I7fe175a36cbc01b4158f4dffacd8733b2ffa9999
Reviewed-on: https://go-review.googlesource.com/18726
Reviewed-by: Rob Pike <r@golang.org>
8 years agonet/http: update bundled http2
Brad Fitzpatrick [Mon, 25 Jan 2016 21:20:17 +0000 (21:20 +0000)]
net/http: update bundled http2

Updates x/net/http2 to git rev 2e9cee70 for https://golang.org/cl/18801

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

8 years agoruntime/pprof: document SetCPUProfile with c-archive/c-shared
Ian Lance Taylor [Mon, 25 Jan 2016 17:54:39 +0000 (09:54 -0800)]
runtime/pprof: document SetCPUProfile with c-archive/c-shared

When using c-archive/c-shared, the signal handler for SIGPROF will not
be installed, which means that runtime/pprof.StartCPUProfile won't work.
There is no really good solution here, as the main program may want to
do its own profiling.  For now, just document that runtime/pprof doesn't
work as expected, but that it will work if you use Notify to install the
Go signal handler.

Fixes #14043.

Change-Id: I7ff7a01df6ef7f63a7f050aac3674d640a246fb4
Reviewed-on: https://go-review.googlesource.com/18911
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agoruntime: update heap dumper header to 1.6.
Keith Randall [Mon, 25 Jan 2016 18:23:38 +0000 (10:23 -0800)]
runtime: update heap dumper header to 1.6.

Change-Id: Ic2a326d41783fb591148748dbcccfd3855091437
Reviewed-on: https://go-review.googlesource.com/18912
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: check max size of HTTP chunks
Brad Fitzpatrick [Sun, 24 Jan 2016 16:33:47 +0000 (16:33 +0000)]
net/http: check max size of HTTP chunks

Thanks to Régis Leroy for noticing.

Change-Id: I5ca2402efddab4e63d884a9d315fc1394e514cb7
Reviewed-on: https://go-review.googlesource.com/18871
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: always install new signal stack on NetBSD and DragonFly
Ian Lance Taylor [Fri, 22 Jan 2016 05:56:38 +0000 (21:56 -0800)]
runtime: always install new signal stack on NetBSD and DragonFly

On NetBSD and DragonFly a newly created thread inherits the signal stack
of the creating thread.  That means that in a cgo program a C thread
created using pthread_create will get the signal stack of the creating
thread, most likely a Go thread.  This will then lead to chaos if two
signals occur simultaneously.

We can't fix the general case.  But we can fix the case of a C thread
that calls a Go function, by installing a new signal stack and then
dropping it when we return to C.  That will break the case of a C thread
that calls sigaltstack and then calls Go, because we will drop the C
thread's alternate signal stack as we return from Go.  Still, this is
the 1.5 behavior.  And what else can we do?

Fixes #14051.
Fixes #14052.
Fixes #14067.

Change-Id: Iee286ca50b50ec712a4d929c7121c35e2383a7b9
Reviewed-on: https://go-review.googlesource.com/18835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/go: fix handling of asm files for -compiler=gccgo
Ian Lance Taylor [Tue, 19 Jan 2016 05:23:33 +0000 (21:23 -0800)]
cmd/go: fix handling of asm files for -compiler=gccgo

Pass -c to generate an object.  Pass GOPKGPATH as a symbol, not a
string.  Pass -xassembler-with-cpp so that the preprocessor is run.

Change-Id: I84690a73cc580bb05724ed07c120cec9cfd5e48b
Reviewed-on: https://go-review.googlesource.com/18733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/asm: reject foo(SB)(AX) instead of silently treating as foo(SB)
Russ Cox [Sun, 24 Jan 2016 06:33:16 +0000 (01:33 -0500)]
cmd/asm: reject foo(SB)(AX) instead of silently treating as foo(SB)

Add test for assembly errors, to verify fix.
Make sure invalid instruction errors are printed just once
(was printing them once per span iteration, so typically twice).

Fixes #13282.

Change-Id: Id5f66f80a80b3bc4832e00084b0a91f1afec7f8f
Reviewed-on: https://go-review.googlesource.com/18858
Reviewed-by: Rob Pike <r@golang.org>
8 years agomisc/cgo/test: fix test on darwin/386 with cgo enabled
Russ Cox [Sun, 24 Jan 2016 16:02:19 +0000 (11:02 -0500)]
misc/cgo/test: fix test on darwin/386 with cgo enabled

Apparently the darwin/386 builder does not enable cgo.
This failure turned up running

GOARCH=386 GOHOSTARCH=386 ./all.bash

on my Mac.

Change-Id: Ia2487c4fd85d4b0f9f564880f22d9fde379946c3
Reviewed-on: https://go-review.googlesource.com/18859
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/xml: update docs for Token
Russ Cox [Sun, 24 Jan 2016 04:22:49 +0000 (23:22 -0500)]
encoding/xml: update docs for Token

Fixes #13757.

Change-Id: I1b52593df8df0e98ce7342767eb34eccecc11761
Reviewed-on: https://go-review.googlesource.com/18854
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/asm: add amd64 PDEP, PEXT, and related integer VEX instructions
Russ Cox [Sun, 24 Jan 2016 05:44:23 +0000 (00:44 -0500)]
cmd/asm: add amd64 PDEP, PEXT, and related integer VEX instructions

Requested off-list.
Trivial to add and more importantly trivial to test.

ANDNL
ANDNQ
BEXTRL
BEXTRQ
BZHIL
BZHIQ
MULXL
MULXQ
PDEPL
PDEPQ
PEXTL
PEXTQ
SARXL
SARXQ
SHRXL
SHRXQ

Change-Id: I3d46a0f653b81dd003ff6d2a394d8ce96a573b63
Reviewed-on: https://go-review.googlesource.com/18857
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: add requested amd64 instructions
Russ Cox [Sun, 24 Jan 2016 03:50:58 +0000 (22:50 -0500)]
cmd/asm: add requested amd64 instructions

Add amd64 instructions I promised to add for Go 1.6
at the beginning of January.

These may be the last instructions added by hand.
I intend to generate the whole set mechanically for Go 1.7.

Fixes #13822.

Change-Id: I8c6bae2efd25f717f9ec750402e50f408a911d2b
Reviewed-on: https://go-review.googlesource.com/18853
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: correct, complete newly added AVX instructions
Russ Cox [Sat, 23 Jan 2016 03:25:15 +0000 (22:25 -0500)]
cmd/asm: correct, complete newly added AVX instructions

Use the standard names, for discoverability.
Use the standard register arguments, for correctness.
Implement all possible arguments, for completeness.
Enable the corresponding tests now that everything is standard.
Update the uses in package runtime.

Fixes #14068.

Change-Id: I8e1af9a41e7d02d98c2a82af3d4cdb3e9204824f
Reviewed-on: https://go-review.googlesource.com/18852
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: add x86 POPCNTW, POPCNTL
Russ Cox [Fri, 22 Jan 2016 21:25:06 +0000 (16:25 -0500)]
cmd/asm: add x86 POPCNTW, POPCNTL

Fixes #4816.

Change-Id: Ibeaa69f57b7519d56df4ea357edf8d9dc2102ffe
Reviewed-on: https://go-review.googlesource.com/18851
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/asm: add generated test of amd64 instruction encodings
Russ Cox [Fri, 22 Jan 2016 16:27:49 +0000 (11:27 -0500)]
cmd/asm: add generated test of amd64 instruction encodings

Generated by x86test, from https://golang.org/cl/18842
(still in progress).

The commented out lines are either missing or misspelled
or incorrectly handled instructions.

For #4816, #8037, #13822, #14068, #14069.

Change-Id: If309310c97d9d2a3c71fc64c51d4a957e9076ab7
Reviewed-on: https://go-review.googlesource.com/18850
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/asm: add test for verification of instruction encodings
Russ Cox [Fri, 22 Jan 2016 01:48:21 +0000 (20:48 -0500)]
cmd/asm: add test for verification of instruction encodings

Not much testing yet, but the test now exists.

Another step toward #13822.

Change-Id: Idb2b06bf53a6113c83008150b4c0b631bb195279
Reviewed-on: https://go-review.googlesource.com/18844
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agocmd/internal/obj/x86: fix doubled REX byte in POPCNT, others
Russ Cox [Fri, 22 Jan 2016 20:50:01 +0000 (15:50 -0500)]
cmd/internal/obj/x86: fix doubled REX byte in POPCNT, others

Tests for this and many other instructions are in a separate followup CL.

For #14068.

Change-Id: I6955315996a34d7fb79369b9d9a0119d11745e85
Reviewed-on: https://go-review.googlesource.com/18849
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/internal/obj/x86: rename POPCNT to POPCNTQ
Russ Cox [Fri, 22 Jan 2016 17:18:19 +0000 (12:18 -0500)]
cmd/internal/obj/x86: rename POPCNT to POPCNTQ

Ilya added POPCNT in a CL earlier this month but it's really only POPCNTQ.
The other forms still need to be added.

For #4816.

Change-Id: I1186850d32ad6d5777475c7808e6fc9d9133e118
Reviewed-on: https://go-review.googlesource.com/18848
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: add -e flag (no limit on errors) to match compiler
Russ Cox [Fri, 22 Jan 2016 14:49:48 +0000 (09:49 -0500)]
cmd/asm: add -e flag (no limit on errors) to match compiler

Change-Id: I5b749c575e0ec78fb3c50d056899bd1fe5d91853
Reviewed-on: https://go-review.googlesource.com/18847
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: add YMM registers Y0 through Y15
Russ Cox [Fri, 22 Jan 2016 14:35:05 +0000 (09:35 -0500)]
cmd/asm: add YMM registers Y0 through Y15

Not recognized in any instructions yet, but this lets the
assembler parse them at least.

For #14068.

Change-Id: Id4f7329a969b747a867ce261b20165fab2cdcab8
Reviewed-on: https://go-review.googlesource.com/18846
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: report more than one instruction encoding error
Russ Cox [Fri, 22 Jan 2016 03:48:29 +0000 (22:48 -0500)]
cmd/asm: report more than one instruction encoding error

Also, remove output file if there are encoding errors.
The extra reports are convenient.
Removing the output file is very important.
Noticed while testing.

Change-Id: I0fab17d4078f93c5a0d6d1217d8d9a63ac789696
Reviewed-on: https://go-review.googlesource.com/18845
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/asm: simplify golden test maintenance
Russ Cox [Tue, 5 Jan 2016 14:48:45 +0000 (09:48 -0500)]
cmd/asm: simplify golden test maintenance

Instead of two parallel files that look almost identical,
mark the expected differences in the original file.

The annotations being added here keep the tests passing,
but they also make clear a number of printing or parsing
errors that were not as easily seen when the data was
split across two files.

Fix a few diagnostic problems in cmd/internal/obj as well.

A step toward #13822.

Change-Id: I997172681ea6fa7da915ff0f0ab93d2b76f8dce2
Reviewed-on: https://go-review.googlesource.com/18823
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet: enable TestLookupDotsWithRemoteSource on builders
Mikio Hara [Sat, 23 Jan 2016 04:28:14 +0000 (13:28 +0900)]
net: enable TestLookupDotsWithRemoteSource on builders

Change-Id: I2609660b10a16ec2a256fc9c8e046ba4ae67963f
Reviewed-on: https://go-review.googlesource.com/18880
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: missing words and letters in release notes
Dominik Honnef [Sat, 23 Jan 2016 03:57:21 +0000 (04:57 +0100)]
doc: missing words and letters in release notes

Change-Id: Ica7f2a000eb1d89d5b02cb8c6f1596ddc04bfb26
Reviewed-on: https://go-review.googlesource.com/18890
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet: fix TestLookupDotsWithLocalSource
Mikio Hara [Thu, 21 Jan 2016 08:22:30 +0000 (17:22 +0900)]
net: fix TestLookupDotsWithLocalSource

Fixes #14050.

Change-Id: I2d9c32213b0da35703edf28f92ed3efb23325921
Reviewed-on: https://go-review.googlesource.com/18792
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agounsafe: document valid uses of Pointer
Russ Cox [Thu, 14 Jan 2016 01:14:03 +0000 (20:14 -0500)]
unsafe: document valid uses of Pointer

Add docs for valid uses of Pointer.
Then document change made for #13372 in CL 18584.

Fixes #8994.

Change-Id: Ifba71e5aeafd11f684aed0b7ddacf3c8ec07c580
Reviewed-on: https://go-review.googlesource.com/18640
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
8 years agocmd/internal/obj/mips, cmd/internal/obj: reduce MIPS register space
Shenghou Ma [Thu, 21 Jan 2016 21:45:36 +0000 (16:45 -0500)]
cmd/internal/obj/mips, cmd/internal/obj: reduce MIPS register space

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

8 years agocmd/compile: update vendored copy of math/big
Robert Griesemer [Fri, 22 Jan 2016 00:48:14 +0000 (16:48 -0800)]
cmd/compile: update vendored copy of math/big

- obtained by running sh vendor.bash
- contains updated tests and some bug fixes for Montgomery mult.
  (not used by compiler)
- for consistency of math/big versions only

Change-Id: Ib47e48d5b7f6d0e05d7837b1bc74bdb03f2b094e
Reviewed-on: https://go-review.googlesource.com/18831
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: remove unused (dead) fields
Robert Griesemer [Fri, 22 Jan 2016 00:36:36 +0000 (16:36 -0800)]
cmd/compile: remove unused (dead) fields

Change-Id: I4816a788e7b89b76dc70d05f4b176e99684d0680
Reviewed-on: https://go-review.googlesource.com/18830
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: skip TestSignalExitStatus on NetBSD
Ian Lance Taylor [Thu, 21 Jan 2016 23:18:23 +0000 (15:18 -0800)]
runtime: skip TestSignalExitStatus on NetBSD

It doesn't work and I don't know why.

Update #14063.

Change-Id: I42735012cf6247eca5336f29fcf713e08c8477f8
Reviewed-on: https://go-review.googlesource.com/18817
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agolib/time: update to IANA release 2015g.
David Symonds [Thu, 21 Jan 2016 23:06:08 +0000 (10:06 +1100)]
lib/time: update to IANA release 2015g.

Change-Id: Id82209dc313fa6b54e623eb325412737e7a055fe
Reviewed-on: https://go-review.googlesource.com/18794
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: save context value in NetBSD sigtramp
Ian Lance Taylor [Thu, 21 Jan 2016 20:43:34 +0000 (12:43 -0800)]
runtime: save context value in NetBSD sigtramp

On NetBSD a signal handler returns to the kernel by calling the
setcontext system call with the context passed to the signal handler.
The implementation of runtime·sigreturn_tramp for amd64, copied from the
NetBSD libc, expects that context address to be in r15.  That works in
the NetBSD libc because r15 is preserved across the call to the signal
handler.  It fails in the Go library because r15 is not preserved.
There are various ways to fix this; this one uses the simple approach,
essentially identical to the one in the NetBSD libc, of preserving r15
across the signal handler proper.

Looking at the code for 386 and arm suggests that they are OK.  However,
I have not actually tested them.

Update #14052.

Change-Id: I2b516b1d05fe5d3b8911e65ca761d621dc37fa1b
Reviewed-on: https://go-review.googlesource.com/18815
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: on NetBSD and DragonFly drop signal stack in new thread
Ian Lance Taylor [Thu, 21 Jan 2016 20:38:05 +0000 (12:38 -0800)]
runtime: on NetBSD and DragonFly drop signal stack in new thread

On NetBSD and DragonFly a newly created thread inherits the signal stack
of the creating thread.  This breaks horribly if both threads get a
signal at the same time.  Fix this by dropping the signal stack in the
newly created thread.  The right signal stack will then get installed
later.

Note that cgo code that calls pthread_create will have the wrong,
duplicated, signal stack in the newly created thread.  I don't see any
way to fix that in Go.  People using cgo to call pthread_create will
have to be aware of the problem.

Fixes #13945.
Fixes #13947.

Change-Id: I0c7bd2cdf9ada575d57182ca5e9523060de34931
Reviewed-on: https://go-review.googlesource.com/18814
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet: improve netsh usage in Windows unit tests
Tim Ebringer [Mon, 18 Jan 2016 10:33:25 +0000 (21:33 +1100)]
net: improve netsh usage in Windows unit tests

The TestInterfaceAddrsWithNetsh Windows unit test parses and compares the
output of the "netsh" command against more low level Windows API calls. In
at least two cases, some quirks of netsh cause these comparisons to fail.

One example appears to be wi-fi adapters. After a reboot, before it has
been allowed to connect to a network, netsh for IPv4 will not show an
address, whereas netsh for IPv6 will. If the interface is allowed to
connect, and then disconnected, netsh for IPv4 now shows an address and
the test will pass.

The fix is to not compare netsh output if the interface is down.

A related issue is that the IPv6 version of "netsh" can return an
IPv4-embedded IPv6 address where the IPv4 component of the address
is in decimal form, whilst the test is expecting hexadecimal form.

For example, output might be:

  Address fe80::5efe:192.168.1.7%6 Parameters
    ...

Whilst this is valid notation, the fix is to recognise this format in the
"netsh" output and re-parse the address into the all-hexadecimal
representation that the test is expecting.

Fixes #13981

Change-Id: Ie8366673f4d43d07bad80d6d5d1d6e33f654b6cc
Reviewed-on: https://go-review.googlesource.com/18711
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocrypto/tls: note in comment that Certificate.Leaf is nil after parsing.
Adam Langley [Tue, 19 Jan 2016 16:27:10 +0000 (08:27 -0800)]
crypto/tls: note in comment that Certificate.Leaf is nil after parsing.

LoadX509KeyPair and X509KeyPair don't retain the parsed form of
certificates in their return value because it's generally not needed.
This change makes that clear in the comment.

See https://groups.google.com/d/msg/golang-dev/VResvFj2vF8/Wt6WkVT2AwAJ

Change-Id: Ibb759cd6e84c00f4450a012992088422c0546638
Reviewed-on: https://go-review.googlesource.com/18734
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agotext/template: fix documentation for pipelines
Rob Pike [Thu, 21 Jan 2016 00:08:31 +0000 (16:08 -0800)]
text/template: fix documentation for pipelines

The header was in the wrong place, so the definition of a pipeline
was not in the section labeled "Pipelines".

Fixes #13972

Change-Id: Ibca791a4511ca112047b57091c391f6e959fdd78
Reviewed-on: https://go-review.googlesource.com/18775
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet/http: make Client propagate Request.Cancel over redirected requests
Olivier Poitrey [Thu, 21 Jan 2016 06:53:50 +0000 (22:53 -0800)]
net/http: make Client propagate Request.Cancel over redirected requests

On HTTP redirect, the HTTP client creates a new request and don't copy
over the Cancel channel. This prevents any redirected request from being
cancelled.

Fixes #14053

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

8 years agocmd/go: document PackageError in go list output
Ian Lance Taylor [Mon, 18 Jan 2016 23:40:47 +0000 (15:40 -0800)]
cmd/go: document PackageError in go list output

Fixes #14007.

Change-Id: I1f73dfccb466d8fd00efbd8c92a31ac538bf5988
Reviewed-on: https://go-review.googlesource.com/18731
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: update http2 to check header values, move from vendor to internal
Brad Fitzpatrick [Wed, 20 Jan 2016 22:41:52 +0000 (22:41 +0000)]
net/http: update http2 to check header values, move from vendor to internal

Updates x/net/http2 to git rev b2ed34f for https://golang.org/cl/18727

Updates #14029 (fixes it enough for Go 1.6)
Fixes #13961

Change-Id: Id301247545507671f4e79df0e7c6ec9c421d5a7c
Reviewed-on: https://go-review.googlesource.com/18728
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/link: allow symbols from .a files to override those from .so files
Michael Hudson-Doyle [Wed, 20 Jan 2016 02:31:26 +0000 (15:31 +1300)]
cmd/link: allow symbols from .a files to override those from .so files

https://golang.org/s/execmodes defines rules for how multiple codes of a go
package work when they end up in the address space of a single process, but
currently the linker blows up in this situation. Fix that by loading all .a
files before any .so files and ignoring duplicate symbols found when loading
shared libraries.

I know this is very very late for 1.6 but at least it should clearly not have
any effect when shared libraries are not in use.

Change-Id: I512ac912937e7502ff58eb5628b658ecce3c38e5
Reviewed-on: https://go-review.googlesource.com/18714
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

8 years agocmd/dist: pass -tags race to go list in -race mode
Shenghou Ma [Tue, 19 Jan 2016 03:42:40 +0000 (22:42 -0500)]
cmd/dist: pass -tags race to go list in -race mode

so that runtime/race tests are included in the race builder.

Update #14011.

Change-Id: I04ac6e47366fdb1fe84ba89da556c6d38f7d4a47
Reviewed-on: https://go-review.googlesource.com/18686
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: don't print (empty) package name in errors referring to built-ins
Robert Griesemer [Tue, 19 Jan 2016 22:17:29 +0000 (14:17 -0800)]
cmd/compile: don't print (empty) package name in errors referring to built-ins

Fixes #14010.

Change-Id: Idfd4b063eecf453fe00f3e798099023707a65963
Reviewed-on: https://go-review.googlesource.com/18738
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>

8 years agoruntime/race: fix test so it compiles
Michael Hudson-Doyle [Tue, 19 Jan 2016 03:27:14 +0000 (16:27 +1300)]
runtime/race: fix test so it compiles

I'm not sure what the convert function was intended to be.

Fixes #14011

Change-Id: I29d905bc1827936b9433b20b13b7a0b0ac5f502e
Reviewed-on: https://go-review.googlesource.com/18712
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 agocmd/compile: add VARLIVE to opnames list
Keith Randall [Tue, 19 Jan 2016 21:52:51 +0000 (13:52 -0800)]
cmd/compile: add VARLIVE to opnames list

Change-Id: Ie8cb7c7428ae9026c11643b22f9ecf7977e25f5f
Reviewed-on: https://go-review.googlesource.com/18737
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: don't crash on invalid labeled statement
Robert Griesemer [Tue, 19 Jan 2016 21:14:03 +0000 (13:14 -0800)]
cmd/compile: don't crash on invalid labeled statement

Fixes #14006.

Change-Id: Ia819073677ad6993c02255e23760ee21598427b4
Reviewed-on: https://go-review.googlesource.com/18736
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: set importpkg.Direct correctly when using binary imports
Robert Griesemer [Fri, 15 Jan 2016 22:52:06 +0000 (14:52 -0800)]
cmd/compile: set importpkg.Direct correctly when using binary imports

Fixes #13977.

Change-Id: Icf54b4d2d746d30da207d1e17c975d18188b1cf8
Reviewed-on: https://go-review.googlesource.com/18702
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agocmd/link: fix elf64phdr to allow using upx (and other broken ELF loaders).
OneOfOne [Fri, 15 Jan 2016 17:24:44 +0000 (19:24 +0200)]
cmd/link: fix elf64phdr to allow using upx (and other broken ELF loaders).

The linker already applies the fix for elf32, so this just extends it to elf64.

Inspired by https://github.com/pwaller/goupx

Fixes #13974

Change-Id: I65d92b5be9590657060a0e8e80ff5b86ba40017f
Reviewed-on: https://go-review.googlesource.com/18690
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 agonet: add timeout to DNS requests sent by TestSpecialDomainName
Michael Munday [Thu, 14 Jan 2016 21:36:43 +0000 (16:36 -0500)]
net: add timeout to DNS requests sent by TestSpecialDomainName

The timeout means that TestSpecialDomainName will not hang if
the DNS server does not respond to the request.

Fixes #13939

Change-Id: I46e30bbd3c11b6c560656134e704331cf6f8af3f
Reviewed-on: https://go-review.googlesource.com/18661
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: make hidden http2 Transport respect remaining Transport fields
Brad Fitzpatrick [Tue, 19 Jan 2016 05:10:58 +0000 (05:10 +0000)]
net/http: make hidden http2 Transport respect remaining Transport fields

Updates x/net/http2 to git rev 72aa00c6 for https://golang.org/cl/18721
(but actually at https://golang.org/cl/18722 now)

Fixes #14008

Change-Id: If05d5ad51ec0ba5ba7e4fe16605c0a83f0484bc8
Reviewed-on: https://go-review.googlesource.com/18723
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agobuild: test linux/mips64 and linux/mips64le with buildall.bash
Shenghou Ma [Tue, 19 Jan 2016 03:55:11 +0000 (22:55 -0500)]
build: test linux/mips64 and linux/mips64le with buildall.bash

Both mips64 architectures share the same runtime/rt0 file, so
we have to hardcode them in buildall.bash.

Ideally we should have cmd/dist report all supported platforms,
see #12270.

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

8 years agoruntime: print address as hex in messages
Shenghou Ma [Mon, 18 Jan 2016 22:55:06 +0000 (17:55 -0500)]
runtime: print address as hex in messages

Change-Id: I7ccf1b5001d77c4390479f53c0137ab02f98595b
Reviewed-on: https://go-review.googlesource.com/18685
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: clarify docs on Request.Proto field
Brad Fitzpatrick [Mon, 18 Jan 2016 06:38:56 +0000 (06:38 +0000)]
net/http: clarify docs on Request.Proto field

No need to say "by default" because there is no alternative and no way
to override. Always HTTP/2.0 is officially spelled HTTP/2 these days.

Fixes #13985 harder

Change-Id: Ib1ec03cec171ca865342b8e7452cd4c707d7b770
Reviewed-on: https://go-review.googlesource.com/18720
Reviewed-by: Rob Pike <r@golang.org>
8 years agonet/http: make http2 Transport send Content Length
Brad Fitzpatrick [Mon, 18 Jan 2016 22:50:52 +0000 (14:50 -0800)]
net/http: make http2 Transport send Content Length

Updates x/net/http2 to git rev 5c0dae8 for https://golang.org/cl/18709

Fixes #14003

Change-Id: I8bc205d6d089107b017e3458bbc7e05f6d0cae60
Reviewed-on: https://go-review.googlesource.com/18730
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: panic on bogus use of CloseNotifier or Hijacker
Brad Fitzpatrick [Mon, 18 Jan 2016 19:43:32 +0000 (11:43 -0800)]
net/http: panic on bogus use of CloseNotifier or Hijacker

Fixes #14001

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