]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
8 years ago[release-branch.go1.6] go1.6.2 go1.6.2
Andrew Gerrand [Tue, 19 Apr 2016 23:11:35 +0000 (09:11 +1000)]
[release-branch.go1.6] go1.6.2

Change-Id: Ifc545faaed438b72bfa63beb74cde2d3a67ef0e7
Reviewed-on: https://go-review.googlesource.com/22252
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: document go1.6.2
Andrew Gerrand [Tue, 19 Apr 2016 23:16:00 +0000 (09:16 +1000)]
doc: document go1.6.2

Change-Id: Ib3063719cf90dfad139dd723b3b16ef0b45e312e
Reviewed-on: https://go-review.googlesource.com/22251
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22253
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years ago[release-branch.go1.6] net/http: TimeoutHandler should start timer when serving request
Caio Marcelo de Oliveira Filho [Mon, 29 Feb 2016 15:06:57 +0000 (12:06 -0300)]
[release-branch.go1.6] net/http: TimeoutHandler should start timer when serving request

TimeoutHandler was starting the Timer when the handler was created,
instead of when serving a request. It also was sharing it between
multiple requests, which is incorrect, as the requests might start
at different times.

Store the timeout duration and create the Timer when ServeHTTP is
called. Different requests will have different timers.

The testing plumbing was simplified to store the channel used to
control when timeout happens. It overrides the regular timer.

Fixes #14568.

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

8 years agocmd/compile: note escape of parts of closured-capture vars
David Chase [Thu, 14 Apr 2016 15:04:00 +0000 (11:04 -0400)]
cmd/compile: note escape of parts of closured-capture vars

Missed a case for closure calls (OCALLFUNC && indirect) in
esc.go:esccall.

Cleanup to runtime code for windows to more thoroughly hide
a technical escape.  Also made code pickier about failing
to late non-optional kernel32.dll.

Revised for 1.6.2

Fixes #14409.

Change-Id: Ie75486a2c8626c4583224e02e4872c2875f7bca5
Reviewed-on: https://go-review.googlesource.com/22050
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agosyscall: fix epoll_event struct for ppc64le/ppc64
Lynn Boger [Wed, 6 Apr 2016 16:07:12 +0000 (11:07 -0500)]
syscall:  fix epoll_event struct for ppc64le/ppc64

The existing epoll_event structure used by many of
the epoll_* syscalls was defined incorrectly
for use with ppc64le & ppc64 in the syscall
directory.  This resulted in the caller getting
incorrect information on return from these
syscalls.  This caused failures in fsnotify as
well as builds with upstream Docker.  The
structure is defined correctly in gccgo.

This adds a pad field that is expected for
these syscalls on ppc64le, ppc64.
Fixes #15135

Fixes #15288

Change-Id: If7e8ea9eb1d1ca5182c8dc0f935b334127341ffd
Reviewed-on: https://go-review.googlesource.com/21582
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/22207
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: clamp OS-reported number of processors to _MaxGomaxprocs
Michael Hudson-Doyle [Wed, 6 Apr 2016 23:47:32 +0000 (11:47 +1200)]
runtime: clamp OS-reported number of processors to _MaxGomaxprocs

So that all Go processes do not die on startup on a system with >256 CPUs.

I tested this by hacking osinit to set ncpu to 1000.

Updates #15131
Fixes #15160

Change-Id: I52e061a0de97be41d684dd8b748fa9087d6f1aef
Reviewed-on: https://go-review.googlesource.com/21599
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22206

8 years agodoc: link to iant's generics proposal from the FAQ.
David Symonds [Sun, 17 Apr 2016 23:20:58 +0000 (09:20 +1000)]
doc: link to iant's generics proposal from the FAQ.

Updates #15292.

Change-Id: I229f66c2a41ae0738225f2ba7a574478f5d6d620
Reviewed-on: https://go-review.googlesource.com/22163
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-on: https://go-review.googlesource.com/22166
Reviewed-by: David Symonds <dsymonds@golang.org>
8 years agodoc: add classes to version tags in source install instructions
Andrew Gerrand [Thu, 14 Apr 2016 02:12:11 +0000 (12:12 +1000)]
doc: add classes to version tags in source install instructions

This will allow us to mechanically substitute these strings
using javascript (in a forthcoming change to x/tools/godoc).

Updates #14371

Change-Id: I96e876283060ffbc9f3eabaf55d6b880685453e1
Reviewed-on: https://go-review.googlesource.com/22055
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22069

8 years agocmd/go: clear cmd cache to avoid duplicate loads errors
Dmitriy Dudkin [Thu, 25 Feb 2016 19:48:57 +0000 (21:48 +0200)]
cmd/go: clear cmd cache to avoid duplicate loads errors

go get -u all command updates all packages including standard
commands. We need to get commands evicted from their cache to
avoid loading old versions of the packages evicted from the
packages cache.

Fixes #14444

Change-Id: Icd581a26e1db34ca634aba595fed62b097094c2f
Reviewed-on: https://go-review.googlesource.com/19899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22040
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: fix bogus HTML in contribute.html
Brad Fitzpatrick [Wed, 9 Mar 2016 16:36:44 +0000 (08:36 -0800)]
doc: fix bogus HTML in contribute.html

Introduced in https://golang.org/cl/20462

Change-Id: I6c55f87228f0980058a10f204b57ead7594e3492
Reviewed-on: https://go-review.googlesource.com/20490
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-on: https://go-review.googlesource.com/22075
Reviewed-by: Minux Ma <minux@golang.org>
8 years agoruntime: more deflaking of TestCgoCheckBytes
Ian Lance Taylor [Fri, 26 Feb 2016 05:16:45 +0000 (21:16 -0800)]
runtime: more deflaking of TestCgoCheckBytes

Fixes #14519.

Change-Id: I8f78f67a463e6467e09df90446f7ebd28789d6c9
Reviewed-on: https://go-review.googlesource.com/19933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/22071
Run-TryBot: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: deflake TestCgoCheckBytes
Ian Lance Taylor [Wed, 24 Feb 2016 01:16:21 +0000 (17:16 -0800)]
runtime: deflake TestCgoCheckBytes

Bump up the multiplier to 20.  Also run the fast version first, so that
the slow version is likely to start up faster.

Change-Id: Ia0654cc1212ab03a45da1904d3e4b57d6a8d02a0
Reviewed-on: https://go-review.googlesource.com/19835
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/22070
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: revise importPath when ImportPath is 'command-line-arguments'
Cheng-Lung Sung [Wed, 6 Apr 2016 15:05:20 +0000 (23:05 +0800)]
cmd/go: revise importPath when ImportPath is 'command-line-arguments'

Fixes #14613

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

8 years agoruntime: fix pagesInUse accounting
Austin Clements [Tue, 29 Mar 2016 16:28:24 +0000 (12:28 -0400)]
runtime: fix pagesInUse accounting

When we grow the heap, we create a temporary "in use" span for the
memory acquired from the OS and then free that span to link it into
the heap. Hence, we (1) increase pagesInUse when we make the temporary
span so that (2) freeing the span will correctly decrease it.

However, currently step (1) increases pagesInUse by the number of
pages requested from the heap, while step (2) decreases it by the
number of pages requested from the OS (the size of the temporary
span). These aren't necessarily the same, since we round up the number
of pages we request from the OS, so steps 1 and 2 don't necessarily
cancel out like they're supposed to. Over time, this can add up and
cause pagesInUse to underflow and wrap around to 2^64. The garbage
collector computes the sweep ratio from this, so if this happens, the
sweep ratio becomes effectively infinite, causing the first allocation
on each P in a sweep cycle to sweep the entire heap. This makes
sweeping effectively STW.

Fix this by increasing pagesInUse in step 1 by the number of pages
requested from the OS, so that the two steps correctly cancel out. We
add a test that checks that the running total matches the actual state
of the heap.

Fixes #15022. For 1.6.x.

Change-Id: Iefd9d6abe37d0d447cbdbdf9941662e4f18eeffc
Reviewed-on: https://go-review.googlesource.com/21280
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/21456
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: preserve darwin/arm{,64} callee-save registers
Elias Naur [Sat, 12 Mar 2016 11:13:11 +0000 (12:13 +0100)]
runtime: preserve darwin/arm{,64} callee-save registers

CL 14603 attempted to preserve the callee-save registers for
the darwin/arm runtime initialization routine, but I believe it
wasn't sufficient and resulted in the crash reported in issue

Saving and restoring the registers on the stack the same way
linux/arm does seems more obvious and fixes #14778, so do that.

Even though #14778 is not reproducible on darwin/arm64, I applied
a similar change there, and to linux/arm64 which obeys the same
calling convention.

Finally, this CL is a candidate for a 1.6 minor release for the same
reason CL 14603 was in a 1.5 minor release (as CL 16968). It is
small and only touches the iOS platforms and gomobile on darwin/arm
is currently useless without it.

Fixes #14778
Fixes #12590 (again)

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

8 years agodoc: GCC 6 will have the Go 1.6 user libraries
Ian Lance Taylor [Thu, 10 Mar 2016 22:33:33 +0000 (14:33 -0800)]
doc: GCC 6 will have the Go 1.6 user libraries

Fixes #14759.

Change-Id: I6cef0b49ba00ab85b25ce1e7bad80ad85e2d5076
Reviewed-on: https://go-review.googlesource.com/20545
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-on: https://go-review.googlesource.com/22048
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: use new Gerrit URL and mention our instance in CONTRIBUTING.md
Andrew Gerrand [Wed, 9 Mar 2016 00:30:24 +0000 (11:30 +1100)]
doc: use new Gerrit URL and mention our instance in CONTRIBUTING.md

Fixes #14662

Change-Id: I8f7d5e8d2dd8dc763e940e061b424427359246e7
Reviewed-on: https://go-review.googlesource.com/20462
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22047

8 years agodarwin/amd64: fix text-relocation issues for c-archive libraries

Aaron Zinman [Thu, 4 Feb 2016 01:36:15 +0000 (17:36 -0800)]
darwin/amd64: fix text-relocation issues for c-archive libraries


The existing implementation deals with absolute relocations in __TEXT
for darwin/amd64 in build-mode c-shared, but it ignores c-archive.
This results in issues when trying to use a c-archive in an iOS
app on the 64-bit simulator. This patch adds c-archive to the
handling of this issue.

Fixes #14217

Change-Id: I2e4d5193caa531171ad22fd0cd420a8bfb4646a6
Reviewed-on: https://go-review.googlesource.com/19206
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22046

8 years agomime/multipart: don't call Read on io.Reader after an error is seen
Brad Fitzpatrick [Mon, 7 Mar 2016 16:35:45 +0000 (08:35 -0800)]
mime/multipart: don't call Read on io.Reader after an error is seen

The io.Reader contract makes no promises about how a Reader should
behave after it returns its first error. Usually the errors are
sticky, but they don't have to be. A regression in zlib.Reader (bug
accidentally relied on sticky errors.

Minimal fix: wrap the user's provided Reader in a Reader which
guarantees stickiness. The minimal fix is less scary than touching
the multipart state machine.

Fixes #14676

Change-Id: I8dd8814b13ae5530824ae0e68529f788974264a5
Reviewed-on: https://go-review.googlesource.com/20297
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22045

8 years agoruntime: disable gcMarkRootCheck debugging check during STW
Austin Clements [Wed, 2 Mar 2016 02:30:26 +0000 (21:30 -0500)]
runtime: disable gcMarkRootCheck debugging check during STW

gcMarkRootCheck takes ~10ns per goroutine. This is just a debugging
check, so disable it (plus, if something is going to go wrong, it's
more likely to go wrong during concurrent mark).

We may be able to re-enable this later, or move it to after we've
started the world again. (But not for 1.6.x.)

For 1.6.x.

Fixes #14419.

name / 95%ile-time/markTerm          old          new  delta
500kIdleGs-12                24.0ms ± 0%  18.9ms ± 6%  -21.46%  (p=0.000 n=15+20)

Change-Id: Idb2a2b1771449de772c159ef95920d6df1090666
Reviewed-on: https://go-review.googlesource.com/20148
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22044
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: reset mark state before stopping the world
Austin Clements [Tue, 1 Mar 2016 20:09:24 +0000 (15:09 -0500)]
runtime: reset mark state before stopping the world

Currently we reset the mark state during STW sweep termination. This
involves looping over all of the goroutines. Each iteration of this
loop takes ~25ns, so at around 400k goroutines, we'll exceed our 10ms
pause goal.

However, it's safe to do this before we stop the world for sweep
termination because nothing is consuming this state yet. Hence, move
the reset to just before STW.

This isn't perfect: a long reset can still delay allocating goroutines
that block on GC starting. But it's certainly better to block some
things eventually than to block everything immediately.

For 1.6.x.

Fixes #14420.

name \ 95%ile-time/sweepTerm           old          new  delta
500kIdleGs-12                 11312µs ± 6%  18.9µs ± 6%  -99.83%  (p=0.000 n=16+20)

Change-Id: I9815c4d8d9b0d3c3e94dfdab78049cefe0dcc93c
Reviewed-on: https://go-review.googlesource.com/20147
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22043
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: fix off-by-one error finding module for PC
Ian Lance Taylor [Fri, 4 Mar 2016 19:29:55 +0000 (11:29 -0800)]
runtime: fix off-by-one error finding module for PC

Also fix compiler-invoked panics to avoid a confusing "malloc deadlock"
crash if they are invoked while executing the runtime.

Fixes #14599.

Change-Id: I89436abcbf3587901909abbdca1973301654a76e
Reviewed-on: https://go-review.googlesource.com/20219
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-on: https://go-review.googlesource.com/22042
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/cgo: recognize known C typedefs as types
Ian Lance Taylor [Wed, 24 Feb 2016 00:11:46 +0000 (16:11 -0800)]
cmd/cgo: recognize known C typedefs as types

Fixes #14483.

Change-Id: I0cddfe27fd8d00ba85659d0b618410e39ebf45cb
Reviewed-on: https://go-review.googlesource.com/19860
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22041
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosort: fix for nondeterministic less function in quicksort pivot
Jure Ham [Tue, 23 Feb 2016 10:41:27 +0000 (11:41 +0100)]
sort: fix for nondeterministic less function in quicksort pivot

Fixes #14377

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

8 years agoruntime, syscall: switch linux/386 to use int 0x80
Shenghou Ma [Tue, 23 Feb 2016 06:26:50 +0000 (01:26 -0500)]
runtime, syscall: switch linux/386 to use int 0x80

Like bionic, musl also doesn't provide vsyscall helper in %gs:0x10,
and as int $0x80 is as fast as calling %gs:0x10, just use int $0x80
always.

Because we're no longer using vsyscall in VDSO, get rid of VDSO code
for linux/386 too.

Fixes #14476.

Change-Id: I00ec8652060700e0a3c9b524bfe3c16a810263f6
Reviewed-on: https://go-review.googlesource.com/19833
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22038
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: use correct psABI SP alignment before calling libc mmap
Shenghou Ma [Thu, 18 Feb 2016 21:29:39 +0000 (16:29 -0500)]
runtime: use correct psABI SP alignment before calling libc mmap

Fixes #14384.

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

8 years agoruntime: skip cgo check for non-pointer slice elements
Ian Lance Taylor [Thu, 18 Feb 2016 19:04:05 +0000 (11:04 -0800)]
runtime: skip cgo check for non-pointer slice elements

Fixes #14387.

Change-Id: Icc98be80f549c5e1f55c5e693bfea97b456a6c41
Reviewed-on: https://go-review.googlesource.com/19621
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/22036
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: fix bug where http2 wasn't enabled on DefaultTransport
Brad Fitzpatrick [Thu, 18 Feb 2016 22:59:13 +0000 (04:29 +0530)]
net/http: fix bug where http2 wasn't enabled on DefaultTransport

I had accidentally disabled a headline feature at the last second. :(

Fixes #14391

Change-Id: I1992c9b801072b7538b95c55242be174075ff932
Reviewed-on: https://go-review.googlesource.com/19672
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years ago[release-branch.go1.6] go1.6.1 go1.6.1
Andrew Gerrand [Mon, 11 Apr 2016 05:05:37 +0000 (15:05 +1000)]
[release-branch.go1.6] go1.6.1

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

8 years agodoc: document Go 1.6.1 and Go 1.5.4
Andrew Gerrand [Mon, 11 Apr 2016 04:54:54 +0000 (14:54 +1000)]
doc: document Go 1.6.1 and Go 1.5.4

Change-Id: Icb9e947a43fb87fbfe0655b09e0d7e8f61825aeb
Reviewed-on: https://go-review.googlesource.com/21825
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/21826
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: leave directory before removing it in TestDLLPreloadMitigation
Alex Brainman [Tue, 5 Apr 2016 01:31:50 +0000 (11:31 +1000)]
runtime: leave directory before removing it in TestDLLPreloadMitigation

Fixes #15120

Change-Id: I1d9a192ac163826bad8b46e8c0b0b9e218e69570
Reviewed-on: https://go-review.googlesource.com/21520
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/21698
Run-TryBot: Andrew Gerrand <adg@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
8 years agosyscall: point to x/sys in DLL loading docs, update syscall generator
Brad Fitzpatrick [Sat, 2 Apr 2016 00:20:13 +0000 (00:20 +0000)]
syscall: point to x/sys in DLL loading docs, update syscall generator

Updates the syscall generator for patchset 4 of https://golang.org/cl/21388.

Updates #14959

Change-Id: Icbd6df489887d3dcc076dfc73d4feb1376abaf8b
Reviewed-on: https://go-review.googlesource.com/21428
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-on: https://go-review.googlesource.com/21697
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime, syscall: only search for Windows DLLs in the System32 directory
Brad Fitzpatrick [Fri, 25 Mar 2016 06:40:58 +0000 (06:40 +0000)]
runtime, syscall: only search for Windows DLLs in the System32 directory

Make sure that for any DLL that Go uses itself, we only look for the
DLL in the Windows System32 directory, guarding against DLL preloading
attacks.

(Unless the Windows version is ancient and LoadLibraryEx is
unavailable, in which case the user probably has bigger security
problems anyway.)

This does not change the behavior of syscall.LoadLibrary or NewLazyDLL
if the DLL name is something unused by Go itself.

This change also intentionally does not add any new API surface. Instead,
x/sys is updated with a LoadLibraryEx function and LazyDLL.Flags in:
    https://golang.org/cl/21388

Updates #14959

Change-Id: I8d29200559cc19edf8dcf41dbdd39a389cd6aeb9
Reviewed-on: https://go-review.googlesource.com/21140
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/21696
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocrypto/rsa, crypto/ecdsa: fail earlier on zero parameters
Brad Fitzpatrick [Tue, 5 Apr 2016 20:40:40 +0000 (20:40 +0000)]
crypto/rsa, crypto/ecdsa: fail earlier on zero parameters

Change-Id: Ia6ed49d5ef3a256a55e6d4eaa1b4d9f0fc447013
Reviewed-on: https://go-review.googlesource.com/21560
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/21695
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocrypto/dsa: eliminate invalid PublicKey early
Robert Griesemer [Tue, 5 Apr 2016 16:44:00 +0000 (09:44 -0700)]
crypto/dsa: eliminate invalid PublicKey early

For PublicKey.P == 0, Verify will fail. Don't even try.

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

8 years ago[release-branch.go1.6] doc: add link to 1.6 release notes on golang.org/project page
Chris Broadfoot [Thu, 3 Mar 2016 00:16:29 +0000 (16:16 -0800)]
[release-branch.go1.6] doc: add link to 1.6 release notes on golang.org/project page

Fixes #14378.

Change-Id: I680b523c01576e42f1dbda9131d1f6bb99b3668b
Reviewed-on: https://go-review.googlesource.com/20138
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/20139
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years ago[release-branch.go1.6] doc: update release tag in source directions to go1.6
nwidger [Sun, 28 Feb 2016 13:51:06 +0000 (08:51 -0500)]
[release-branch.go1.6] doc: update release tag in source directions to go1.6

Fixes #14371

Change-Id: I8e9e4b2b89083f5a947e791c011912fdf365a11e
Reviewed-on: https://go-review.googlesource.com/19996
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-on: https://go-review.googlesource.com/20001
Reviewed-by: Niels Widger <niels.widger@gmail.com>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years ago[release-branch.go1.6] doc: fix typo in go1.6 release date.
Rahul Chaudhry [Wed, 17 Feb 2016 22:55:16 +0000 (14:55 -0800)]
[release-branch.go1.6] doc: fix typo in go1.6 release date.

Change-Id: If15fdcd3cd49394a0c1dffd39fbbeede11081ccb
Reviewed-on: https://go-review.googlesource.com/19528
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/19590

8 years ago[release-branch.go1.6] doc: document Go 1.6
Chris Broadfoot [Wed, 17 Feb 2016 22:02:26 +0000 (14:02 -0800)]
[release-branch.go1.6] doc: document Go 1.6

Change-Id: I4910105d48ed650289ecb1490d556929db05bc38
Reviewed-on: https://go-review.googlesource.com/19526
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agogo1.6 go1.6
Russ Cox [Wed, 17 Feb 2016 18:53:30 +0000 (13:53 -0500)]
go1.6

Change-Id: I5744bffe2af1706d9ac61d943aef18ce611cb623
Reviewed-on: https://go-review.googlesource.com/19580
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoall: merge master into release-branch.go1.6
Russ Cox [Wed, 17 Feb 2016 18:45:03 +0000 (13:45 -0500)]
all: merge master into release-branch.go1.6

Change-Id: Ie2a999e36ee654c1217bd03f720791360f66718d

8 years agodoc: remove DRAFT tags from go1.6.html
Russ Cox [Wed, 17 Feb 2016 15:39:13 +0000 (10:39 -0500)]
doc: remove DRAFT tags from go1.6.html

Go 1.6 is soon (but not yet).

Fixes #14301.

Change-Id: I85e329b643adcb5d4fa680c5333fbc1f928d4d9d
Reviewed-on: https://go-review.googlesource.com/19550
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agonet/http: update bundle command
Russ Cox [Wed, 17 Feb 2016 15:41:03 +0000 (10:41 -0500)]
net/http: update bundle command

This is the bundle command's new usage and new output header,
after CL 19428.

Actually running this command would work but would bring in
a newer x/net/http2 that we don't want yet.

Change-Id: Ic6082ca00102a2df1f7632eebf9aca41fdcdb444
Reviewed-on: https://go-review.googlesource.com/19551
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agodoc: mention multi-change branches in contribute.html
Russ Cox [Wed, 17 Feb 2016 15:46:30 +0000 (10:46 -0500)]
doc: mention multi-change branches in contribute.html

Fixes #13651.

Change-Id: I1d21b49e2b5bc6c507eb084d6d2553e5a9c607cf
Reviewed-on: https://go-review.googlesource.com/19552
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agocmd/go: avoid race on test environment
Ian Lance Taylor [Tue, 16 Feb 2016 15:13:10 +0000 (07:13 -0800)]
cmd/go: avoid race on test environment

Fixes #14337.

Change-Id: I58aef7e08d936b0712da577dd1ce5c9ed5d8bfd2
Reviewed-on: https://go-review.googlesource.com/19513
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix deadlock in TestCrashDumpsAllThreads
Austin Clements [Tue, 16 Feb 2016 19:42:24 +0000 (14:42 -0500)]
runtime: fix deadlock in TestCrashDumpsAllThreads

TestCrashDumpsAllThreads carefully sets the number of Ps to one
greater than the number of non-preemptible loops it starts so that the
main goroutine can continue to run (necessary because of #10958).
However, if GC starts, it can take over that one spare P and lock up
the system while waiting for the non-preemptible loops, causing the
test to eventually time out. This deadlock is easily reproducible if
you run the runtime test with GOGC=1.

Fix this by forcing GOGC=off when running this test.

Change-Id: Ifb22da5ce33f9a61700a326ea92fcf4b049721d1
Reviewed-on: https://go-review.googlesource.com/19516
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: print struct tags in var decl in inlined func body
Russ Cox [Tue, 16 Feb 2016 17:09:05 +0000 (12:09 -0500)]
cmd/compile: print struct tags in var decl in inlined func body

This bug was introduced in golang.org/cl/18217,
while trying to fix #13777.

Originally I wanted to just disable inlining for the case
being handled incorrectly, but it's fairly difficult to detect
and much easier just to fix. Since the case being handled
incorrectly was inlined correctly in Go 1.5, not inlining it
would also be somewhat of a regression.
So just fix it.

Test case copied from Ian's CL 19520.

The mistake to worry about in this CL would be relaxing
the condition too much (we now print the note more often
than we did yesterday). To confirm that we'd catch this mistake,
I checked that changing (!fmtbody || !t.Funarg) to (true) does
cause fixedbugs/issue13777.go to fail. And putting it back
to what is written in this CL makes that test pass again
as well as the new fixedbugs/issue14331.go.
So I believe that the new condition is correct for both constraints.

Fixes #14331.

Change-Id: I91f75a4d5d07c53af5caea1855c780d9874b8df6
Reviewed-on: https://go-review.googlesource.com/19514
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet: make TestInterfaceAddrsWithNetsh more robust
Alex Brainman [Wed, 10 Feb 2016 23:15:58 +0000 (10:15 +1100)]
net: make TestInterfaceAddrsWithNetsh more robust

TestInterfaceAddrsWithNetsh invokes Windows netsh command passing
it a particular interface name. This approach somehow does not work
on some computers (see issue for details). Change that to call netsh
without specifying any interface name. This provides output for all
interfaces available. So we can achieve same goal parsing this output.
Also makes test faster because we only need to invoke netsh once.

Fixes #14130.

Change-Id: I7911692ca64e372af1e1f9d6acb718c67071de67
Reviewed-on: https://go-review.googlesource.com/19441
Reviewed-by: Volker Dobler <dr.volker.dobler@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: show panics in traceback
Austin Clements [Fri, 12 Feb 2016 15:33:51 +0000 (10:33 -0500)]
runtime: show panics in traceback

We used to include panic calls in tracebacks; however, when
runtime.panic was renamed to runtime.gopanic in the conversion of the
runtime to Go, we missed the special case in showframe that includes
panic calls even though they're in package runtime.

Fix the function name check in showframe (and, while we're here, fix
the other check for "runtime.panic" in runtime/pprof). Since the
"runtime.gopanic" name doesn't match what users call panic and hence
isn't very user-friendly, make traceback rewrite it to just "panic".

Updates #5832, #13857. Fixes #14315.

Change-Id: I8059621b41ec043e63d5cfb4cbee479f47f64973
Reviewed-on: https://go-review.googlesource.com/19492
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodoc: fix remaining TODOs in Go 1.6 release notes
Russ Cox [Thu, 11 Feb 2016 18:33:33 +0000 (13:33 -0500)]
doc: fix remaining TODOs in Go 1.6 release notes

Fixes #14300.

Change-Id: Idb6a300fe0e06fb8966cf06b55f9b252752a69a6
Reviewed-on: https://go-review.googlesource.com/19459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: tweak Go 1.6 GC release notes
Austin Clements [Sun, 14 Feb 2016 20:09:21 +0000 (15:09 -0500)]
doc: tweak Go 1.6 GC release notes

Go 1.6 significantly improves pause times for large heaps, but it
improves them in many other situations as well, such as when goroutine
churn is high, allocation rate is high, or when there are many
finalizers. Hence, make the statement about pause times a bit more
general.

Change-Id: Ic034b1c904c39dd1d966ee7fa96ca8bbb3614e53
Reviewed-on: https://go-review.googlesource.com/19504
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: fix non-possessive "'s"
Austin Clements [Mon, 15 Feb 2016 04:53:19 +0000 (23:53 -0500)]
doc: fix non-possessive "'s"

Currently we use "Section's" as the plural of the debug/elf Section
struct. Change this to "Sections" because it's not possessive and
doesn't seem to fall in to any special cases were the apostrophe is
acceptable.

Change-Id: Id5d3abbd748502a67ead3f483182ee7729db94a2
Reviewed-on: https://go-review.googlesource.com/19505
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: remove debugging print in cgoCheckTypedBlock
Ian Lance Taylor [Sat, 13 Feb 2016 16:48:55 +0000 (08:48 -0800)]
runtime: remove debugging print in cgoCheckTypedBlock

Change-Id: I83639fcde88e7d9747b54728a9481ee2e1b23a64
Reviewed-on: https://go-review.googlesource.com/19486
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: update bundled http2 to fix gzip crash on Read after NewReader error
Brad Fitzpatrick [Sat, 13 Feb 2016 06:20:17 +0000 (06:20 +0000)]
net/http: update bundled http2 to fix gzip crash on Read after NewReader error

Updates x/net/http2 to git rev 62685c2 for https://golang.org/cl/19483

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

8 years agocmd/compile: add write barrier to type switch
Keith Randall [Fri, 12 Feb 2016 18:07:36 +0000 (10:07 -0800)]
cmd/compile: add write barrier to type switch

Type switches need write barriers if the written-to
variable is heap allocated.

For the added needwritebarrier call, the right arg doesn't
really matter, I just pass something that will never disqualify
the write barrier.  The left arg is the one that matters.

Fixes #14306

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

8 years agoruntime: return errno value from Solaris mmap as expected
Ian Lance Taylor [Fri, 12 Feb 2016 02:09:34 +0000 (18:09 -0800)]
runtime: return errno value from Solaris mmap as expected

The code in mem_bsd.go expects that when mmap fails it will return a
positive errno value.  This fixes the Solaris implementation of mmap to
work as expected.

Change-Id: Id1c34a9b916e8dc955ced90ea2f4af8321d92265
Reviewed-on: https://go-review.googlesource.com/19477
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/link: fix padding for dwarf aranges on 32 bit platforms.
Ryan Brown [Thu, 11 Feb 2016 00:51:23 +0000 (16:51 -0800)]
cmd/link: fix padding for dwarf aranges on 32 bit platforms.

Fixes #14278

Change-Id: I6a0c1370d595f0573ff0eb933450b1eea41f4bb3
Reviewed-on: https://go-review.googlesource.com/19452
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix errno sign for some mmap and mincore cases
Ian Lance Taylor [Thu, 11 Feb 2016 05:46:51 +0000 (21:46 -0800)]
runtime: fix errno sign for some mmap and mincore cases

The caller of mmap expects it to return a positive errno value, but the
linux-arm64 and nacl-386 system calls returned a negative errno value.
Correct them to negate the errno value.

The caller of mincore expects it to return a negative errno value (yes,
this is inconsistent), but the linux-mips64x and linux-ppc64x system
call returned a positive errno value.  Correct them to negate the errno
value.

Add a test that mmap returns errno with the correct sign.  Brad added a
test for mincore's errno value in https://golang.org/cl/19457.

Fixes #14297.

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

8 years agoruntime: add test for mincore's return value sign on Linux
Brad Fitzpatrick [Thu, 11 Feb 2016 16:36:38 +0000 (16:36 +0000)]
runtime: add test for mincore's return value sign on Linux

Updates #14297

Change-Id: I6b5f5020af5efaaa71280bdeb2ff99785ee9b959
Reviewed-on: https://go-review.googlesource.com/19457
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http/httptest: make Server.CloseClientConnections wait for conns to close
Brad Fitzpatrick [Wed, 10 Feb 2016 19:58:44 +0000 (19:58 +0000)]
net/http/httptest: make Server.CloseClientConnections wait for conns to close

httptest.Server was rewritten during Go 1.6, but
CloseClientConnections was accidentally made async in the rewrite and
not caught due to lack of tests.

Restore the Go 1.5 behavior and add tests.

Fixes #14290
Updates #14291

Change-Id: I14f01849066785053ccca2373931bc82d78c0a13
Reviewed-on: https://go-review.googlesource.com/19432
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agogo/internal/gcimporter: interpret relative srcDir relative to cwd
Robert Griesemer [Tue, 9 Feb 2016 20:58:35 +0000 (12:58 -0800)]
go/internal/gcimporter: interpret relative srcDir relative to cwd

1) go/types.dir: Correctly return "." if there is no path.
2) go/internal/gcimporter.FindPkg: work-around for build.Import
   (build.Import doesn't produce expected result if srcDir is
   relative). See also issue 14282.

Fixes #14215.

Change-Id: Ia3721f9ad8a1115d2595fe99b04baaf30d5765f2
Reviewed-on: https://go-review.googlesource.com/19393
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet: make getmac based tests on windows more robust
Volker Dobler [Tue, 9 Feb 2016 13:39:52 +0000 (14:39 +0100)]
net: make getmac based tests on windows more robust

The Windows 7 getmac command may report the physical address of an adapter
as "Disabled" or "N/A". Handle these two cases to make the tests more
robust when building on Windows with manually disabled adapters or turned
off hardware.

Addresses issue #14130.

Change-Id: I0c2f8554b4b6810568e4e60ed53857599401f296
Reviewed-on: https://go-review.googlesource.com/19411
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet/http: be more conservative about enabling http2 on Transports
Brad Fitzpatrick [Tue, 9 Feb 2016 20:05:10 +0000 (20:05 +0000)]
net/http: be more conservative about enabling http2 on Transports

For now, don't enable http2 when Transport.TLSConfig != nil.
See background in #14275.

Also don't enable http2 when ExpectContinueTimeout is specified for
now, in case somebody depends on that functionality. (It is not yet
implemented in http2, and was only just added to net/http too in Go
1.6, so nobody would be setting it yet).

Updates #14275
Updates #13851

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

8 years agocmd/go: use GOPATH order for compile -I and link -L options
Russ Cox [Tue, 9 Feb 2016 04:46:27 +0000 (23:46 -0500)]
cmd/go: use GOPATH order for compile -I and link -L options

Given GOPATH=p1:p2 and source code of just the right form,
the go command could previously end up invoking the compiler
with -I p2 -I p1 or the linker with -L p2 -L p1, so that
compiled packages in p2 incorrectly shadowed packages in p1.
If foo were in both p1 and p2 and the compilation of bar
were such that the -I and -L options were inverted in this way,
then

GOPATH=p2 go install foo
GOPATH=p1:p2 go install bar

would get the p2 copy of foo instead of the (expected) p1 copy of foo.

This manifested in real usage in a few different ways, but in all
the root cause was that the -I or -L option sequence did not
match GOPATH.

Make it match GOPATH.

Fixes #14176 (second report).
Fixes #14192.
Related but less common issue #14271 not fixed.

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

8 years agobuild: mv cmd/vendor cmd/internal/unvendor
Russ Cox [Tue, 9 Feb 2016 03:51:34 +0000 (22:51 -0500)]
build: mv cmd/vendor cmd/internal/unvendor

And update two imports in cmd/internal/objfile/disasm.go.
This makes GO15VENDOREXPERIMENT=0 ./make.bash work.
For Go 1.7 we will move it back.

Fixes #14236.

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

8 years agocmd/go: silence standard imports non-standard error for non-existent import target
Russ Cox [Tue, 9 Feb 2016 03:50:17 +0000 (22:50 -0500)]
cmd/go: silence standard imports non-standard error for non-existent import target

This error only affects the compilation of the standard library,
but I discovered that if you import "notexist" from the standard
library then you get both an error about notexist not existing
and an error about notexist being a non-standard package
(because the non-existant package is in fact not a standard package).
Silence the second error.

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

8 years agonet/http: make ListenAndServeTLS treat GetCertificate as a set cert too
Brad Fitzpatrick [Mon, 8 Feb 2016 23:23:36 +0000 (23:23 +0000)]
net/http: make ListenAndServeTLS treat GetCertificate as a set cert too

ListenAndServeTLS doesn't require cert and key file names if the
server's TLSConfig has a cert configured. This code was never updated
when the GetCertificate hook was added to *tls.Config, however.

Fixes #14268

Change-Id: Ib282ebb05697edd37ed8ff105972cbd1176d900b
Reviewed-on: https://go-review.googlesource.com/19381
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agogo/constant: fix String() implementation
Robert Griesemer [Mon, 8 Feb 2016 22:50:45 +0000 (14:50 -0800)]
go/constant: fix String() implementation

Fixes #14262.

Change-Id: Id590995dd4460e81f6b91bcfb3f02515a97650fe
Reviewed-on: https://go-review.googlesource.com/19361
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix comment
Brad Fitzpatrick [Mon, 8 Feb 2016 21:10:18 +0000 (21:10 +0000)]
runtime: fix comment

Fixes #14259

Change-Id: I23fedec0eb85ae28e56bc24539bc864674856130
Reviewed-on: https://go-review.googlesource.com/19318
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agogo/types: make sure constants valid in integer operations are in integer form
Robert Griesemer [Fri, 5 Feb 2016 23:23:47 +0000 (15:23 -0800)]
go/types: make sure constants valid in integer operations are in integer form

The operation where this manifested in a crash was % (only defined on integers).
However, the existing code was sloppy in that it didn't retain the integer form
after a value (e.g., 3.0) was accepted as representable in integer form (3 for
the example). We would have seen a crash in such cases for / as well except
that there was code to fix it for just that case.

Remove the special code for / and fix more generally by retaining the integer
form for all operations if applicable.

Fixes #14229.

Change-Id: I8bef769e6299839fade27c6e8b5ff29ad6521d0d
Reviewed-on: https://go-review.googlesource.com/19300
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agoruntime: don't call testing.Fatal from worker goroutines
Mikio Hara [Fri, 5 Feb 2016 00:37:13 +0000 (09:37 +0900)]
runtime: don't call testing.Fatal from worker goroutines

Change-Id: I630d4d2d8a914d6c07f22351a56d5e44a937123e
Reviewed-on: https://go-review.googlesource.com/19245
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: deflake TestCloseNotifierPipelined
Ian Lance Taylor [Fri, 5 Feb 2016 22:59:46 +0000 (14:59 -0800)]
net/http: deflake TestCloseNotifierPipelined

The test sends two HTTP/1.1 pipelined requests.  The first is
completedly by the second, and as such triggers an immediate call to the
CloseNotify channel.  The second calls the CloseNotify channel after the
overall connection is closed.

The test was passing fine on gc because the code would enter the select
loop before running the handler, so the send on gotReq would always be
seen first.  On gccgo the code would sometimes enter the select loop
after the handler had already finished, meaning that the select could
choose between gotReq and sawClose.  If it picked sawClose, it would
never close the overall connection, and the httptest server would hang.
The same hang could be induced with gc by adding a time.Sleep
immediately before the select loop.

Deflake the test by 1) don't close the overall connection until both
requests have been seen; 2) don't exit the loop until both closes have
been seen.

Fixes #14231.

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

8 years agonet/http: fix doc typo
Brad Fitzpatrick [Fri, 5 Feb 2016 15:05:35 +0000 (15:05 +0000)]
net/http: fix doc typo

Change-Id: I93201fa4152f2d60b3eedb8d321a152819033121
Reviewed-on: https://go-review.googlesource.com/19270
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: update bundled http2
Brad Fitzpatrick [Fri, 5 Feb 2016 01:44:52 +0000 (01:44 +0000)]
net/http: update bundled http2

Updates x/net/http2 to git rev 493a262 for https://golang.org/cl/19223

Fixes #14227

Change-Id: I626122811138fb3d88e4eea83f8da3fdcf91e0dc
Reviewed-on: https://go-review.googlesource.com/19250
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 Request.Header and Request.Close more
Brad Fitzpatrick [Thu, 4 Feb 2016 19:40:38 +0000 (19:40 +0000)]
net/http: document Request.Header and Request.Close more

Updates #14227

Change-Id: If39f11471ecd307c9483f64e73f9c89fe906ae71
Reviewed-on: https://go-review.googlesource.com/19222
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: don't expose stack buffer in stringto{byte,rune}slice
Keith Randall [Thu, 4 Feb 2016 21:38:38 +0000 (13:38 -0800)]
runtime: don't expose stack buffer in stringto{byte,rune}slice

When using a stack-allocated buffer for the result, don't
expose the uninitialized portion of it by restricting its
capacity to its length.

The other option is to zero the portion between len and cap.
That seems like more work, but might be worth it if the caller
then appends some stuff to the result.  But this close to 1.6,
I'm inclined to do the simplest fix possible.

Fixes #14232

Change-Id: I21c50d3cda02fd2df4d60ba5e2cfe2efe272f333
Reviewed-on: https://go-review.googlesource.com/19231
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: rewrite references to plan9.bell-labs.com to 9p.io
Andrew Gerrand [Thu, 4 Feb 2016 22:43:46 +0000 (09:43 +1100)]
doc: rewrite references to plan9.bell-labs.com to 9p.io

The plan9.bell-labs.com site has fallen into disrepair.
We'll instead use the site maintained by contributor David du Colombier.

Fixes #14233

Change-Id: I0c702e5d3b091cccd42b288ea32f34d507a4733d
Reviewed-on: https://go-review.googlesource.com/19240
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
8 years agoruntime: skip TestSignalExitStatus on Solaris
Ian Lance Taylor [Thu, 4 Feb 2016 05:49:45 +0000 (21:49 -0800)]
runtime: skip TestSignalExitStatus on Solaris

Update #14063.

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

8 years agodoc: correct old function names in strconv comments in go1.6 doc
Ian Lance Taylor [Thu, 4 Feb 2016 02:56:24 +0000 (18:56 -0800)]
doc: correct old function names in strconv comments in go1.6 doc

Fixes #14219.

Change-Id: Id398dcfe6e9978d7eefddcdaaaa2256c16237cf3
Reviewed-on: https://go-review.googlesource.com/19207
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years ago[release-branch.go1.6] go1.6rc2 go1.6rc2
Chris Broadfoot [Wed, 3 Feb 2016 22:46:16 +0000 (14:46 -0800)]
[release-branch.go1.6] go1.6rc2

Change-Id: I7273f490cd99a74a8ed04d301b93c17a0ea6a117
Reviewed-on: https://go-review.googlesource.com/19204
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoall: merge master into release-branch.go1.6
Chris Broadfoot [Wed, 3 Feb 2016 22:11:49 +0000 (14:11 -0800)]
all: merge master into release-branch.go1.6

Change-Id: Ifbe63b764e3d6933b112a4307a3701a047227976

8 years agonet/http/httputil: also remove non-standard Proxy-Connection hop-by-hop header
Brad Fitzpatrick [Wed, 3 Feb 2016 21:35:03 +0000 (21:35 +0000)]
net/http/httputil: also remove non-standard Proxy-Connection hop-by-hop header

libcurl sends this (despite never being standardized), and the Google
GFE rejects it with a 400 bad request (but only when over http2?).

So nuke it.

Change-Id: I3fc95523d50f33a0e23bb26b9195f70ab0aed0f4
Reviewed-on: https://go-review.googlesource.com/19184
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agosync: deflake TestWaitGroupMisuse3
Brad Fitzpatrick [Wed, 3 Feb 2016 16:58:43 +0000 (16:58 +0000)]
sync: deflake TestWaitGroupMisuse3

Previous flakes:
https://build.golang.org/log/223365dedb6b6aa0cfdf5afd0a50fd433a16bade
https://build.golang.org/log/edbea4cd3f24e707ef2ae8378559bb0fcc453c22

Dmitry says in email about this:

> The stack trace points to it pretty clearly. Done can indeed unblock
> Wait first and then panic. I guess we need to recover after first
> Done as well.

And it looks like TestWaitGroupMisuse2 was already hardened against
this.  Do the same in TestWaitGroupMisuse3.

Change-Id: I317800c7e46f13c97873f0873c759a489dd5f47d
Reviewed-on: https://go-review.googlesource.com/19183
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: fix rebuild after installation of new Go release
Russ Cox [Tue, 2 Feb 2016 14:19:47 +0000 (09:19 -0500)]
cmd/go: fix rebuild after installation of new Go release

The loading of zversion.go was expecting it to be in
package runtime, but it moved to runtime/internal/sys.
Worse, the load was not checking the error.

Update the path, check the error, add a test.

Fixes #14176.

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

8 years agocmd/vet: don't crash in cgo checker if type is unknown
Ian Lance Taylor [Tue, 2 Feb 2016 21:23:32 +0000 (13:23 -0800)]
cmd/vet: don't crash in cgo checker if type is unknown

Fixes #14201.

Change-Id: Ib61f8c00cae72463f59b90ae199fbdc1e7422a79
Reviewed-on: https://go-review.googlesource.com/19174
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agomisc: update timezone database to IANA 2016a
Rob Pike [Tue, 2 Feb 2016 21:46:49 +0000 (13:46 -0800)]
misc: update timezone database to IANA 2016a

Fixes #14202

Change-Id: Ia6dccecb1b9b3f6c0838c99090e6ddf1ad43303c
Reviewed-on: https://go-review.googlesource.com/19175
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/go: document that -msan requires clang
Russ Cox [Tue, 2 Feb 2016 03:07:06 +0000 (22:07 -0500)]
cmd/go: document that -msan requires clang

Fixes #14171.

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

8 years agoruntime/pprof: mark dragonfly and solaris as bad at pprof
Brad Fitzpatrick [Tue, 2 Feb 2016 17:34:48 +0000 (17:34 +0000)]
runtime/pprof: mark dragonfly and solaris as bad at pprof

Updates #13841

Change-Id: I121bce054e2756c820c76444e51357f474b7f3d6
Reviewed-on: https://go-review.googlesource.com/19161
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet/http/httputil: fix spelling of Trailer hop-by-hop header per errata
Brad Fitzpatrick [Mon, 1 Feb 2016 15:58:34 +0000 (15:58 +0000)]
net/http/httputil: fix spelling of Trailer hop-by-hop header per errata

RFC Errata 4522 (http://www.rfc-editor.org/errata_search.php?eid=4522)
notes that RFC 2616 had a typo in a list of headers that the
httputil.ReverseProxy code copied. Fix the typo in our code.

Fixes #14174

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

8 years agonet/http: mark TestTLSServerClosesConnection as flaky on all systems
Brad Fitzpatrick [Tue, 2 Feb 2016 16:05:47 +0000 (16:05 +0000)]
net/http: mark TestTLSServerClosesConnection as flaky on all systems

Fixes #14195

Change-Id: I245b3ca3fd7d1a76aa95f2e058f8432ba5ce31ee
Reviewed-on: https://go-review.googlesource.com/19160
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoall: merge master into release-branch.go1.6
Russ Cox [Tue, 2 Feb 2016 16:45:03 +0000 (11:45 -0500)]
all: merge master into release-branch.go1.6

Change-Id: I2f98729ca7209f284dabf33d0dea974873f16ada

8 years agoarchive/zip: handle pre-zip64 zip files containing 2³²-1-byte content
Russ Cox [Tue, 2 Feb 2016 03:02:52 +0000 (22:02 -0500)]
archive/zip: handle pre-zip64 zip files containing 2³²-1-byte content

This corrects a regression from Go 1.5 introduced by CL 18317.

Fixes #14185.

Change-Id: Ic3215714846d9f28809cd04e3eb3664b599244f4
Reviewed-on: https://go-review.googlesource.com/19151
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go: avoid use of git -C, which does not exist in RHEL 7
Russ Cox [Tue, 2 Feb 2016 15:10:27 +0000 (10:10 -0500)]
cmd/go: avoid use of git -C, which does not exist in RHEL 7

Tested manually with "go test -run TestGetSubmodules".

Fixes #14194.

Change-Id: I4f563b2b8a38f3040d7631f74a7908ab65e0860b
Reviewed-on: https://go-review.googlesource.com/19154
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: deflake TestGoroutineProfileTrivial
Russ Cox [Tue, 2 Feb 2016 15:15:34 +0000 (10:15 -0500)]
runtime: deflake TestGoroutineProfileTrivial

Failed at https://storage.googleapis.com/go-build-log/9875de36/nacl-amd64p32_931ba6cf.log

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

8 years agoall: merge master into release-branch.go1.6
Russ Cox [Tue, 2 Feb 2016 14:23:40 +0000 (09:23 -0500)]
all: merge master into release-branch.go1.6

Change-Id: I10a3abc28028e35c5d92d1bd33ac64fe0825eae7

8 years agoruntime: start an M when handing off a P when there's GC work
Austin Clements [Mon, 1 Feb 2016 19:06:51 +0000 (14:06 -0500)]
runtime: start an M when handing off a P when there's GC work

Currently it's possible for the scheduler to deadlock with the right
confluence of locked Gs, assists, and scheduling of background mark
workers. Broadly, this happens because handoffp is stricter than
findrunnable, and if the only work for a P is GC work, handoffp will
put the P into idle, rather than starting an M to execute that P. One
way this can happen is as follows:

0. There is only one user G, which we'll call G 1. There is more than
   one P, but they're all idle except the one running G 1.

1. G 1 locks itself to an M using runtime.LockOSThread.

2. GC starts up and enters mark 1.

3. G 1 performs a GC assist, which completes mark 1 without being
   fully satisfied. Completing mark 1 causes all background mark
   workers to park. And since the assist isn't fully satisfied, it
   parks as well, waiting for a background mark worker to satisfy its
   remaining assist debt.

4. The assist park enters the scheduler. Since G 1 is locked to the M,
   the scheduler releases the P and calls handoffp to hand the P to
   another M.

5. handoffp checks the local and global run queues, which are empty,
   and sees that there are idle Ps, so rather than start an M, it puts
   the P into idle.

At this point, all of the Gs are waiting and all of the Ps are idle.
In particular, none of the GC workers are running, so no mark work
gets done and the assist on the main G is never satisfied, so the
whole process soft locks up.

Fix this by making handoffp start an M if there is GC work. This
reintroduces a key invariant: that in any situation where findrunnable
would return a G to run on a P, handoffp for that P will start an M to
run work on that P.

Fixes #13645.

Tested by running 2,689 iterations of `go tool dist test -no-rebuild
runtime:cpu124` across 10 linux-amd64-noopt VMs with no failures.
Without this change, the failure rate was somewhere around 1%.

Performance change is negligible.

name              old time/op  new time/op  delta
XBenchGarbage-12  2.48ms ± 2%  2.48ms ± 1%  -0.24%  (p=0.000 n=92+93)

name                      old time/op    new time/op    delta
BinaryTree17-12              2.86s ± 2%     2.87s ± 2%    ~     (p=0.667 n=19+20)
Fannkuch11-12                2.52s ± 1%     2.47s ± 1%  -2.05%  (p=0.000 n=18+20)
FmtFprintfEmpty-12          51.7ns ± 1%    51.5ns ± 3%    ~     (p=0.931 n=16+20)
FmtFprintfString-12          170ns ± 1%     168ns ± 1%  -0.65%  (p=0.000 n=19+19)
FmtFprintfInt-12             160ns ± 0%     160ns ± 0%  +0.18%  (p=0.033 n=17+19)
FmtFprintfIntInt-12          265ns ± 1%     273ns ± 1%  +2.98%  (p=0.000 n=17+19)
FmtFprintfPrefixedInt-12     235ns ± 1%     239ns ± 1%  +1.99%  (p=0.000 n=16+19)
FmtFprintfFloat-12           315ns ± 0%     315ns ± 1%    ~     (p=0.250 n=17+19)
FmtManyArgs-12              1.04µs ± 1%    1.05µs ± 0%  +0.87%  (p=0.000 n=17+19)
GobDecode-12                7.93ms ± 0%    7.85ms ± 1%  -1.03%  (p=0.000 n=16+18)
GobEncode-12                6.62ms ± 1%    6.58ms ± 1%  -0.60%  (p=0.000 n=18+19)
Gzip-12                      322ms ± 1%     320ms ± 1%  -0.46%  (p=0.009 n=20+20)
Gunzip-12                   42.5ms ± 1%    42.5ms ± 0%    ~     (p=0.751 n=19+19)
HTTPClientServer-12         69.7µs ± 1%    70.0µs ± 2%    ~     (p=0.056 n=19+19)
JSONEncode-12               16.9ms ± 1%    16.7ms ± 1%  -1.13%  (p=0.000 n=19+19)
JSONDecode-12               61.5ms ± 1%    61.3ms ± 1%  -0.35%  (p=0.001 n=20+17)
Mandelbrot200-12            3.94ms ± 0%    3.91ms ± 0%  -0.67%  (p=0.000 n=20+18)
GoParse-12                  3.71ms ± 1%    3.70ms ± 1%    ~     (p=0.244 n=17+19)
RegexpMatchEasy0_32-12       101ns ± 1%     102ns ± 2%  +0.54%  (p=0.037 n=19+20)
RegexpMatchEasy0_1K-12       349ns ± 0%     350ns ± 0%  +0.33%  (p=0.000 n=17+18)
RegexpMatchEasy1_32-12      84.5ns ± 2%    84.2ns ± 1%  -0.43%  (p=0.048 n=19+20)
RegexpMatchEasy1_1K-12       510ns ± 1%     513ns ± 2%  +0.58%  (p=0.002 n=18+20)
RegexpMatchMedium_32-12      132ns ± 1%     134ns ± 1%  +0.95%  (p=0.000 n=20+20)
RegexpMatchMedium_1K-12     40.1µs ± 1%    39.6µs ± 1%  -1.39%  (p=0.000 n=20+20)
RegexpMatchHard_32-12       2.08µs ± 0%    2.06µs ± 1%  -0.95%  (p=0.000 n=18+18)
RegexpMatchHard_1K-12       62.2µs ± 1%    61.9µs ± 1%  -0.42%  (p=0.001 n=19+20)
Revcomp-12                   537ms ± 0%     536ms ± 0%    ~     (p=0.076 n=20+20)
Template-12                 71.3ms ± 1%    69.3ms ± 1%  -2.75%  (p=0.000 n=20+20)
TimeParse-12                 361ns ± 0%     360ns ± 1%    ~     (p=0.056 n=19+19)
TimeFormat-12                353ns ± 0%     352ns ± 0%  -0.23%  (p=0.000 n=17+18)
[Geo mean]                  62.6µs         62.5µs       -0.17%

Change-Id: I0fbbbe4d7d99653ba5600ffb4394fa03558bc4e9
Reviewed-on: https://go-review.googlesource.com/19107
Reviewed-by: Rick Hudson <rlh@golang.org>
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: update bundled http2, fix Transport memory leak
Brad Fitzpatrick [Mon, 1 Feb 2016 22:16:42 +0000 (22:16 +0000)]
net/http: update bundled http2, fix Transport memory leak

Updates x/net/http2 to git rev 644ffc for three CLs since the last update:

http2: don't add *Response to activeRes in Transport on Headers.END_STREAM
https://golang.org/cl/19134

http2: add mechanism to send undeclared Trailers mid handler
https://golang.org/cl/19131

http2: remove unused variable
https://golang.org/cl/18936

The first in the list above is the main fix that's necessary. The
other are two are in the git history but along for the cmd/bundle
ride. The middle CL is well-tested, small (mostly comments),
non-tricky, and almost never seen (since nobody really uses Trailers).
The final CL is just deleting an unused global variable.

Fixes #14084 again (with more tests)

Change-Id: Iac51350acee9c51d32bf7779d57e9d5a5482b928
Reviewed-on: https://go-review.googlesource.com/19135
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: avoid write barrier in cgo mmap code
Ian Lance Taylor [Fri, 29 Jan 2016 23:43:24 +0000 (15:43 -0800)]
runtime: avoid write barrier in cgo mmap code

Tested by hand with a runtime/cgo modified to return an mmap failure
after 10 calls.

This is an interim patch.  For 1.7 we should fix mmap properly to avoid
using the same value as both a pointer and an errno value.

Fixes #14149.

Change-Id: I8f2bbd47d711e283001ba73296f1c34a26c59241
Reviewed-on: https://go-review.googlesource.com/19084
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: fix parsing of inlined interface types with unexported methods
Robert Griesemer [Sat, 30 Jan 2016 22:29:02 +0000 (14:29 -0800)]
cmd/compile: fix parsing of inlined interface types with unexported methods

Fixes #14164.

Change-Id: Ib1d1d29674c99cf88e0ae12724823a31f5dbb95c
Reviewed-on: https://go-review.googlesource.com/19087
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoos: document that FindProcess always succeeds on Unix
Brad Fitzpatrick [Fri, 29 Jan 2016 17:45:23 +0000 (17:45 +0000)]
os: document that FindProcess always succeeds on Unix

Fixes #14146

Change-Id: I892ca4ccdc1ba785750e1eae800852dc5825156c
Reviewed-on: https://go-review.googlesource.com/19093
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>