]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agoruntime: clean up gctrace format
Austin Clements [Fri, 8 Jan 2016 19:57:26 +0000 (14:57 -0500)]
runtime: clean up gctrace format

Go 1.6 simplified the GC phases. The "synchronize Ps" phase no longer
exists and "root scan" and "mark" phases have been combined.

Update the gctrace line implementation and documentation to remove the
unused phases.

Fixes #13536.

Change-Id: I4fc37a3ce1ae3a99d48c0be2df64cbda3e05dee6
Reviewed-on: https://go-review.googlesource.com/18458
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agogo/types: provide Importer2 supporting the Go 1.5 vendor experiment
Robert Griesemer [Thu, 7 Jan 2016 00:07:27 +0000 (16:07 -0800)]
go/types: provide Importer2 supporting the Go 1.5 vendor experiment

Fixes #13688.

Change-Id: I53363aeeeba4560211d56d4571a8e058d5dbbd8a
Reviewed-on: https://go-review.googlesource.com/18308
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoruntime/pprof: skip TestStackBarrierProfiling on FreeBSD, too
Austin Clements [Fri, 8 Jan 2016 19:32:52 +0000 (14:32 -0500)]
runtime/pprof: skip TestStackBarrierProfiling on FreeBSD, too

Sigh. Sleeps on FreeBSD also yield the rest of the time slice and
profiling signals are only delivered when a process completes a time
slice (worse, itimer time is only accounted to the process that
completes a time slice). It's less noticeable than the other BSDs
because the default tick rate is 1000Hz, but it's still failing
regularly.

Fixes #13846.

Change-Id: I41bf116bffe46682433b677183f86944d0944ed4
Reviewed-on: https://go-review.googlesource.com/18455
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Austin Clements <austin@google.com>

9 years agoapi: more go1.6 API additions
Brad Fitzpatrick [Fri, 8 Jan 2016 20:06:04 +0000 (20:06 +0000)]
api: more go1.6 API additions

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

9 years agomath/big: fix typo in comment
Robert Griesemer [Fri, 8 Jan 2016 19:33:17 +0000 (11:33 -0800)]
math/big: fix typo in comment

Fixes #13875.

Change-Id: Icbb85c858d0bc545499a2b31622e9e7abdd7e5f9
Reviewed-on: https://go-review.googlesource.com/18441
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoapi: fix build for go/build change
Russ Cox [Fri, 8 Jan 2016 19:51:50 +0000 (14:51 -0500)]
api: fix build for go/build change

Fixes build.

Change-Id: I5235deed7b93157854acb79c15e2e99cc28d300a
Reviewed-on: https://go-review.googlesource.com/18456
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/testdata: gofmt
Mikio Hara [Fri, 8 Jan 2016 18:45:06 +0000 (03:45 +0900)]
runtime/testdata: gofmt

Change-Id: I728d4c709c4122fe4b96e1350be73696ac6fb1f7
Reviewed-on: https://go-review.googlesource.com/18422
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile: apply -importmap to imports before checking for package unsafe
Russ Cox [Fri, 8 Jan 2016 16:36:36 +0000 (11:36 -0500)]
cmd/compile: apply -importmap to imports before checking for package unsafe

There are fewer special cases this way: the import map applies
to all import paths, not just the ones not spelled "unsafe".

This is also consistent with what the code in cmd/go and go/build expects.
They make no exception for "unsafe".

For #13703.

Change-Id: I622295261ca35a6c1e83e8508d363bddbddb6c0a
Reviewed-on: https://go-review.googlesource.com/18438
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agonet/http: fix validHeaderValue yet again, excluding the DEL CTL byte
Brad Fitzpatrick [Fri, 8 Jan 2016 18:30:04 +0000 (18:30 +0000)]
net/http: fix validHeaderValue yet again, excluding the DEL CTL byte

Third time's a charm.

Thanks to Ralph Corderoy for noticing the DEL omission.

Update #11207

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

9 years agogo/build: invert AllowVendor to IgnoreVendor
Russ Cox [Fri, 8 Jan 2016 17:38:41 +0000 (12:38 -0500)]
go/build: invert AllowVendor to IgnoreVendor

Looking for vendor directories is a better default.

Fixes #13772

Change-Id: Iabbaea71ccc67b72f14f1f412dc8ab70cb41996d
Reviewed-on: https://go-review.googlesource.com/18450
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: save callee-saved regs in darwin-amd64 library init
Ian Lance Taylor [Fri, 8 Jan 2016 15:36:35 +0000 (07:36 -0800)]
runtime: save callee-saved regs in darwin-amd64 library init

We're only getting away with it today by luck.

Change-Id: I24d1cceee4d20c5181ca64fceda152e875f6ad81
Reviewed-on: https://go-review.googlesource.com/18440
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: add nowritebarrierrec to funcs called at signal time
Ian Lance Taylor [Fri, 8 Jan 2016 04:28:04 +0000 (20:28 -0800)]
runtime: add nowritebarrierrec to funcs called at signal time

Also nosplit where needed.

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

9 years agoRevert "net: ensure that malformed domain names report a consistent error"
Russ Cox [Fri, 8 Jan 2016 17:17:53 +0000 (17:17 +0000)]
Revert "net: ensure that malformed domain names report a consistent error"

This reverts commit bb8c2e19a7fe2ca2283eca44dba2047c9f4307fe.

Change-Id: I9bc089e9f2296805ef055b98e8c86ba73af30226
Reviewed-on: https://go-review.googlesource.com/18439
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: fix cgoTestSO on FreeBSD amd64 with GOHOSTARCH=386
Joel Sing [Fri, 8 Jan 2016 12:22:12 +0000 (23:22 +1100)]
cmd/dist: fix cgoTestSO on FreeBSD amd64 with GOHOSTARCH=386

The cgoTestSO test currently fails when run on FreeBSD amd64 with
GOHOSTARCH=386. This is due to it failing to find the shared object.

On FreeBSD 64-bit architectures, the linker for 32-bit objects
looks for a separate environment variable. Export both LD_LIBRARY_PATH
and LD_32_LIBRARY_PATH on FreeBSD when GOHOSTARCH=386.

Update issue #13873.

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

9 years agoos: read only 10,000 bytes at a time from Windows console
Russ Cox [Fri, 8 Jan 2016 16:23:25 +0000 (11:23 -0500)]
os: read only 10,000 bytes at a time from Windows console

Reading 32,767 is too many on some versions of Windows.
The exact upper bound is unclear.

For #13697, but may not fix the problem on all systems.

Change-Id: I197021ed60cbcd33c91ca6ceed456ec3d5a6c9d6
Reviewed-on: https://go-review.googlesource.com/18433
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoregexp/syntax: fix factoring of common prefixes in alternations
Paul Wankadia [Thu, 7 Jan 2016 07:55:18 +0000 (18:55 +1100)]
regexp/syntax: fix factoring of common prefixes in alternations

In the past, `a.*?c|a.*?b` was factored to `a.*?[bc]`. Thus, given
"abc" as its input string, the automaton would consume "ab" and
then stop (when unanchored) whereas it should consume all of "abc"
as per leftmost semantics.

Fixes #13812.

Change-Id: I67ac0a353d7793b3d0c9c4aaf22d157621dfe784
Reviewed-on: https://go-review.googlesource.com/18357
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/textproto: accept multi-line error messages
Daniel Speichert [Tue, 29 Dec 2015 15:46:40 +0000 (16:46 +0100)]
net/textproto: accept multi-line error messages

Ads documentation for both formats of messages accepted by
ReadResponse(). Validity of message should not be altered by
the validation process. On message with unexpected code,
a properly formatted message was not fully read.

Fixes #10230

Change-Id: Ic0b473059a68ab624ce0525e359d0f5d0b8d2117
Reviewed-on: https://go-review.googlesource.com/18172
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: ensure that malformed domain names report a consistent error
Russ Cox [Thu, 7 Jan 2016 01:50:11 +0000 (20:50 -0500)]
net: ensure that malformed domain names report a consistent error

Previously it depended on whether we were using the Go resolver or the Cgo resolver.

Fixes #12421.

Change-Id: Ib162e336f30f736d7244e29d96651c3be11fc3cd
Reviewed-on: https://go-review.googlesource.com/18383
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agointernal/syscall/windows: correct GetACP and MultiByteToWideChar
Alex Brainman [Mon, 21 Dec 2015 05:16:06 +0000 (16:16 +1100)]
internal/syscall/windows: correct GetACP and MultiByteToWideChar

CL 4310 introduced these functions, but their
implementation does not match with their published
documentation. Correct the implementation.

Change-Id: I285e41f9c7c5fc4e550ff59b0adb8b2bcbf6737a
Reviewed-on: https://go-review.googlesource.com/17997
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/json: doc: Decode only writes to exported fields
Ian Lance Taylor [Fri, 8 Jan 2016 02:48:42 +0000 (18:48 -0800)]
encoding/json: doc: Decode only writes to exported fields

Fixes #13867.

Change-Id: I6c0a6c64369681840df60f63036c2eece27de8b8
Reviewed-on: https://go-review.googlesource.com/18394
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodatabase/sql: guard against panics in driver.Stmt implementation
Russ Cox [Fri, 18 Dec 2015 17:16:05 +0000 (12:16 -0500)]
database/sql: guard against panics in driver.Stmt implementation

For #13677, but there is more to do.

Change-Id: Id1af999dc972d07cdfc771e5855a1a7dca47ca96
Reviewed-on: https://go-review.googlesource.com/18046
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: allow signal.Ignore of user-generated throwing signals
Russ Cox [Thu, 7 Jan 2016 15:19:55 +0000 (10:19 -0500)]
runtime: allow signal.Ignore of user-generated throwing signals

Today, signal.Ignore(syscall.SIGTRAP) does nothing
while signal.Notify(make(chan os.Signal), syscall.SIGTRAP)
correctly discards user-generated SIGTRAPs.
The same applies to any signal that we throw on.

Make signal.Ignore work for these signals.

Fixes #12906.

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

9 years agoruntime: fix up OS X kernel bug sending user-generated SIGTRAP
Russ Cox [Thu, 7 Jan 2016 04:00:08 +0000 (23:00 -0500)]
runtime: fix up OS X kernel bug sending user-generated SIGTRAP

OS X unconditionally sets si_code = TRAP_BRKPT when sending SIGTRAP,
even if it was generated by kill -TRAP and not a breakpoint.
Correct the si_code by looking to see if the PC is after a breakpoint.

For #12906.

Change-Id: I998c2499f7f12b338e607282a325b045f1f4f690
Reviewed-on: https://go-review.googlesource.com/18347
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoRevert "runtime: make NumGoroutine and Stack agree not to include system goroutines"
Russ Cox [Fri, 8 Jan 2016 15:31:09 +0000 (15:31 +0000)]
Revert "runtime: make NumGoroutine and Stack agree not to include system goroutines"

This reverts commit c5bafc828126c8fa057e1accaa448583c7ec145f.

Change-Id: Ie7030c978c6263b9e996d5aa0e490086796df26d
Reviewed-on: https://go-review.googlesource.com/18431
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: make NumGoroutine and Stack agree not to include system goroutines
Russ Cox [Thu, 7 Jan 2016 02:16:01 +0000 (21:16 -0500)]
runtime: make NumGoroutine and Stack agree not to include system goroutines

Before, NumGoroutine counted system goroutines and Stack (usually) didn't show them,
which was inconsistent and confusing.

To resolve which way they should be consistent, it seems like

package main
import "runtime"
func main() { println(runtime.NumGoroutine()) }

should print 1 regardless of internal runtime details. Make it so.

Fixes #11706.

Change-Id: I6bfe26a901de517728192cfb26a5568c4ef4fe47
Reviewed-on: https://go-review.googlesource.com/18343
Reviewed-by: Austin Clements <austin@google.com>
9 years agoencoding/base64: fix streaming decode of padding-free base64
Russ Cox [Wed, 6 Jan 2016 19:32:17 +0000 (14:32 -0500)]
encoding/base64: fix streaming decode of padding-free base64

Fixes #13384.

Change-Id: Id9e827acddc8de139f93c5de0c6486bc4334c7d4
Reviewed-on: https://go-review.googlesource.com/18330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoos/signal: clarify signal doc
Ian Lance Taylor [Thu, 7 Jan 2016 17:41:45 +0000 (09:41 -0800)]
os/signal: clarify signal doc

Based on comments from Thomas Bushnell.

Update #9896.

Change-Id: I603b1382d17dff00b5d18f17f8b5d011503e9e4c
Reviewed-on: https://go-review.googlesource.com/18365
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoos: fix rename on Plan 9
David du Colombier [Thu, 7 Jan 2016 06:45:59 +0000 (07:45 +0100)]
os: fix rename on Plan 9

Rename should remove newname if the file already exists
and is not a directory.

Fixes #13844.

Change-Id: I85a5cc28e8d161637a8bc1de33f4a637d9154cd1
Reviewed-on: https://go-review.googlesource.com/18291
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoA+C: manual updates
Brad Fitzpatrick [Thu, 7 Jan 2016 20:25:09 +0000 (12:25 -0800)]
A+C: manual updates

Add Colin Cross (Google CLA)
Add Quentin Perez (Individual CLA)
Add Andy Balholm (Individual CLA)
Add Dirk Gadsden (Individual CLA)
Add Derek Che (Yahoo CLA)

And:

Add CL Sung (Individual CLA), but where gerrit is using personal email
address with CLA signed, but the git commit itself is using an
unverified htc.com address. The commit is:
    https://github.com/golang/oauth2/commit/099e4f0
For github user https://github.com/clsung which says "Self-Employed"
and "clsung@gmail.com". Perhaps the self-employed part is new
since Sep 10, 2014.

Change-Id: Ic1130fb79d167259a9bb76e3be56b9c8ad6b95ca
Reviewed-on: https://go-review.googlesource.com/18369
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: fix too-strict validation of server header values
Brad Fitzpatrick [Fri, 8 Jan 2016 01:06:00 +0000 (01:06 +0000)]
net/http: fix too-strict validation of server header values

As Andy Balholm noted in #11207:

"RFC2616 §4.2 says that a header's field-content can consist of *TEXT,
and RFC2616 §2.2 says that TEXT is <any OCTET except CTLs, but
including LWS>, so that would mean that bytes greater than 128 are
allowed."

This is a partial rollback of the strictness from
https://golang.org/cl/11207 (added in the Go 1.6 dev cycle, only
released in Go 1.6beta1)

Fixes #11207

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

9 years agogo/doc: don't drop "factory" functions with dot-imported result types
Robert Griesemer [Fri, 8 Jan 2016 02:40:40 +0000 (18:40 -0800)]
go/doc: don't drop "factory" functions with dot-imported result types

Fixes #13742.

Change-Id: I7c8b51b60e31402bf708bf8d70e07fd06295e8ce
Reviewed-on: https://go-review.googlesource.com/18393
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/cgo, runtime: recognize unsafe.Pointer(&s[0]) in cgo pointer checks
Ian Lance Taylor [Thu, 7 Jan 2016 23:22:39 +0000 (15:22 -0800)]
cmd/cgo, runtime: recognize unsafe.Pointer(&s[0]) in cgo pointer checks

It's fairly common to call cgo functions with conversions to
unsafe.Pointer or other C types.  Apply the simpler checking of address
expressions when possible when the address expression occurs within a
type conversion.

Change-Id: I5187d4eb4d27a6542621c396cad9ee4b8647d1cd
Reviewed-on: https://go-review.googlesource.com/18391
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotime: restore old error text for day out of range
Russ Cox [Thu, 7 Jan 2016 20:36:54 +0000 (15:36 -0500)]
time: restore old error text for day out of range

Go 1.5 and earlier said "day out of range".
As part of working on this code it morphed into "day of month out of range".
To avoid churn in the output restore the old text.

This fixes some tests reported privately.

Change-Id: If179676cd49f9a471a9441fec2f5220c85eb0799
Reviewed-on: https://go-review.googlesource.com/18386
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: LookupAddr("127.0.0.1") is "localhost" not "localhost."
Russ Cox [Thu, 7 Jan 2016 01:37:05 +0000 (20:37 -0500)]
net: LookupAddr("127.0.0.1") is "localhost" not "localhost."

Fixes #13564.

Change-Id: I30c827ef4a112fee21b8493a67d0227109e35072
Reviewed-on: https://go-review.googlesource.com/18384
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http: document GODEBUG settings, update bundled http2
Brad Fitzpatrick [Thu, 7 Jan 2016 23:43:52 +0000 (23:43 +0000)]
net/http: document GODEBUG settings, update bundled http2

Document the three GODEBUG environment variables in the package doc.

Updates the bundled http2 to x/net git rev 415f1917
for https://golang.org/cl/18372.

Fixes #13611

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

9 years agonet/http: add some tests around sending & receiving star requests
Brad Fitzpatrick [Thu, 7 Jan 2016 19:57:49 +0000 (11:57 -0800)]
net/http: add some tests around sending & receiving star requests

I thought there was still work to do in http2 for this, but I guess
not: the work for parsing them is in net/url (used by http2) and the
handling of OPTIONS * is already in net/http serverHandler, also used
by http2.

But keep the tests.

Change-Id: I566dd0a03cf13c9ea8e735c6bd32d2c521ed503b
Reviewed-on: https://go-review.googlesource.com/18368
Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agocmd/compile: recognize !typedbool is typed
Matthew Dempsky [Thu, 7 Jan 2016 11:06:49 +0000 (03:06 -0800)]
cmd/compile: recognize !typedbool is typed

Adding the evconst(n) call for OANDAND and OOROR in
golang.org/cl/18262 was originally just to parallel the above iscmp
branch, but upon further inspection it seemed odd that removing it
caused test/fixedbugs/issue6671.go's

    var b mybool
    // ...
    b = bool(true) && true // ERROR "cannot use"

to start failing (i.e., by not emitting the expected "cannot use"
error).

The problem is that evconst(n)'s settrue and setfalse paths always
reset n.Type to idealbool, even for logical operators where n.Type
should preserve the operand type.  Adding the evconst(n) call for
OANDAND/OOROR inadvertantly worked around this by turning the later
evconst(n) call at line 2167 into a noop, so the "n.Type = t"
assignment at line 739 would preserve the operand type.

However, that means evconst(n) was still clobbering n.Type for ONOT,
so declarations like:

    const _ bool = !mybool(true)

were erroneously accepted.

Update #13821.

Change-Id: I18e37287f05398fdaeecc0f0d23984e244f025da
Reviewed-on: https://go-review.googlesource.com/18362
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix sigprof stack barrier locking
Austin Clements [Tue, 5 Jan 2016 20:21:27 +0000 (15:21 -0500)]
runtime: fix sigprof stack barrier locking

f90b48e intended to require the stack barrier lock in all cases of
sigprof that walked the user stack, but got it wrong. In particular,
if sp < gp.stack.lo || gp.stack.hi < sp, tracebackUser would be true,
but we wouldn't acquire the stack lock. If it then turned out that we
were in a cgo call, it would walk the stack without the lock.

In fact, the whole structure of stack locking is sigprof is somewhat
wrong because it assumes the G to lock is gp.m.curg, but all three
gentraceback calls start from potentially different Gs.

To fix this, we lower the gcTryLockStackBarriers calls much closer to
the gentraceback calls. There are now three separate trylock calls,
each clearly associated with a gentraceback and the locked G clearly
matches the G from which the gentraceback starts. This actually brings
the sigprof logic closer to what it originally was before stack
barrier locking.

This depends on "runtime: increase assumed stack size in
externalthreadhandler" because it very slightly increases the stack
used by sigprof; without this other commit, this is enough to blow the
profiler thread's assumed stack size.

Fixes #12528 (hopefully for real this time!).

For the 1.5 branch, though it will require some backporting. On the
1.5 branch, this will *not* require the "runtime: increase assumed
stack size in externalthreadhandler" commit: there's no pcvalue cache,
so the used stack is smaller.

Change-Id: Id2f6446ac276848f6fc158bee550cccd03186b83
Reviewed-on: https://go-review.googlesource.com/18328
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: increase assumed stack size in externalthreadhandler
Austin Clements [Wed, 6 Jan 2016 17:17:46 +0000 (12:17 -0500)]
runtime: increase assumed stack size in externalthreadhandler

On Windows, externalthreadhandler currently sets the assumed stack
size for the profiler thread and the ctrlhandler threads to 8KB. The
actual stack size is determined by the SizeOfStackReserve field in the
binary set by the linker, which is currently at least 64KB (and
typically 128KB).

It turns out the profiler thread is running within a few words of the
8KB-(stack guard) bound set by externalthreadhandler. If it overflows
this bound, morestack crashes unceremoniously with an access
violation, which we then fail to handle, causing the whole process to
exit without explanation.

To avoid this problem and give us some breathing room, increase the
assumed stack size in externalthreadhandler to 32KB (there's some
unknown amount of stack already in use, so it's not safe to increase
this all the way to the reserve size).

We also document the relationships between externalthreadhandler and
SizeOfStackReserve to make this more obvious in the future.

Change-Id: I2f9f9c0892076d78e09827022ff0f2bedd9680a9
Reviewed-on: https://go-review.googlesource.com/18304
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: don't ignore success of cgo profiling tracebacks
Austin Clements [Wed, 6 Jan 2016 19:02:50 +0000 (14:02 -0500)]
runtime: don't ignore success of cgo profiling tracebacks

If a sigprof happens during a cgo call, we traceback from the entry
point of the cgo call. However, if the SP is outside of the G's stack,
we'll then ignore this traceback, even if it was successful, and
overwrite it with just _ExternalCode.

Fix this by accepting any successful traceback, regardless of whether
we got it from a cgo entry point or from regular Go code.

Fixes #13466.

Change-Id: I5da9684361fc5964f44985d74a8cdf02ffefd213
Reviewed-on: https://go-review.googlesource.com/18327
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: document ":port" syntax in Dial, Listen, ListenPacket
Russ Cox [Thu, 7 Jan 2016 01:55:59 +0000 (20:55 -0500)]
net: document ":port" syntax in Dial, Listen, ListenPacket

Change-Id: Ideb4bd9ffb1b5f1aef7d94ff791a262f54a650d5
Reviewed-on: https://go-review.googlesource.com/18344
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: add pointer to net and net/http for more GODEBUG settings
Russ Cox [Thu, 7 Jan 2016 03:04:06 +0000 (22:04 -0500)]
runtime: add pointer to net and net/http for more GODEBUG settings

net has GODEBUG text already.
net/http still needs it (leaving for Brad).

For #13611.

Change-Id: Icea1027924a23a687cbbe4001985e8c6384629d7
Reviewed-on: https://go-review.googlesource.com/18346
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: update bundled http2, fixes TestConcurrentReadWriteReqBody_h2
Brad Fitzpatrick [Thu, 7 Jan 2016 04:59:25 +0000 (04:59 +0000)]
net/http: update bundled http2, fixes TestConcurrentReadWriteReqBody_h2

Updates http2 to x/net git rev 520af5de654d for
https://golang.org/cl/18370

Fixes #13659

Change-Id: I920eaff6036ac22c500a97449826c6b12f873d7f
Reviewed-on: https://go-review.googlesource.com/18371
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agonet/http: Minor fix to error messages in test.
Michael McGreevy [Thu, 7 Jan 2016 02:32:46 +0000 (13:32 +1100)]
net/http: Minor fix to error messages in test.

Change-Id: I995ac0559f89110662d79d136d710ef3a0bb1505
Reviewed-on: https://go-review.googlesource.com/18351
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: mention that Go no longer calls timeBeginPeriod(1) on Windows
Russ Cox [Thu, 7 Jan 2016 02:28:06 +0000 (21:28 -0500)]
doc: mention that Go no longer calls timeBeginPeriod(1) on Windows

Fixes #13731.

Change-Id: Iaf70a8b41c947f0d86013808564112ab676136e3
Reviewed-on: https://go-review.googlesource.com/18345
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agodoc: update 1.6 release notes with buildmode progress
Michael Hudson-Doyle [Wed, 6 Jan 2016 23:50:13 +0000 (12:50 +1300)]
doc: update 1.6 release notes with buildmode progress

Fixes #13358

Change-Id: I57ed50c2610cab11fb3d9749f9e7d4a37daa7977
Reviewed-on: https://go-review.googlesource.com/18276
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: remove note about installing from source for ARM
Russ Cox [Wed, 6 Jan 2016 20:47:47 +0000 (15:47 -0500)]
doc: remove note about installing from source for ARM

Now there are ARM downloads too.

Change-Id: I236381508c69d56748e672d184b92caa715e81ae
Reviewed-on: https://go-review.googlesource.com/18342
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agonet/http: update bundled http2; fixes TestTransportAndServerSharedBodyRace_h2
Brad Fitzpatrick [Thu, 7 Jan 2016 00:51:13 +0000 (00:51 +0000)]
net/http: update bundled http2; fixes TestTransportAndServerSharedBodyRace_h2

Update bundled http2 to git rev d1ba260648 (https://golang.org/cl/18288).

Fixes the flaky TestTransportAndServerSharedBodyRace_h2.

Also adds some debugging to TestTransportAndServerSharedBodyRace_h2
which I hope won't ever be necessary again, but I know will be.

Fixes #13556

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

9 years agodoc: show relevant test instructions on install page
Andrew Gerrand [Wed, 6 Jan 2016 23:53:07 +0000 (10:53 +1100)]
doc: show relevant test instructions on install page

Fixes golang/go#12490

Change-Id: I0861e62aaa589fc63217c83e9c227c17e35cda75
Reviewed-on: https://go-review.googlesource.com/18277
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomisc/cgo/testcarchive,testcshared: deflake tests
Ian Lance Taylor [Thu, 7 Jan 2016 00:43:21 +0000 (16:43 -0800)]
misc/cgo/testcarchive,testcshared: deflake tests

After a failure on the build dashboard I tested testcarchive test 2 and
found that it failed an average of 1 in 475 runs on my laptop.  With
this change it ran over 50,000 times without failing.  I bumped up the
other iteration limits to correspond.

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

9 years agocmd/dist: improve isGitRepo to handle git "worktree"s
Tamir Duberstein [Wed, 30 Dec 2015 16:15:38 +0000 (11:15 -0500)]
cmd/dist: improve isGitRepo to handle git "worktree"s

Simply checking the exit code of `git rev-parse --git-dir` should
suffice here, but that requires deviating from the infrastructure
provided by `run`, so I've left that for a future change.

Originally by Tamir Duberstein but updated by iant & rsc to add
the filepath.Join logic.

Fixes #11211 (again).

Change-Id: I6d29b5ae39ba456088ae1fb5d41014cb91c86897
Reviewed-on: https://go-review.googlesource.com/18323
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: for go get -insecure, skip TLS certificate checking
Russ Cox [Wed, 6 Jan 2016 18:52:48 +0000 (13:52 -0500)]
cmd/go: for go get -insecure, skip TLS certificate checking

The flag is already named -insecure. Make it more so.

If we're willing to accept HTTP, it's not much worse to accept
HTTPS man-in-the-middle attacks too. This allows servers
with self-signed certificates to work.

Fixes #13197.

Change-Id: Ia5491410bc886da0a26ef3bce4bf7d732f5e19e4
Reviewed-on: https://go-review.googlesource.com/18324
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http, net/http/httputil: fix nits found by vet
Mikio Hara [Thu, 7 Jan 2016 00:36:52 +0000 (09:36 +0900)]
net/http, net/http/httputil: fix nits found by vet

Change-Id: Idf02428591f61dc58f654fdaf0e3a55f8b8a1060
Reviewed-on: https://go-review.googlesource.com/18350
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoarchive/zip: fix reading, writing of zip64 archives
Russ Cox [Wed, 6 Jan 2016 17:22:16 +0000 (12:22 -0500)]
archive/zip: fix reading, writing of zip64 archives

Read zip files that contain only 64-bit header offset, not 64-bit sizes.
Fixes #13367.

Read zip files that contain completely unexpected Extra fields,
provided we do not need to find 64-bit size or header offset information there.
Fixes #13166.

Write zip file entries with 0xFFFFFFFF uncompressed data bytes
correctly (must use zip64 header, since that's the magic indicator).
Fixes new TestZip64EdgeCase. (Noticed while working on the CL.)

Change-Id: I84a22b3995fafab8052b99de8094a9f35a25de5b
Reviewed-on: https://go-review.googlesource.com/18317
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoos: document that Rename overwrites existing file
Russ Cox [Wed, 6 Jan 2016 19:43:16 +0000 (14:43 -0500)]
os: document that Rename overwrites existing file

Fixes #13673.

Change-Id: I60d1603ca0dfd2ae136117e0f89cee4b6fc6c3d3
Reviewed-on: https://go-review.googlesource.com/18332
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agogo/build: allow @ in #cgo directives for OS X
Russ Cox [Wed, 6 Jan 2016 19:33:25 +0000 (14:33 -0500)]
go/build: allow @ in #cgo directives for OS X

Fixes #13720.

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

9 years agodoc: fix incorrect example in asm.html
Ian Lance Taylor [Wed, 6 Jan 2016 22:58:54 +0000 (14:58 -0800)]
doc: fix incorrect example in asm.html

Fixes #13845.

Change-Id: Ie83179b2d20c47a0296645d9e2fdc43271be495a
Reviewed-on: https://go-review.googlesource.com/18307
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: set new m signal mask to program startup mask
Ian Lance Taylor [Sat, 19 Dec 2015 18:17:10 +0000 (10:17 -0800)]
runtime: set new m signal mask to program startup mask

We were setting the signal mask of a new m to the signal mask of the m
that created it.  That failed when that m happened to be the one created
by ensureSigM, which sets its signal mask to only include the signals
being caught by os/signal.Notify.

Fixes #13164.
Update #9896.

Change-Id: I705c196fe9d11754e10bab9e9b2e7530ecdfa367
Reviewed-on: https://go-review.googlesource.com/18064
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: preserve signal stack when calling Go on C thread
Ian Lance Taylor [Thu, 24 Dec 2015 02:38:18 +0000 (18:38 -0800)]
runtime: preserve signal stack when calling Go on C thread

When calling a Go function on a C thread, if the C thread already has an
alternate signal stack, use that signal stack instead of installing a
new one.

Update #9896.

Change-Id: I62aa3a6a4a1dc4040fca050757299c8e6736987c
Reviewed-on: https://go-review.googlesource.com/18108
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/pprof: skip TestStackBarrierProfiling on dragonfly too
Brad Fitzpatrick [Wed, 6 Jan 2016 21:10:22 +0000 (13:10 -0800)]
runtime/pprof: skip TestStackBarrierProfiling on dragonfly too

Just saw a few dragonfly failures here.

I'm tempted to preemptively add plan9 here too, but I'll wait until
I see it fail.

Change-Id: Ic99fc088dbfd1aa21f509148aee98ccfe7f640bf
Reviewed-on: https://go-review.googlesource.com/18306
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: document release support policy
Russ Cox [Wed, 6 Jan 2016 20:41:37 +0000 (15:41 -0500)]
doc: document release support policy

Fixes #12790.

Change-Id: I0f231d198c76632c23692fc1337b57cfeafaf4c7
Reviewed-on: https://go-review.googlesource.com/18338
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: document linux/ppc64 kernel requirement (2.6.37 or later)
Russ Cox [Wed, 6 Jan 2016 20:51:01 +0000 (15:51 -0500)]
doc: document linux/ppc64 kernel requirement (2.6.37 or later)

Fixes #13269.

Change-Id: I960d1825bda9d8873c2a9005872c45e4c7d30111
Reviewed-on: https://go-review.googlesource.com/18339
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodoc: fix source link in gdb docs
Russ Cox [Wed, 6 Jan 2016 20:26:45 +0000 (15:26 -0500)]
doc: fix source link in gdb docs

Fixes #12059.

Change-Id: Ib5caf8133cd3ed888f9102dfbfeca11c506f3b5b
Reviewed-on: https://go-review.googlesource.com/18337
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: do not force use of git master branch (again)
Russ Cox [Wed, 6 Jan 2016 20:14:05 +0000 (15:14 -0500)]
cmd/go: do not force use of git master branch (again)

This time with a test.
Also adjust another test to skip when hg is not present,
and delete no longer needed fixDetachedHead code.

Fixes #9032 (again).

Change-Id: I481717409e1d44b524f83c70a8dc377699d1a2a5
Reviewed-on: https://go-review.googlesource.com/18334
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: discuss copyright changes in contribute.html
Russ Cox [Wed, 6 Jan 2016 20:23:47 +0000 (15:23 -0500)]
doc: discuss copyright changes in contribute.html

Fixes #12542.

Change-Id: Icd0fa84d891d6b1feab9b4d4dd319cdf1e6d6c48
Reviewed-on: https://go-review.googlesource.com/18336
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: check /etc/hosts for modifications every 5 seconds, not 5 minutes
Russ Cox [Tue, 5 Jan 2016 02:04:01 +0000 (21:04 -0500)]
net: check /etc/hosts for modifications every 5 seconds, not 5 minutes

But also cache the previous parsed form and don't reread if the
size and modification time are both unchanged from before.

On systems with stable /etc/hosts this should result in more stat calls
but only a single parsing of /etc/hosts.

On systems with variable /etc/hosts files (like some Docker systems)
this should result in quicker adoption of changes.

Fixes #13340.

Change-Id: Iba93b204be73d6d903cd17c58038a4fcfd0952b9
Reviewed-on: https://go-review.googlesource.com/18258
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http: fix flaky TestTransportCancelBeforeResponseHeaders test
Brad Fitzpatrick [Wed, 6 Jan 2016 19:52:51 +0000 (19:52 +0000)]
net/http: fix flaky TestTransportCancelBeforeResponseHeaders test

Add a couple more cases where we convert random network I/O errors
into errRequestCanceled if the request was forcefully aborted.

It failed ~1/1000 times without -race, or very easily with -race.
(due to -race randomizing some scheduling)

Fixes #11894

Change-Id: Ib1c123ce1eebdd88642da28a5948ca4f30581907
Reviewed-on: https://go-review.googlesource.com/18287
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http: add mechanism for marking flaky http tests
Brad Fitzpatrick [Wed, 6 Jan 2016 19:19:39 +0000 (19:19 +0000)]
net/http: add mechanism for marking flaky http tests

This shouldn't need to exist in general, but in practice I want something
like this a few times per year.

Change-Id: I9c220e58be44b7726f75d776f714212c570cf8bb
Reviewed-on: https://go-review.googlesource.com/18286
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/play: update URL for concurrent pi
Russ Cox [Wed, 6 Jan 2016 20:12:43 +0000 (15:12 -0500)]
doc/play: update URL for concurrent pi

The old link died; replace with an archive.org copy.

Fixes #13345.

Change-Id: Ic4a7fdcf258e1ff3b4a02ecb4f237ae7db2686c7
Reviewed-on: https://go-review.googlesource.com/18335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http: update bundled http2, add test for Transport's User-Agent behavior
Brad Fitzpatrick [Wed, 6 Jan 2016 07:14:49 +0000 (07:14 +0000)]
net/http: update bundled http2, add test for Transport's User-Agent behavior

Adds a test that both http1 and http2's Transport send a default
User-Agent, with the same behavior.

Updates bundled http2 to golang.org/x/net git rev 1ade16a545 (for
https://go-review.googlesource.com/18285)

The http1 behavior changes slightly: if req.Header["User-Agent"] is
defined at all, even if it's nil or a zero-length slice, then the
User-Agent header is omitted. This is a slight behavior change for
http1, but is consistent with how http1 & http2 do optional headers
elsewhere (such as "Date", "Content-Type"). The old behavior (set it
explicitly to "", aka []string{""}) still works as before. And now
there are even tests.

Fixes #13685

Change-Id: I5786a6913b560de4a5f1f90e595fe320ff567adf
Reviewed-on: https://go-review.googlesource.com/18284
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agogo/importer: always handle forward-declared imports in export data
Robert Griesemer [Wed, 6 Jan 2016 01:21:09 +0000 (17:21 -0800)]
go/importer: always handle forward-declared imports in export data

The textual export data generated by gc sometimes contains forward
references of packages. In rare cases such forward-referenced packages
were not created when needed because no package name was present.

Create unnamed packages in this case and set the name later when it
becomes known.

Fixes #13566.

Change-Id: I193e0ec712e874030b194ab8ecb3fca140f7997a
Reviewed-on: https://go-review.googlesource.com/18301
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agotesting: move comment inside T.Parallel
Russ Cox [Tue, 29 Dec 2015 17:10:01 +0000 (12:10 -0500)]
testing: move comment inside T.Parallel

This was supposed to be in CL 18204 but I submitted from the web
instead of my computer and lost this final edit.

Change-Id: I41598e936bb088d77f5e44752eda74222a4208c7
Reviewed-on: https://go-review.googlesource.com/18310
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: fix timeout test bug
Russ Cox [Wed, 6 Jan 2016 15:53:16 +0000 (10:53 -0500)]
net: fix timeout test bug

This was supposed to be in CL 18205 but I submitted via the web
instead of from my computer, so it got lost.
May deflake some things.

Change-Id: I880fb74b5943b8a17f952a82639c60126701187a
Reviewed-on: https://go-review.googlesource.com/18259
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime/pprof: point to new docs about kernel bugs
Russ Cox [Wed, 6 Jan 2016 15:50:52 +0000 (10:50 -0500)]
runtime/pprof: point to new docs about kernel bugs

Change-Id: I8ee338c1244fc4e2fb75deec752a7f83239c33ea
Reviewed-on: https://go-review.googlesource.com/18257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/dist: assume amd64 on OS X, don't run sysctl
Russ Cox [Wed, 6 Jan 2016 16:12:10 +0000 (11:12 -0500)]
cmd/dist: assume amd64 on OS X, don't run sysctl

Fixes #13425.

Change-Id: I82f49d07841e89fc4f3fde9ea41e710a634579d0
Reviewed-on: https://go-review.googlesource.com/18313
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agotime: document that RFC1123 is wrong for times in UTC
Russ Cox [Wed, 6 Jan 2016 16:23:03 +0000 (11:23 -0500)]
time: document that RFC1123 is wrong for times in UTC

Fixes #13781.

Change-Id: Icfac8f2bfc3a4106f646409cfdc053df1e0cd76a
Reviewed-on: https://go-review.googlesource.com/18314
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoos/exec: document that examples assume Unix
Russ Cox [Wed, 6 Jan 2016 16:27:14 +0000 (11:27 -0500)]
os/exec: document that examples assume Unix

Fixes #13693.

Change-Id: Ieb89d8a8874ee8c6b304de99dceb07193c26b60e
Reviewed-on: https://go-review.googlesource.com/18315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agotest/bench/shootout: delete
Russ Cox [Wed, 6 Jan 2016 17:29:10 +0000 (12:29 -0500)]
test/bench/shootout: delete

We don't use these for benchmarking anymore.
Now we have the go1 dir and the benchmarks subrepo.
Some have problematic copyright notices, so move out of main repo.

Preserved in golang.org/x/exp/shootout.

Fixes #12688.
Fixes #13584.

Change-Id: Ic0b71191ca1a286d33d7813aca94bab1617a1c82
Reviewed-on: https://go-review.googlesource.com/18320
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoRevert "cmd/dist: improve isGitRepo to handle git "worktree"s"
Russ Cox [Wed, 6 Jan 2016 17:39:34 +0000 (17:39 +0000)]
Revert "cmd/dist: improve isGitRepo to handle git "worktree"s"

This reverts commit ab096d587f9bb5dcdf895511ee6d213aade7e30f.

Change-Id: Icf366aa43acc41b4f8474edae0297e554368bf14
Reviewed-on: https://go-review.googlesource.com/18321
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/dsa: adjust GenerateParameters comment
Russ Cox [Wed, 6 Jan 2016 16:44:09 +0000 (11:44 -0500)]
crypto/dsa: adjust GenerateParameters comment

Fixes #13725.

Change-Id: I5fe46851b238fc9ab301da8f8fc37bd1b7871748
Reviewed-on: https://go-review.googlesource.com/18316
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agointernal/syscall/windows/registry: adjust TestGetMUIStringValue
Alex Brainman [Mon, 21 Dec 2015 06:44:58 +0000 (17:44 +1100)]
internal/syscall/windows/registry: adjust TestGetMUIStringValue

Do not check DaylightName if DynamicDaylightTimeDisabled is false.

Fixes #13502

Change-Id: I03e01ec0afdeb0037a5d3ee243674e5a6b559da5
Reviewed-on: https://go-review.googlesource.com/17998
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: improve isGitRepo to handle git "worktree"s
Tamir Duberstein [Wed, 30 Dec 2015 16:15:38 +0000 (11:15 -0500)]
cmd/dist: improve isGitRepo to handle git "worktree"s

Simply checking the exit code of `git rev-parse --git-dir` should
suffice here, but that requires deviating from the infrastructure
provided by `run`, so I've left that for a future change.

Fixes #11211.

Change-Id: I7cbad86a8a06578f52f66f734f5447b597ddc962
Reviewed-on: https://go-review.googlesource.com/18213
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: recognize bool(true) as a constant expression
Matthew Dempsky [Tue, 5 Jan 2016 20:26:55 +0000 (12:26 -0800)]
cmd/compile: recognize bool(true) as a constant expression

Fixes #13821.

Change-Id: I4a28a92d137edac3061537af25ac9d7aba411a66
Reviewed-on: https://go-review.googlesource.com/18262
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoos/signal: Stop restores original signal handling
Ian Lance Taylor [Tue, 5 Jan 2016 00:19:38 +0000 (16:19 -0800)]
os/signal: Stop restores original signal handling

Since Stop was introduced, it would revert to the system default for the
signal, rather than to the default Go behavior.  Change it to revert to
the default Go behavior.

Change-Id: I345467ece0e49e31b2806d6fce2f1937b17905a6
Reviewed-on: https://go-review.googlesource.com/18229
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http: better documentation for Transport
Andrew Gerrand [Wed, 6 Jan 2016 04:45:16 +0000 (15:45 +1100)]
net/http: better documentation for Transport

Mention that:
- connection pooling is enabled by default,
- the Transport is safe for concurrent use, and
- the Client type should be used for high-level stuff.

Change-Id: Idfd8cc852e733c44211e77cf0e22720b1fdca39b
Reviewed-on: https://go-review.googlesource.com/18273
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http/pprof: stop profiling if client's connection closes
Brad Fitzpatrick [Wed, 6 Jan 2016 00:25:24 +0000 (00:25 +0000)]
net/http/pprof: stop profiling if client's connection closes

Fixes #13833

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

9 years agonet/http: update bundled copied of x/net/http2 to git rev 961116aee
Brad Fitzpatrick [Wed, 6 Jan 2016 00:06:09 +0000 (16:06 -0800)]
net/http: update bundled copied of x/net/http2 to git rev 961116aee

Update net/http's copy of http2 (sync as of x/net git rev 961116aee,
aka https://golang.org/cl/18266)

Also adds some CONNECT tests for #13717 (mostly a copy of http2's
version of test, but in the main repo it also tests that http1 behaves
the same)

Fixes #13668
Fixes #13717

Change-Id: I7db93fe0b7c42bd17a43ef32953f2d20620dd3ea
Reviewed-on: https://go-review.googlesource.com/18269
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: note the net/http CloseNotifier changes in go1.6.html
Brad Fitzpatrick [Tue, 5 Jan 2016 17:29:16 +0000 (17:29 +0000)]
doc: note the net/http CloseNotifier changes in go1.6.html

Also reference the new Transport.ExpectContinueTimeout after the
mention of 100-continue.

Fixes #13721

Change-Id: I3445c011ed20f29128092c801c7a4bb4dd2b8351
Reviewed-on: https://go-review.googlesource.com/18281
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: mention new SIGPIPE behavior in 1.6 release notes
Ian Lance Taylor [Tue, 5 Jan 2016 01:18:14 +0000 (17:18 -0800)]
doc: mention new SIGPIPE behavior in 1.6 release notes

Update #11845.

Change-Id: I1c248dc48abc62e51836b9ba50d6deb89706c730
Reviewed-on: https://go-review.googlesource.com/18226
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: call msanwrite on object passed to runtime/cgo
Ian Lance Taylor [Tue, 5 Jan 2016 22:06:58 +0000 (14:06 -0800)]
runtime: call msanwrite on object passed to runtime/cgo

Avoids an msan error when runtime/cgo is explicitly rebuilt with
-fsanitize=memory.

Fixes #13815.

Change-Id: I70308034011fb308b63585bcd40b0d1e62ec93ef
Reviewed-on: https://go-review.googlesource.com/18263
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/hmac: update link to FIPS HMAC spec
Brad Fitzpatrick [Tue, 5 Jan 2016 16:56:16 +0000 (16:56 +0000)]
crypto/hmac: update link to FIPS HMAC spec

Thanks to Kevin Kirsche (github kkirsche).

Change-Id: Ia0017371f56065a5e88d1ebb800a6489136ee9b1
Reviewed-on: https://go-review.googlesource.com/18280
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocrypto/x509: handle ECC private keys with the wrong length.
Adam Langley [Mon, 21 Dec 2015 22:40:23 +0000 (14:40 -0800)]
crypto/x509: handle ECC private keys with the wrong length.

SEC-1 says: “The component privateKey is the private key defined to be
the octet string of length ⌊log₂(n)/8⌋ (where n is the order of the
curve)”.

Previously the code for parsing ECC private keys would panic (on
non-amd64) when the private was too long. It would also pass a too-short
private key to crypto/elliptic, possibly resulting in undesirable
behaviour.

This change makes the parsing function handle both too much and too
little padding because GnuTLS does the former and OpenSSL did the latter
until 30cd4ff294252c4b6a4b69cbef6a5b4117705d22. It also causes
serialisation to pad private keys correctly.

Fixes #13699

Change-Id: If9c2faeaeb45af8a4d7770d784f3d2633e7f8290
Reviewed-on: https://go-review.googlesource.com/18094
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile/internal/gc: fix initialization logic
Kevin Vu [Mon, 4 Jan 2016 02:44:15 +0000 (18:44 -0800)]
cmd/compile/internal/gc: fix initialization logic

Also add relevant test.

Fixes #13343.

Change-Id: Ib1e65af1d643d501de89adee3618eddbf6c69c9e
Reviewed-on: https://go-review.googlesource.com/18159
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/dist: correct run's comment
Tamir Duberstein [Wed, 30 Dec 2015 16:10:47 +0000 (11:10 -0500)]
cmd/dist: correct run's comment

Change-Id: I45b026f4b4bf23b222a81669280cbe245048022b
Reviewed-on: https://go-review.googlesource.com/18212
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: special case shared library name when passed "$prefix/..."
Michael Hudson-Doyle [Wed, 23 Dec 2015 02:33:55 +0000 (15:33 +1300)]
cmd/go: special case shared library name when passed "$prefix/..."

Before golang.org/cl/13921, "go install -buildmode=shared prefix/..." created a
file called "libprefix.so", which was obviously a problem when prefix was
something like "." or "../".  However, now it expands the ... into all the
matched packages, joins them with -, which can clearly be a very long name
indeed. Because I plan to build shared libraries for Ubuntu by running commands
exactly like "go install -buildmode=shared prefix/...", this special cases this
to produce the old behaviour (but de-relativises prefix first).

Fixes #13714

Change-Id: I4fd8d4934279f9a18cc70a13e4ef3e23f6abcb6e
Reviewed-on: https://go-review.googlesource.com/18114
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoencoding/asn1: fix off-by-one in parseBase128Int.
David Benjamin [Tue, 5 Jan 2016 00:16:28 +0000 (16:16 -0800)]
encoding/asn1: fix off-by-one in parseBase128Int.

parseBase128Int compares |shifted| with four, seemingly to ensure the result
fits in an int32 on 32-bit platforms where int is 32-bit. However, there is an
off-by-one in this logic, so it actually allows five shifts, making the maximum
tag number or OID component 2^35-1.

Fix this so the maximum is 2^28-1 which should be plenty for OID components and
tag numbers while not overflowing on 32-bit platforms.

Change-Id: If825b30cc53a0fc08e68ea1a24d265e7eb1a13a4
Reviewed-on: https://go-review.googlesource.com/18225
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoA+C: automated update
Brad Fitzpatrick [Tue, 5 Jan 2016 22:19:10 +0000 (14:19 -0800)]
A+C: automated update

These are the easy, automated cases. There were some more where we
need to fight Gerrit and the CLA system to extract the appropriate
metadata.

Updates #12042

Change-Id: Id63ae635ee7efeec4cd372c7d85bb5b1f557951b
Reviewed-on: https://go-review.googlesource.com/18264
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agolog/syslog: document that syslog is frozen
Brad Fitzpatrick [Mon, 4 Jan 2016 17:12:31 +0000 (09:12 -0800)]
log/syslog: document that syslog is frozen

Try to reduce feature request bug reports.

Change-Id: I713bb715d25d23e084b054aea8e1c3197dde90d4
Reviewed-on: https://go-review.googlesource.com/18222
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: make Client use Request.Cancel for timeouts instead of CancelRequest
Brad Fitzpatrick [Tue, 5 Jan 2016 04:59:05 +0000 (20:59 -0800)]
net/http: make Client use Request.Cancel for timeouts instead of CancelRequest

In the beginning, there was no way to cancel an HTTP request.

We later added Transport.CancelRequest to cancel an in-flight HTTP
request by breaking its underlying TCP connection, but it was hard to
use correctly and didn't work in all cases. And its error messages
were terrible. Some of those issues were fixed over time, but the most
unfixable problem was that it didn't compose well. All RoundTripper
implementations had to choose to whether to implement CancelRequest
and both decisions had negative consequences.

In Go 1.5 we added Request.Cancel, which composed well, worked in all
phases, had nice error messages, etc. But we forgot to use it in the
implementation of Client.Timeout (a timeout which spans multiple
requests and reading request bodies).

In Go 1.6 (upcoming), we added HTTP/2 support, but now Client.Timeout
didn't work because the http2.Transport didn't have a CancelRequest
method.

Rather than add a CancelRequest method to http2, officially deprecate
it and update the only caller (Client, for Client.Cancel) to use
Request.Cancel instead.

The http2 Client timeout tests are enabled now.

For compatibility, we still use CancelRequest in Client if we don't
recognize the RoundTripper type. But documentation has been updated to
tell people that CancelRequest is deprecated.

Fixes #13540

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

9 years agospec: New year, new spec update (to refer to Unicode 8.0).
Robert Griesemer [Tue, 5 Jan 2016 22:15:49 +0000 (14:15 -0800)]
spec: New year, new spec update (to refer to Unicode 8.0).

Slightly rephrased sentence to emphasize the contents of the
Unicode categories w/o repeating the full category name each
time.

Fixes #13414.

Change-Id: Icd32ff1547fa81e866c5937a631c3344bb6087c6
Reviewed-on: https://go-review.googlesource.com/18265
Reviewed-by: Rob Pike <r@golang.org>