]> Cypherpunks repositories - gostls13.git/log
gostls13.git
8 years agocmd/go: remove invalid space in import comment docs
Dmitri Shuralyov [Fri, 10 Jun 2016 08:38:43 +0000 (01:38 -0700)]
cmd/go: remove invalid space in import comment docs

Generate package comment in alldocs.go using line comments rather than
general comments. This scales better, general comments cannot contain the
"*/" character sequence. Line comments do not have any restrictions on
the comment text that can be contained.

Remove the dependency on sed, which is not cross-platform, not go-gettable
external command.

Remove trailing whitespace from usage string in test.go. It's unnecessary.

Fixes #16030.

Change-Id: I3c0bc9955e7c7603c3d1fb4878218b0719d02e04
Reviewed-on: https://go-review.googlesource.com/23968
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 agoruntime: aeshash, xor seed in earlier
Keith Randall [Thu, 26 May 2016 15:56:49 +0000 (08:56 -0700)]
runtime: aeshash, xor seed in earlier

Instead of doing:

x = input
one round of aes on x
x ^= seed
two rounds of aes on x

Do:

x = input
x ^= seed
three rounds of aes on x

This change provides some additional seed-dependent scrambling
which should help prevent collisions.

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

8 years agoos: on GNU/Linux use waitid to avoid wait/kill race
Ian Lance Taylor [Fri, 10 Jun 2016 05:24:40 +0000 (22:24 -0700)]
os: on GNU/Linux use waitid to avoid wait/kill race

On systems that support the POSIX.1-2008 waitid function, we can use it
to block until a wait will succeed. This avoids a possible race
condition: if a program calls p.Kill/p.Signal and p.Wait from two
different goroutines, then it is possible for the wait to complete just
before the signal is sent. In that case, it is possible that the system
will start a new process using the same PID between the wait and the
signal, causing the signal to be sent to the wrong process. The
Process.isdone field attempts to avoid that race, but there is a small
gap of time between when wait returns and isdone is set when the race
can occur.

This CL avoids that race by using waitid to wait until the process has
exited without actually collecting the PID. Then it sets isdone, then
waits for any active signals to complete, and only then collects the PID.

No test because any plausible test would require starting enough
processes to recycle all the process IDs.

Update #13987.
Update #16028.

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

8 years agogo/parser: document that parse functions need valid token.FileSet
Robert Griesemer [Fri, 10 Jun 2016 17:27:37 +0000 (10:27 -0700)]
go/parser: document that parse functions need valid token.FileSet

+ panic with explicit error if no file set it provided

(Not providing a file set is invalid use of the API; panic
is the appropriate action rather than returning an error.)

Fixes #16018.

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

8 years agocmd/go: clarify go get documentation
Ian Lance Taylor [Thu, 9 Jun 2016 13:42:42 +0000 (06:42 -0700)]
cmd/go: clarify go get documentation

Make the documentation for `go get` match the documentation for `go
install`, since `go get` essentially invokes `go install`.

Update #15825.

Change-Id: I374d80efd301814b6d98b86b7a4a68dd09704c92
Reviewed-on: https://go-review.googlesource.com/23925
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agosyscall: add a padding field to EpollEvent on s390x
Michael Munday [Thu, 9 Jun 2016 16:01:43 +0000 (12:01 -0400)]
syscall: add a padding field to EpollEvent on s390x

Fixes #16021.

Change-Id: I55df38bbccd2641abcb54704115002a9aa04325d
Reviewed-on: https://go-review.googlesource.com/23962
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/csv: update doc about comments whitespace
Jess Frazelle [Fri, 20 May 2016 21:35:28 +0000 (14:35 -0700)]
encoding/csv: update doc about comments whitespace

This patch updates the doc about comments whitespace for the
encoding/csv package to reflect that leading whitespace before
the hash will treat the line as not a comment.

Fixes #13775.

Change-Id: Ia468c75b242a487b4b2b4cd3d342bfb8e07720ba
Reviewed-on: https://go-review.googlesource.com/23302
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: set $sp before $pc in gdb python script
Cherry Zhang [Thu, 9 Jun 2016 02:22:35 +0000 (22:22 -0400)]
runtime: set $sp before $pc in gdb python script

When setting $pc, gdb does a backtrace using the current value of $sp,
and it may complain if $sp does not match that $pc (although the
assignment went through successfully).

This happens with ARM SSA backend: when setting $pc it prints
> Cannot access memory at address 0x0

As well as occasionally on MIPS64:
> warning: GDB can't find the start of the function at 0xc82003fe07.
> ...

Setting $sp before setting $pc makes it happy.

Change-Id: Idd96dbef3e9b698829da553c6d71d5b4c6d492db
Reviewed-on: https://go-review.googlesource.com/23940
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocmd/compile: for tail calls in stubs, ensure args are alive
Keith Randall [Thu, 9 Jun 2016 18:07:36 +0000 (11:07 -0700)]
cmd/compile: for tail calls in stubs, ensure args are alive

The generated code for interface stubs sometimes just messes
with a few of the args and then tail-calls to the target routine.
The args that aren't explicitly modified appear to not be used.
But they are used, by the thing we're tail calling.

Fixes #16016

Change-Id: Ib9b3a8311bb714a201daee002885fcb59e0463fa
Reviewed-on: https://go-review.googlesource.com/23960
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/cgo: fix use of unsafe argument in new deferred function
Ian Lance Taylor [Thu, 9 Jun 2016 18:19:26 +0000 (11:19 -0700)]
cmd/cgo: fix use of unsafe argument in new deferred function

The combination of https://golang.org/cl/23650 and
https://golang.org/cl/23675 did not work--they were tested separately
but not together.

The problem was that 23650 introduced deferred argument checking, and
the deferred function loses the type that 23675 started requiring. The
fix is to go back to using an empty interface type in a deferred
argument check.

No new test required--fixes broken build.

Change-Id: I5ea023c5aed71d70e57b11c4551242d3ef25986d
Reviewed-on: https://go-review.googlesource.com/23961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocmd/cgo: use function arg type for _cgoCheckPointerN function
Ian Lance Taylor [Thu, 2 Jun 2016 04:32:47 +0000 (21:32 -0700)]
cmd/cgo: use function arg type for _cgoCheckPointerN function

When cgo writes a _cgoCheckPointerN function to handle unsafe.Pointer,
use the function's argument type rather than interface{}. This permits
type errors to be detected at build time rather than run time.

Fixes #13830.

Change-Id: Ic7090905e16b977e2379670e0f83640dc192b565
Reviewed-on: https://go-review.googlesource.com/23675
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agotime: document that RFC822/1123 don't parse all RFC formats
Ian Lance Taylor [Thu, 9 Jun 2016 04:15:26 +0000 (21:15 -0700)]
time: document that RFC822/1123 don't parse all RFC formats

Fixes #14505.

Change-Id: I46196b26c9339609e6e3ef9159de38c5b50c2a1b
Reviewed-on: https://go-review.googlesource.com/23922
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agotime: genzabbrs.go skips Feb when checking months
Kenny Grant [Sat, 21 May 2016 16:19:22 +0000 (17:19 +0100)]
time: genzabbrs.go skips Feb when checking months

getAbbrs looks like it is checking each month looking for a change
in the time zone abbreviation, but starts in Dec of the previous year
and skips the month of February because of the overflow rules for
AddDate. Changing the day to 1 starts at Jan 1 and tries all months
in the current year. This isn't very important or likely to change
output as zones usually span several months. Discovered when
looking into time.AddDate behavior when adding months.

Change-Id: I685254c8d21c402ba82cc4176e9a86b64ce8f7f7
Reviewed-on: https://go-review.googlesource.com/23322
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 agocrypto/subtle: expand abbreviation to eliminate confusion
Jason Barnett [Tue, 24 May 2016 19:50:02 +0000 (15:50 -0400)]
crypto/subtle: expand abbreviation to eliminate confusion

Change-Id: I68d66fccf9cc8f7137c92b94820ce7d6f478a185
Reviewed-on: https://go-review.googlesource.com/23310
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 agoos: document that the runtime can write to standard error
Ian Lance Taylor [Thu, 9 Jun 2016 04:09:09 +0000 (21:09 -0700)]
os: document that the runtime can write to standard error

Fixes #15970.

Change-Id: I3f7d8316069a69d0e3859aaa96bc1414487fead0
Reviewed-on: https://go-review.googlesource.com/23921
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: only run TestGoGetHTTPS404 where it works
Ian Lance Taylor [Thu, 9 Jun 2016 00:45:55 +0000 (17:45 -0700)]
cmd/go: only run TestGoGetHTTPS404 where it works

The test TestGoGetHTTPS404 downloads a package that does not build on
every OS, so change it to only run where the package builds. It's not
great for the test to depend on an external package, but this is an
improvement on the current situation.

Fixes #15644.

Change-Id: I1679cee5ab1e61a5b26f4ad39dc8a397fbc0da69
Reviewed-on: https://go-review.googlesource.com/23920
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/compile: nilcheck interface value in go/defer interface call for SSA
Cherry Zhang [Mon, 6 Jun 2016 20:00:33 +0000 (16:00 -0400)]
cmd/compile: nilcheck interface value in go/defer interface call for SSA

This matches the behavior of the legacy backend.

Fixes #15975 (if this is the intended behavior)

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

8 years agoruntime/cgo: restore the g pointer correctly in crosscall_s390x
Michael Munday [Wed, 8 Jun 2016 16:11:44 +0000 (16:11 +0000)]
runtime/cgo: restore the g pointer correctly in crosscall_s390x

R13 needs to be set to g because C code may have clobbered R13.

Fixes #16006.

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

8 years agomisc/android: make the exec wrapper exit code parsing more robust
Elias Naur [Fri, 3 Jun 2016 09:41:26 +0000 (11:41 +0200)]
misc/android: make the exec wrapper exit code parsing more robust

Before, the Android exec wrapper expected the trailing exit code
output on its own line, like this:

PASS
exitcode=0

However, some tests can sometimes squeeze in some output after
the test harness outputs "PASS" and the newline. The
TestWriteHeapDumpFinalizers test is particularly prone to this,
since its finalizers println to standard out. When it happens, the
output looks like this:

PASS
finalizedexitcode=0

Two recent failures caused by this race:

https://build.golang.org/log/185605e1b936142c22350eef22d20e982be53c29
https://build.golang.org/log/e61cf6a050551d10360bd90be3c5f58c3eb07605

Since the "exitcode=" string is always echoed after the test output,
the fix is simple: instead of looking for the last newline in the
output, look for the last exitcode string instead.

Change-Id: Icd6e53855eeba60b982ad3108289d92549328b86
Reviewed-on: https://go-review.googlesource.com/23750
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agomisc/cgo/testsanitizers: don't run some TSAN tests on GCC < 7
Ian Lance Taylor [Tue, 7 Jun 2016 04:44:24 +0000 (21:44 -0700)]
misc/cgo/testsanitizers: don't run some TSAN tests on GCC < 7

Before GCC 7 defined __SANITIZE_THREAD__ when using TSAN,
runtime/cgo/libcgo.h could not determine reliably whether TSAN was in
use when using GCC.

Fixes #15983.

Change-Id: I5581c9f88e1cde1974c280008b2230fe5e971f44
Reviewed-on: https://go-review.googlesource.com/23833
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agonet/http: update bundled http2
Andrew Gerrand [Wed, 8 Jun 2016 02:57:00 +0000 (12:57 +1000)]
net/http: update bundled http2

Updates x/net/http2 to git rev 313cf39 for CLs 23812 and 23880:

http2: GotFirstResponseByte hook should only fire once
http2: fix data race on pipe

Fixes #16000

Change-Id: I9c3f1b2528bbd99968aa5a0529ae9c5295979d1d
Reviewed-on: https://go-review.googlesource.com/23881
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
8 years agocmd/compile: cgen_append can handle complex targets
Keith Randall [Tue, 7 Jun 2016 22:43:48 +0000 (15:43 -0700)]
cmd/compile: cgen_append can handle complex targets

Post-liveness fix, the slices on both sides can now be
indirects of & variables.  The cgen code handles those
cases just fine.

Fixes #15988

Change-Id: I378ad1d5121587e6107a9879c167291a70bbb9e4
Reviewed-on: https://go-review.googlesource.com/23863
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
8 years agocmd/compile: fix heap dump test on android
Keith Randall [Tue, 7 Jun 2016 16:54:09 +0000 (09:54 -0700)]
cmd/compile: fix heap dump test on android

go_android_exec is looking for "exitcode=" to decide the result
of running a test.  The heap dump test nondeterministically prints
"finalized" right at the end of the test.  When the timing is just
right, we print "finalizedexitcode=0" and confuse go_android_exec.

This failure happens occasionally on the android builders.

Change-Id: I4f73a4db05d8f40047ecd3ef3a881a4ae3741e26
Reviewed-on: https://go-review.googlesource.com/23861
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: use fake package for allocating autos
Keith Randall [Mon, 6 Jun 2016 17:56:42 +0000 (10:56 -0700)]
cmd/compile: use fake package for allocating autos

Make sure auto names don't conflict with function names. Before this CL,
we confused name a.len (the len field of the slice a) with a.len (the function
len declared on a).

Fixes #15961

Change-Id: I14913de697b521fb35db9a1b10ba201f25d552bb
Reviewed-on: https://go-review.googlesource.com/23789
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/dist: use "set" instead of "export" in diagnostic message
Andrew Gerrand [Mon, 6 Jun 2016 22:33:00 +0000 (08:33 +1000)]
cmd/dist: use "set" instead of "export" in diagnostic message

On Windows, "export" doesn't mean anything, but Windows users are the
most likely to see this message.

Fixes #15977

Change-Id: Ib09ca08a7580713cacb65d0cdc43730765c377a8
Reviewed-on: https://go-review.googlesource.com/23840
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/http: send StatusOK on empty body with TimeoutHandler
Andrew Gerrand [Mon, 6 Jun 2016 00:23:49 +0000 (10:23 +1000)]
net/http: send StatusOK on empty body with TimeoutHandler

Fixes #15948

Change-Id: Idd79859b3e98d61cd4e3ef9caa5d3b2524fd026a
Reviewed-on: https://go-review.googlesource.com/23810
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 agotime: warn about correct use of a Timer's Stop/Reset methods
Andrew Gerrand [Tue, 31 May 2016 05:30:52 +0000 (15:30 +1000)]
time: warn about correct use of a Timer's Stop/Reset methods

Updates #14038
Fixes #14383

Change-Id: Icf6acb7c5d13ff1d3145084544c030a778482a38
Reviewed-on: https://go-review.googlesource.com/23575
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
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/http: send one Transfer-Encoding header when "chunked" set manually
Andrew Gerrand [Mon, 6 Jun 2016 00:41:47 +0000 (10:41 +1000)]
net/http: send one Transfer-Encoding header when "chunked" set manually

Fixes #15960

Change-Id: I7503f6ede33e6a1a93cee811d40f7b297edf47bc
Reviewed-on: https://go-review.googlesource.com/23811
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 agoruntime: fix typo
Keith Randall [Sun, 5 Jun 2016 16:24:09 +0000 (09:24 -0700)]
runtime: fix typo

Fixes #15962

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

8 years agoRevert "cmd/go: re-enable TestCgoConsistentResults on solaris"
Mikio Hara [Fri, 3 Jun 2016 22:33:28 +0000 (07:33 +0900)]
Revert "cmd/go: re-enable TestCgoConsistentResults on solaris"

This reverts commit b89bcc1daeed9980c5ba8a255b37877493952874.

Change-Id: Ief2f317ffc175f7e6002d0c39694876f46788c69
Reviewed-on: https://go-review.googlesource.com/23744
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
8 years agocmd/go: re-enable TestCgoConsistentResults on solaris
Mikio Hara [Fri, 3 Jun 2016 07:45:21 +0000 (16:45 +0900)]
cmd/go: re-enable TestCgoConsistentResults on solaris

Updates #13247.

Change-Id: If5e4c9f4db05f58608b0eeed1a2312a04015b207
Reviewed-on: https://go-review.googlesource.com/23741
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/cgo: check pointers for deferred C calls at the right time
Ian Lance Taylor [Wed, 1 Jun 2016 22:24:14 +0000 (15:24 -0700)]
cmd/cgo: check pointers for deferred C calls at the right time

We used to check time at the point of the defer statement. This change
fixes cgo to check them when the deferred function is executed.

Fixes #15921.

Change-Id: I72a10e26373cad6ad092773e9ebec4add29b9561
Reviewed-on: https://go-review.googlesource.com/23650
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agodoc/go1.7.html: html tidy
Ian Lance Taylor [Fri, 3 Jun 2016 19:39:54 +0000 (12:39 -0700)]
doc/go1.7.html: html tidy

Change-Id: I0e07610bae641cd63769b520089f5d854d796648
Reviewed-on: https://go-review.googlesource.com/23770
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: match go-import package prefixes by slash
Stephen McQuay (smcquay) [Fri, 3 Jun 2016 09:12:17 +0000 (02:12 -0700)]
cmd/go: match go-import package prefixes by slash

The existing implementation for path collision resolution would
incorrectly determine that:

    example.org/aa

collides with:

    example.org/a

This change splits by slash rather than comparing on a byte-by-byte
basis.

Fixes: #15947
Change-Id: I18b3aaafbc787c81253203cf1328bb3c4420a0c4
Reviewed-on: https://go-review.googlesource.com/23732
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

8 years agoreflect: clear tflag for StructOf type
David Crawshaw [Fri, 3 Jun 2016 15:27:33 +0000 (11:27 -0400)]
reflect: clear tflag for StructOf type

Fixes #15923

Change-Id: I3e56564365086ceb0bfc15db61db6fb446ab7448
Reviewed-on: https://go-review.googlesource.com/23760
Reviewed-by: Sebastien Binet <seb.binet@gmail.com>
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 agoruntime/cgo: add TSAN locks around mmap call
Ian Lance Taylor [Fri, 3 Jun 2016 17:49:24 +0000 (10:49 -0700)]
runtime/cgo: add TSAN locks around mmap call

Change-Id: I806cc5523b7b5e3278d01074bc89900d78700e0c
Reviewed-on: https://go-review.googlesource.com/23736
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agodoc/go1.7.html: add missing <code> and </a>
Ian Lance Taylor [Fri, 3 Jun 2016 17:09:08 +0000 (10:09 -0700)]
doc/go1.7.html: add missing <code> and </a>

Change-Id: I5f4bf89345dc139063dcf34da653e914386bcde6
Reviewed-on: https://go-review.googlesource.com/23735
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/link: avoid name collision with DWARF .def suffix
Ian Lance Taylor [Fri, 3 Jun 2016 14:11:52 +0000 (07:11 -0700)]
cmd/link: avoid name collision with DWARF .def suffix

Adding a .def suffix for DWARF info collided with the DWARF info,
without the suffix, for a method named def. Change the suffix to ..def
instead.

Fixes #15926.

Change-Id: If1bf1bcb5dff1d7f7b79f78e3f7a3bbfcd2201bb
Reviewed-on: https://go-review.googlesource.com/23733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agonet: don't leak test helper goroutine in TestAcceptTimeout
Mikio Hara [Fri, 3 Jun 2016 09:06:54 +0000 (18:06 +0900)]
net: don't leak test helper goroutine in TestAcceptTimeout

Fixes #15109.

Change-Id: Ibfdedd6807322ebec84bacfeb492fb53fe066960
Reviewed-on: https://go-review.googlesource.com/23742
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
8 years agobytes: use Run method for benchmarks
Marcel van Lohuizen [Thu, 26 May 2016 08:54:25 +0000 (10:54 +0200)]
bytes: use Run method for benchmarks

Change-Id: I34ab1003099570f0ba511340e697a648de31d08a
Reviewed-on: https://go-review.googlesource.com/23427
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agocmd/internal/obj, runtime: fixes for defer in 386 shared libraries
Michael Hudson-Doyle [Wed, 1 Jun 2016 23:07:55 +0000 (11:07 +1200)]
cmd/internal/obj, runtime: fixes for defer in 386 shared libraries

Any defer in a shared object crashed when GOARCH=386. This turns out to be two
bugs:

 1) Calls to morestack were not processed to be PIC safe (must have been
    possible to trigger this another way too)
 2) jmpdefer needs to rewind the return address of the deferred function past
    the instructions that load the GOT pointer into BX, not just past the call

Bug 2) requires re-introducing the a way for .s files to know when they are
being compiled for dynamic linking but I've tried to do that in as minimal
a way as possible.

Fixes #15916

Change-Id: Ia0d09b69ec272a176934176b8eaef5f3bfcacf04
Reviewed-on: https://go-review.googlesource.com/23623
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: fix staleness test for releases, also deflake it
Andrew Gerrand [Fri, 3 Jun 2016 01:33:37 +0000 (11:33 +1000)]
cmd/go: fix staleness test for releases, also deflake it

Fixes #15933

Change-Id: I2cd6365e6d0ca1cafdc812fbfaaa55aa64b2b289
Reviewed-on: https://go-review.googlesource.com/23731
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 agodoc/go1.7.html: net/mail.ParseAddress is stricter
Ian Lance Taylor [Thu, 2 Jun 2016 19:33:34 +0000 (12:33 -0700)]
doc/go1.7.html: net/mail.ParseAddress is stricter

Fixes #15940.

Change-Id: Ie6da6fef235c6a251caa96d45f606c05d118a0ac
Reviewed-on: https://go-review.googlesource.com/23710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Travis Beatty <travisby@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoencoding/json: fix docs on valid key names
David Glasser [Tue, 31 May 2016 19:28:57 +0000 (12:28 -0700)]
encoding/json: fix docs on valid key names

This has been inaccurate since https://golang.org/cl/6048047.

Fixes #15317.

Change-Id: If93d2161f51ccb91912cb94a35318cf33f4d526a
Reviewed-on: https://go-review.googlesource.com/23691
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 agosyscall: deflake TestUnshare
Mikio Hara [Thu, 2 Jun 2016 08:17:02 +0000 (17:17 +0900)]
syscall: deflake TestUnshare

Change-Id: I21a08c2ff5ebb74e158723cca323574432870ba8
Reviewed-on: https://go-review.googlesource.com/23662
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 agostrconv: use Run for some benchmarks
Marcel van Lohuizen [Thu, 26 May 2016 10:10:28 +0000 (12:10 +0200)]
strconv: use Run for some benchmarks

This serves as an example of table-driven benchmarks which are analoguous to the common pattern for table-driven tests.

Change-Id: I47f94c121a7117dd1e4ba03b3f2f8bcb5da38063
Reviewed-on: https://go-review.googlesource.com/23470
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agoruntime: only permit SetCgoTraceback to be called once
Ian Lance Taylor [Thu, 2 Jun 2016 19:01:03 +0000 (12:01 -0700)]
runtime: only permit SetCgoTraceback to be called once

Accept a duplicate call, but nothing else.

Change-Id: Iec24bf5ddc3b0f0c559ad2158339aca698601743
Reviewed-on: https://go-review.googlesource.com/23692
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/cgo: avoid races on cgo_context_function
Ian Lance Taylor [Tue, 31 May 2016 23:04:00 +0000 (16:04 -0700)]
runtime/cgo: avoid races on cgo_context_function

Change-Id: Ie9e6fda675e560234e90b9022526fd689d770818
Reviewed-on: https://go-review.googlesource.com/23610
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agosyscall: call setgroups for no groups on GNU/Linux
Alexander Morozov [Fri, 27 May 2016 22:02:31 +0000 (15:02 -0700)]
syscall: call setgroups for no groups on GNU/Linux

Skip setgroups only for one particular case: GidMappings != nil and
GidMappingsEnableSetgroup == false and list of supplementary groups is
empty.
This patch returns pre-1.5 behavior for simple exec and still allows to
use GidMappings with non-empty Credential.

Change-Id: Ia91c77e76ec5efab7a7f78134ffb529910108fc1
Reviewed-on: https://go-review.googlesource.com/23524
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 agodoc/go1.7.html: typo fix; replace "," at end of sentence with "."
Steve Phillips [Thu, 2 Jun 2016 09:40:37 +0000 (02:40 -0700)]
doc/go1.7.html: typo fix; replace "," at end of sentence with "."

Signed-off-by: Steven Phillips <steve@tryingtobeawesome.com>
Change-Id: Ie7c3253a5e1cd43be8fa12bad340204cc6c5ca76
Reviewed-on: https://go-review.googlesource.com/23677
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.7: fix typo in nsswitch.conf name
Alberto Donizetti [Thu, 2 Jun 2016 12:34:37 +0000 (14:34 +0200)]
doc/go1.7: fix typo in nsswitch.conf name

Fixes #15939

Change-Id: I120cbeac73a052fb3f328774e6d5e1534f11bf6b
Reviewed-on: https://go-review.googlesource.com/23682
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoreflect: document StructOf embedded fields limitation
Sebastien Binet [Thu, 2 Jun 2016 07:25:30 +0000 (09:25 +0200)]
reflect: document StructOf embedded fields limitation

This CL documents that StructOf currently does not generate wrapper
methods for embedded fields.

Updates #15924

Change-Id: I932011b1491d68767709559f515f699c04ce70d4
Reviewed-on: https://go-review.googlesource.com/23681
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/dist: skip an unsupported test on darwin/arm
Elias Naur [Thu, 2 Jun 2016 13:42:14 +0000 (15:42 +0200)]
cmd/dist: skip an unsupported test on darwin/arm

Fixes the darwin/arm builder (I hope)

Change-Id: I8a3502a1cdd468d4bf9a1c895754ada420b305ce
Reviewed-on: https://go-review.googlesource.com/23684
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agomisc/cgo/test: fix issue9400 test on android/386
Elias Naur [Thu, 2 Jun 2016 13:00:34 +0000 (15:00 +0200)]
misc/cgo/test: fix issue9400 test on android/386

The test for #9400 relies on an assembler function that manipulates
the stack pointer. Meanwile, it uses a global variable for
synchronization. However, position independent code on 386 use a
function call to fetch the base address for global variables.
That function call in turn overwrites the Go stack.

Fix that by fetching the global variable address once before the
stack register manipulation.

Fixes the android/386 builder.

Change-Id: Ib77bd80affaa12f09d582d09d8b84a73bd021b60
Reviewed-on: https://go-review.googlesource.com/23683
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agomisc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS
Elias Naur [Wed, 1 Jun 2016 20:51:30 +0000 (22:51 +0200)]
misc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS

For #15919

Change-Id: I9fc38d9c8a9cc9406b551315e1599750fe212d0d
Reviewed-on: https://go-review.googlesource.com/23635
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix typo in comment
Dmitry Vyukov [Thu, 2 Jun 2016 05:43:21 +0000 (07:43 +0200)]
runtime: fix typo in comment

Change-Id: I82e35770b45ccd1433dfae0af423073c312c0859
Reviewed-on: https://go-review.googlesource.com/23680
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet/http: http.Request.Context doc fix
Anmol Sethi [Thu, 2 Jun 2016 02:35:09 +0000 (22:35 -0400)]
net/http: http.Request.Context doc fix

The comment on http.Request.Context says that the context
is canceled when the client's connection closes even though
this has not been implemented. See #15927

Change-Id: I50b68638303dafd70f77f8f778e6caff102d3350
Reviewed-on: https://go-review.googlesource.com/23672
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: mention net/http/httptrace package in release notes
Andrew Gerrand [Thu, 2 Jun 2016 04:31:16 +0000 (14:31 +1000)]
doc: mention net/http/httptrace package in release notes

Updates #15810

Change-Id: I689e18409a88c9e8941aa2e98f472c331efd455e
Reviewed-on: https://go-review.googlesource.com/23674
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.7.html: fix spelling of cancelation
Ian Lance Taylor [Thu, 2 Jun 2016 04:09:58 +0000 (21:09 -0700)]
doc/go1.7.html: fix spelling of cancelation

We say "cancelation," not "cancellation."

Fixes #15928.

Change-Id: I66d545404665948a27281133cb9050eebf1debbb
Reviewed-on: https://go-review.googlesource.com/23673
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: do not generate tail calls when dynamic linking on ppc64le
Michael Hudson-Doyle [Fri, 27 May 2016 03:41:55 +0000 (15:41 +1200)]
cmd/compile: do not generate tail calls when dynamic linking on ppc64le

When a wrapper method calls the real implementation, it's not possible to use a
tail call when dynamic linking on ppc64le. The bad scenario is when a local
call is made to the wrapper: the wrapper will call the implementation, which
might be in a different module and so set the TOC to the appropriate value for
that module. But if it returns directly to the wrapper's caller, nothing will
reset it to the correct value for that function.

Change-Id: Icebf24c9a2a0a9a7c2bce6bd6f1358657284fb10
Reviewed-on: https://go-review.googlesource.com/23468
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agovendor: update vendored route
Mikio Hara [Wed, 1 Jun 2016 23:53:11 +0000 (08:53 +0900)]
vendor: update vendored route

Updates golang.org/x/net/route to rev fac978c for:
- route: fix typos in test

Change-Id: I35de1d3f8e887c6bb5fe50e7299f2fc12e4426de
Reviewed-on: https://go-review.googlesource.com/23660
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoapi: promote next.txt to go1.7.txt and update api tool go1.7beta1
Andrew Gerrand [Thu, 2 Jun 2016 00:00:23 +0000 (10:00 +1000)]
api: promote next.txt to go1.7.txt and update api tool

Change-Id: Idb348be00f949da553aa6aab62836f59dfee298d
Reviewed-on: https://go-review.googlesource.com/23671
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>

8 years agoapi: remove os.File.Size and http.Transport.Dialer
Andrew Gerrand [Wed, 1 Jun 2016 23:59:06 +0000 (09:59 +1000)]
api: remove os.File.Size and http.Transport.Dialer

This method and field were added and then later removed during the 1.7
development cycle.

Change-Id: I0482a6356b91d2be67880b44ef5d8a1daab49ec8
Reviewed-on: https://go-review.googlesource.com/23670
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agoapi: update next.txt
Andrew Gerrand [Wed, 1 Jun 2016 23:24:43 +0000 (09:24 +1000)]
api: update next.txt

Change-Id: I04da6a56382d3bd96e3c849a022618553039b2db
Reviewed-on: https://go-review.googlesource.com/23651
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agocrypto/tls: buffer handshake messages.
Adam Langley [Wed, 1 Jun 2016 21:41:09 +0000 (14:41 -0700)]
crypto/tls: buffer handshake messages.

This change causes TLS handshake messages to be buffered and written in
a single Write to the underlying net.Conn.

There are two reasons to want to do this:

Firstly, it's slightly preferable to do this in order to save sending
several, small packets over the network where a single one will do.

Secondly, since 37c28759ca46cf381a466e32168a793165d9c9e9 errors from
Write have been returned from a handshake. This means that, if a peer
closes the connection during a handshake, a “broken pipe” error may
result from tls.Conn.Handshake(). This can mask any, more detailed,
fatal alerts that the peer may have sent because a read will never
happen.

Buffering handshake messages means that the peer will not receive, and
possibly reject, any of a flow while it's still being written.

Fixes #15709

Change-Id: I38dcff1abecc06e52b2de647ea98713ce0fb9a21
Reviewed-on: https://go-review.googlesource.com/23609
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: update bundled http2
Tom Bergan [Fri, 27 May 2016 23:53:13 +0000 (16:53 -0700)]
net/http: update bundled http2

Updates x/net/http2 to git rev 6bdd4be4 for CL 23526:

  http2: GotFirstResponseByte hook should only fire once

Also updated the trace hooks test to verify that all trace hooks are called
exactly once except ConnectStart/End, which may be called multiple times (due
to happy-eyeballs).

Fixes #15777

Change-Id: Iea5c64eb322b58be27f9ff863b3a6f90e996fa9b
Reviewed-on: https://go-review.googlesource.com/23527
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: revert copyright date to 2009
Andrew Gerrand [Wed, 1 Jun 2016 22:11:01 +0000 (08:11 +1000)]
doc: revert copyright date to 2009

Somehow this date was changed in error (by me) to 2012.
It should have always been 2009.

Change-Id: I87029079458d4c4eeeff2f2fc0574f10afa9af09
Reviewed-on: https://go-review.googlesource.com/23622
Reviewed-by: Rob Pike <r@golang.org>
8 years agomisc/cgo/test,cmd/dist: enable (most) Cgo tests on Android
Elias Naur [Wed, 1 Jun 2016 18:58:02 +0000 (20:58 +0200)]
misc/cgo/test,cmd/dist: enable (most) Cgo tests on Android

Some tests cannot build for Android; use build tags and stubs to
skip them.

For #15919

Change-Id: Ieedcb73d4cabe23c3775cfb1d44c1276982dccd9
Reviewed-on: https://go-review.googlesource.com/23634
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: correctly export underlying type of predecl. error type
Robert Griesemer [Wed, 1 Jun 2016 20:46:49 +0000 (13:46 -0700)]
cmd/compile: correctly export underlying type of predecl. error type

Fixes #15920.

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

8 years agomath/big: avoid panic in float.Text with negative prec
Alberto Donizetti [Wed, 1 Jun 2016 17:16:56 +0000 (19:16 +0200)]
math/big: avoid panic in float.Text with negative prec

Fixes #15918

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

8 years agoruntime: document heap scavenger memory summary
Emmanuel Odeke [Sun, 22 May 2016 09:20:11 +0000 (02:20 -0700)]
runtime: document heap scavenger memory summary

Fixes #15212.

Change-Id: I2628ec8333330721cddc5145af1ffda6f3e0c63f
Reviewed-on: https://go-review.googlesource.com/23319
Reviewed-by: Austin Clements <austin@google.com>
8 years agoos/signal: deflake TestReset/TestIgnore
Ian Lance Taylor [Wed, 1 Jun 2016 16:31:31 +0000 (09:31 -0700)]
os/signal: deflake TestReset/TestIgnore

Fixes #15661.

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

8 years agocmd/compile: for arm, zero unaligned memory 1 byte at a time
Keith Randall [Tue, 31 May 2016 21:55:12 +0000 (14:55 -0700)]
cmd/compile: for arm, zero unaligned memory 1 byte at a time

If memory might be unaligned, zero it one byte at a time
instead of 4 bytes at a time.

Fixes #15902

Change-Id: I4eff0840e042e2f137c1a4028f08793eb7dfd703
Reviewed-on: https://go-review.googlesource.com/23587
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years agocmd/compile: fix TestAssembly on Plan 9
David du Colombier [Wed, 1 Jun 2016 13:13:55 +0000 (15:13 +0200)]
cmd/compile: fix TestAssembly on Plan 9

Since CL 23620, TestAssembly is failing on Plan 9.

In CL 23620, the process environment is passed to 'go tool compile'
after setting GOARCH. On Plan 9, if GOARCH is already set in the
process environment, it would take precedence. On Unix, it works
as expected because the first GOARCH found takes precedence.

This change uses the mergeEnvLists function from cmd/go/main.go
to merge the two environment lists such that variables with the
same name in "in" replace those in "out".

Change-Id: Idee22058343932ee18666dda331c562c89c33507
Reviewed-on: https://go-review.googlesource.com/23593
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: rename Unshare to Unshareflags in go1.7 release notes
Dan Peterson [Wed, 1 Jun 2016 12:44:38 +0000 (09:44 -0300)]
doc: rename Unshare to Unshareflags in go1.7 release notes

Implementation changed in https://golang.org/cl/23612.

Updates #15810

Change-Id: I8fff9e3aa3e54162546bb9ec1cc2ebba2b6d9fed
Reviewed-on: https://go-review.googlesource.com/23614
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoregexp: use Run for benchmark
Marcel van Lohuizen [Thu, 26 May 2016 09:46:19 +0000 (11:46 +0200)]
regexp: use Run for benchmark

Change-Id: I4d19e3221d3789d4c460b421b2d1484253778068
Reviewed-on: https://go-review.googlesource.com/23429
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>

8 years agosyscall: rename SysProcAttr.Unshare to Unshareflags
Alexander Morozov [Wed, 1 Jun 2016 02:44:48 +0000 (19:44 -0700)]
syscall: rename SysProcAttr.Unshare to Unshareflags

For symmetry with Cloneflags and it looks slightly weird because there
is syscall.Unshare method.

Change-Id: I3d710177ca8f27c05b344407f212cbbe3435094b
Reviewed-on: https://go-review.googlesource.com/23612
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/compile: pass process env to 'go tool compile' in compileToAsm
Michael Hudson-Doyle [Wed, 1 Jun 2016 01:32:53 +0000 (13:32 +1200)]
cmd/compile: pass process env to 'go tool compile' in compileToAsm

In particular, this stops the test failing when GOROOT and GOROOT_FINAL are
different.

Change-Id: Ibf6cc0a173f1d965ee8aa31eee2698b223f1ceec
Reviewed-on: https://go-review.googlesource.com/23620
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocontext: fix typo in comments
Kenny Grant [Tue, 31 May 2016 21:30:37 +0000 (22:30 +0100)]
context: fix typo in comments

Change-Id: I41310ec88c889fda79d80eaf4a742a1000284f60
Reviewed-on: https://go-review.googlesource.com/23591
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 agocrypto/tls: remove unused variable in benchmark code
Robert Griesemer [Sat, 28 May 2016 02:47:55 +0000 (19:47 -0700)]
crypto/tls: remove unused variable in benchmark code

This fixes `go test go/types`.

https://golang.org/cl/23487/ introduced this code which contains
two unused variables (declared and assigned to, but never read).
cmd/compile doesn't report the error due open issue #8560 (the
variables are assigned to in a closure), but go/types does. The
build bot only runs go/types tests in -short mode (which doesn't
typecheck the std lib), hence this doesn't show up on the dashboard
either.

We cannot call b.Fatal and friends in the goroutine. Communicating
the error to the invoking function requires a channel or a mutex.
Unless the channel/sycnhronized variable is tested in each iteration
that follows, the iteration blocks if there's a failure. Testing in
each iteration may affect benchmark times.

One could use a time-out but that time depends on the underlying system.
Panicking seems good enough in this unlikely case; better than hanging
or affecting benchmark times.

Change-Id: Idce1172da8058e580fa3b3e398825b0eb4316325
Reviewed-on: https://go-review.googlesource.com/23528
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: test non-constant shifts
Keith Randall [Tue, 31 May 2016 20:48:29 +0000 (13:48 -0700)]
cmd/compile: test non-constant shifts

Test all the weird shifts, like int8 shifted right by uint16.
Increases coverage for shift lowerings in AMD64.rules.

Change-Id: I066fe6ad6bfc05253a8d6a2ee17ff244d3a7652e
Reviewed-on: https://go-review.googlesource.com/23585
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agospec: document that duplicate types are invalid in type switches
Robert Griesemer [Tue, 31 May 2016 20:32:34 +0000 (13:32 -0700)]
spec: document that duplicate types are invalid in type switches

Both compilers and also go/types don't permit duplicate types in
type switches; i.e., this spec change is documenting a status quo
that has existed for some time.

Furthermore, duplicate nils are not accepted by gccgo or go/types;
and more recently started causing a compiler error in gc. Permitting
them is inconsistent with the existing status quo.

Rather than making it an implementation restriction (as we have for
expression switches), this is a hard requirement since it was enforced
from the beginning (except for duplicate nils); it is also a well
specified requirement that does not pose a significant burden for
an implementation.

Fixes #15896.

Change-Id: If12db5bafa87598b323ea84418cb05421e657dd8
Reviewed-on: https://go-review.googlesource.com/23584
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoflag: recognize "0s" as the zero value for a flag.Duration
Ian Lance Taylor [Tue, 31 May 2016 18:23:50 +0000 (11:23 -0700)]
flag: recognize "0s" as the zero value for a flag.Duration

Implemented by using a reflect-based approach to recognize the zero
value of any non-interface type that implements flag.Value.  Interface
types will fall back to the old code.

Fixes #15904.

Change-Id: I594c3bfb30e9ab1aca3e008ef7f70be20aa41a0b
Reviewed-on: https://go-review.googlesource.com/23581
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agotest: add more switch error handling tests
Josh Bleecher Snyder [Tue, 31 May 2016 22:01:05 +0000 (15:01 -0700)]
test: add more switch error handling tests

Some of these errors are reported in the wrong places.
That’s issue #15911 and #15912.

Change-Id: Ia09d7f89be4d15f05217a542a61b6ac08090dd87
Reviewed-on: https://go-review.googlesource.com/23588
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: combine gccgo's ld and ldShared methods
Michael Hudson-Doyle [Tue, 31 May 2016 08:48:42 +0000 (20:48 +1200)]
cmd/go: combine gccgo's ld and ldShared methods

This fixes handling of cgo flags and makes sure packages that are only
implicitly included in the shared library are passed to the link.

Fixes #15885

Change-Id: I1e8a72b5314261973ca903c78834700fb113dde9
Reviewed-on: https://go-review.googlesource.com/23537
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix restoring PC in ARM version of cgocallback_gofunc
Ian Lance Taylor [Tue, 31 May 2016 21:07:38 +0000 (14:07 -0700)]
runtime: fix restoring PC in ARM version of cgocallback_gofunc

Fixes #15856.

Change-Id: Ia8def161642087e4bd92a87298c77a0f9f83dc86
Reviewed-on: https://go-review.googlesource.com/23586
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: pass signal context to cgo traceback function
Ian Lance Taylor [Fri, 27 May 2016 17:05:52 +0000 (10:05 -0700)]
runtime: pass signal context to cgo traceback function

When doing a backtrace from a signal that occurs in C code compiled
without using -fasynchronous-unwind-tables, we have to rely on frame
pointers. In order to do that, the traceback function needs the signal
context to reliably pick up the frame pointer.

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

8 years agodoc/go1.7.html: make RFC an actual link
Joe Tsai [Tue, 31 May 2016 19:42:34 +0000 (12:42 -0700)]
doc/go1.7.html: make RFC an actual link

Change-Id: I5e8dad0c2534b5c3654cf0a0b51a38186d627a3c
Reviewed-on: https://go-review.googlesource.com/23582
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: update pprof binary header URL
Ian Lance Taylor [Fri, 27 May 2016 21:33:23 +0000 (14:33 -0700)]
runtime: update pprof binary header URL

The code has moved from code.google.com to github.com.

Change-Id: I0cc9eb69b3fedc9e916417bc7695759632f2391f
Reviewed-on: https://go-review.googlesource.com/23523
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocmd/link: suppress PIE whenever externally linking with a sanitizer
Michael Hudson-Doyle [Tue, 31 May 2016 07:24:30 +0000 (19:24 +1200)]
cmd/link: suppress PIE whenever externally linking with a sanitizer

golang.org/issue/15443 complained that a race-enabled PIE binary crashed at
startup, but other ways of linking in tsan (or other sanitizers) such as

 #cgo CFLAGS: -fsanitize=thread
 #cgo LDFLAGS: -fsanitize=thread

have the same problem. Pass -no-pie to the host linker (if supported) if any
-fsanitizer=foo cgo LDFLAG is seen when linking.

Fixes #15887

Change-Id: Id799770f8d045f6f40fa8c463563937a5748d1a8
Reviewed-on: https://go-review.googlesource.com/23535
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go, cmd/link: set LC_ALL=C when checking if host compiler supports -no-pie
Michael Hudson-Doyle [Tue, 31 May 2016 08:05:39 +0000 (20:05 +1200)]
cmd/go, cmd/link: set LC_ALL=C when checking if host compiler supports -no-pie

Fixes #15900

Change-Id: Ieada5f4e3b3b2ae358414e013f3090b4b820569b
Reviewed-on: https://go-review.googlesource.com/23536
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime/cgo: add TSAN acquire/release calls
Ian Lance Taylor [Fri, 27 May 2016 00:47:03 +0000 (17:47 -0700)]
runtime/cgo: add TSAN acquire/release calls

Add TSAN acquire/release calls to runtime/cgo to match the ones
generated by cgo.  This avoids a false positive race around the malloc
memory used in runtime/cgo when other goroutines are simultaneously
calling malloc and free from cgo.

These new calls will only be used when building with CGO_CFLAGS and
CGO_LDFLAGS set to -fsanitize=thread, which becomes a requirement to
avoid all false positives when using TSAN.  These are needed not just
for runtime/cgo, but also for any runtime package that uses cgo (such as
net and os/user).

Add an unused attribute to the _cgo_tsan_acquire and _cgo_tsan_release
functions, in case there are no actual cgo function calls.

Add a test that checks that setting CGO_CFLAGS/CGO_LDFLAGS avoids a
false positive report when using os/user.

Change-Id: I0905c644ff7f003b6718aac782393fa219514c48
Reviewed-on: https://go-review.googlesource.com/23492
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agocmd/compile: disallow multiple nil cases in a type switch
Josh Bleecher Snyder [Mon, 30 May 2016 23:42:38 +0000 (16:42 -0700)]
cmd/compile: disallow multiple nil cases in a type switch

Fixes #15898.

Change-Id: I66e2ad21f283563c7142aa820f0354711d964768
Reviewed-on: https://go-review.googlesource.com/23573
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocompress/flate: use seperate const block for exported constants
Joe Tsai [Sun, 29 May 2016 07:47:45 +0000 (00:47 -0700)]
compress/flate: use seperate const block for exported constants

As rendered on https://tip.golang.org/pkg/compress/flate/, there is an
extra new-line because of the unexported constants in the same block.

<<<
const (
    NoCompression      = 0
    BestSpeed          = 1
    BestCompression    = 9
    DefaultCompression = -1
    HuffmanOnly        = -2 // Disables match search and only does Huffman entropy reduction.

)
>>>

Instead, seperate the exported compression level constants into its own
const block. This is both more readable and also fixes the issue.

Change-Id: I60b7966c83fb53356c02e4640d05f55a3bee35b7
Reviewed-on: https://go-review.googlesource.com/23557
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 agoruntime/pprof, cmd/pprof: fix profiling for PIE
Ian Lance Taylor [Fri, 27 May 2016 23:03:44 +0000 (16:03 -0700)]
runtime/pprof, cmd/pprof: fix profiling for PIE

In order to support pprof for position independent executables, pprof
needs to adjust the PC addresses stored in the profile by the address at
which the program is loaded. The legacy profiling support which we use
already supports recording the GNU/Linux /proc/self/maps data
immediately after the CPU samples, so do that. Also change the pprof
symbolizer to use the information, if available, when looking up
addresses in the Go pcline data.

Fixes #15714.

Change-Id: I4bf679210ef7c51d85cf873c968ce82db8898e3e
Reviewed-on: https://go-review.googlesource.com/23525
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agocrypto/tls: reduce size of buffer in throughput benchmarks
Andrew Gerrand [Tue, 31 May 2016 03:21:35 +0000 (13:21 +1000)]
crypto/tls: reduce size of buffer in throughput benchmarks

The Windows builders run the throughput benchmarks really slowly with a
64kb buffer. Lowering it to 16kb brings the performance back into line
with the other builders.

This is a work-around to get the build green until we can figure out why
the Windows builders are slow with the larger buffer size.

Update #15899

Change-Id: I215ebf115e8295295c87f3b3e22a4ef1f9e77f81
Reviewed-on: https://go-review.googlesource.com/23574
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosyscall: plan9 - mark gbit16 as go:nosplit
Richard Miller [Sat, 28 May 2016 09:06:37 +0000 (10:06 +0100)]
syscall: plan9 - mark gbit16 as go:nosplit

This is a correction to CL 22610.  The gbit16 function is called in
StartProcess between fork and exec, and therefore must not split the
stack.  Normally it's inlined so this is not an issue, but on one
occasion I've observed it to be compiled without inlining, and the
result was a panic.  Mark it go:nosplit to be safe.

Change-Id: I0381754397b766431bf406d9767c73598d23b901
Reviewed-on: https://go-review.googlesource.com/23560
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosync: document that RWMutex read locks may not be held recursively
Andrew Gerrand [Mon, 30 May 2016 05:17:14 +0000 (15:17 +1000)]
sync: document that RWMutex read locks may not be held recursively

Fixes #15418

Change-Id: Ibc51d602eb28819d0e44e5ca13a5c61573e4111c
Reviewed-on: https://go-review.googlesource.com/23570
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agopath/filepath: prevent infinite recursion on Windows on UNC input
Josh Bleecher Snyder [Mon, 30 May 2016 19:57:20 +0000 (12:57 -0700)]
path/filepath: prevent infinite recursion on Windows on UNC input

This is a minimal fix to prevent this and
other possible future infinite recursion.
We can put in a proper fix for UNC in Go 1.8.

Updates #15879

Change-Id: I3653cf5891bab8511adf66fa3c1a1d8912d1a293
Reviewed-on: https://go-review.googlesource.com/23572
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: remove remnant mention of io.SizedReaderAt from Go 1.7 docs
Andrew Gerrand [Mon, 30 May 2016 05:17:14 +0000 (15:17 +1000)]
doc: remove remnant mention of io.SizedReaderAt from Go 1.7 docs

Updates #15810

Change-Id: I37f14a0ed1f5ac24ea2169a7e65c0469bfddd928
Reviewed-on: https://go-review.googlesource.com/23559
Reviewed-by: Michael McGreevy <mcgreevy@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>