]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agocmd/pprof: fix race between viewer and web command
Russ Cox [Wed, 22 Jul 2015 21:48:49 +0000 (17:48 -0400)]
cmd/pprof: fix race between viewer and web command

Fixes #11729.

Change-Id: I6e5e23169ac1368afcbd016ed544a710aa045326
Reviewed-on: https://go-review.googlesource.com/12553
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: mention the ppc64(le) ports in release notes
Rob Pike [Wed, 22 Jul 2015 01:24:27 +0000 (11:24 +1000)]
doc: mention the ppc64(le) ports in release notes

Also make the spelling consistent in asm.html

Change-Id: Ifa751eee288fe0634cd317eb827f3e408b199620
Reviewed-on: https://go-review.googlesource.com/12501
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: make GODEBUG=netdns=cgo force cgo as documented
Brad Fitzpatrick [Thu, 23 Jul 2015 00:45:32 +0000 (17:45 -0700)]
net: make GODEBUG=netdns=cgo force cgo as documented

It wasn't working. The wrong variable was used.

This would ideally have tests. It's also DEBUG.

Fixes #11816

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

9 years agonet: compute the Dialer deadline exactly once.
Paul Marks [Mon, 20 Jul 2015 23:04:25 +0000 (16:04 -0700)]
net: compute the Dialer deadline exactly once.

When dialing with a relative Timeout instead of an absolute Deadline,
the deadline function only makes sense if called before doing any
time-consuming work.

This change calls deadline exactly once, storing the result until the
Dial operation completes.  The partialDeadline implementation is
reverted to the following patch set 3:
https://go-review.googlesource.com/#/c/8768/3..4/src/net/dial.go

Otherwise, when dialing a name with multiple IP addresses, or when DNS
is slow, the recomputed deadline causes the total Timeout to exceed that
requested by the user.

Fixes #11796

Change-Id: I5e1f0d545f9e86a4e0e2ac31a9bd108849cf0fdf
Reviewed-on: https://go-review.googlesource.com/12442
Run-TryBot: Paul Marks <pmarks@google.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoos/exec: close read pipe if copy to io.Writer fails
Russ Cox [Wed, 22 Jul 2015 20:50:00 +0000 (16:50 -0400)]
os/exec: close read pipe if copy to io.Writer fails

Fixes #10400.

Change-Id: Ic486cb8af4c40660fd1a2e3d10986975acba3f19
Reviewed-on: https://go-review.googlesource.com/12537
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: for get -t and list, look up path in vendor directories
Ian Lance Taylor [Tue, 21 Jul 2015 20:59:35 +0000 (13:59 -0700)]
cmd/go: for get -t and list, look up path in vendor directories

This is needed to handle vendor directories correctly.  It was already
done for the regular imports when the package was loaded, but not for
the test-only imports.

It would be nice to do this while loading the package, but that breaks
the code that checks for direct references to vendor packages when
running go test.  This change is relatively contained.

While we're at it, skip "C" test imports in go get.

Fixes #11628.
Fixes #11717.

Change-Id: I9cc308cf45683e3ff905320c2b5cb45db7716846
Reviewed-on: https://go-review.googlesource.com/12488
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: handle linux CPU masks up to 64k CPUs
Russ Cox [Wed, 22 Jul 2015 20:12:26 +0000 (16:12 -0400)]
runtime: handle linux CPU masks up to 64k CPUs

Fixes #11823.

Change-Id: Ic949ccb9657478f8ca34fdf1a6fe88f57db69f24
Reviewed-on: https://go-review.googlesource.com/12535
Reviewed-by: Austin Clements <austin@google.com>
9 years agonet/mail: enhanced Address.String and ParseAddress to match RFC 5322
MathiasB [Fri, 10 Apr 2015 10:14:16 +0000 (12:14 +0200)]
net/mail: enhanced Address.String and ParseAddress to match RFC 5322

Updated Address.String so it restores quoted local parts, which wasn't
done before.
When parsing `<" "@example.com>`, the formatted string returned
`< @example>`, which doens't match RFC 5322, since a space is not atext.
Another example is `<"bob@valid"@example.com>` which returned
`<bob@valid@example.com>`, which is completely invalid.
I also added support for quotes and backslashes in a quoted local part.

Besides formatting a parsed Address, the ParseAddress function also
needed more testing and finetuning for special cases.
Things like `<.john.doe@example.com>` and `<john..doe@example.com>`
e.a. were accepted, but are invalid.
I fixed those details and add tests for some other special cases.

Fixes #10768

Change-Id: Ib0caf8ad603eb21e32fcb957a5f1a0fe5d1c6e6e
Reviewed-on: https://go-review.googlesource.com/8724
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: do not look up abc by default
Russ Cox [Tue, 21 Jul 2015 02:16:29 +0000 (22:16 -0400)]
net: do not look up abc by default

Fixes #11665.

Change-Id: I0897e8cf695434e77d14dcb1d96f21747edfe37c
Reviewed-on: https://go-review.googlesource.com/12523
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime/cgo: make compatible with race detector
Russ Cox [Wed, 22 Jul 2015 19:31:54 +0000 (15:31 -0400)]
runtime/cgo: make compatible with race detector

Some routines run without and m or g and cannot invoke the
race detector runtime. They must be opaque to the runtime.
That used to be true because they were written in C.
Now that they are written in Go, disable the race detector
annotations for those functions explicitly.

Add test.

Fixes #10874.

Change-Id: Ia8cc28d51e7051528f9f9594b75634e6bb66a785
Reviewed-on: https://go-review.googlesource.com/12534
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link: elide individual gcbits symbols
Russ Cox [Wed, 22 Jul 2015 18:59:56 +0000 (14:59 -0400)]
cmd/link: elide individual gcbits symbols

Same as we do for string symbols.

Fixes #11583.

Change-Id: Ia9264f6faf486697d987051b7f9851d37d8ad381
Reviewed-on: https://go-review.googlesource.com/12531
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime/pprof: ignore too few samples on Windows test
Russ Cox [Wed, 22 Jul 2015 17:22:42 +0000 (13:22 -0400)]
runtime/pprof: ignore too few samples on Windows test

Fixes #10842.

Change-Id: I7de98f3073a47911863a252b7a74d8fdaa48c86f
Reviewed-on: https://go-review.googlesource.com/12529
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: if we don't handle a signal on a non-Go thread, raise it
Ian Lance Taylor [Wed, 22 Jul 2015 05:34:48 +0000 (22:34 -0700)]
runtime: if we don't handle a signal on a non-Go thread, raise it

In the past badsignal would crash the program.  In
https://golang.org/cl/10757044 badsignal was changed to call sigsend,
to fix issue #3250.  The effect of this was that when a non-Go thread
received a signal, and os/signal.Notify was not being used to check
for occurrences of the signal, the signal was ignored.

This changes the code so that if os/signal.Notify is not being used,
then the signal handler is reset to what it was, and the signal is
raised again.  This lets non-Go threads handle the signal as they
wish.  In particular, it means that a segmentation violation in a
non-Go thread will ordinarily crash the process, as it should.

Fixes #10139.
Update #11794.

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

9 years agocmd/go: support git.apache.org Git repos
Konstantin Shaposhnikov [Thu, 14 May 2015 16:53:10 +0000 (00:53 +0800)]
cmd/go: support git.apache.org Git repos

This change fixes resolution of secure (https) repo URL for
git.apache.org Git repositories.

E.g. the correct repo URL for git.apache.org/thrift.git/lib/go/thrift is
https://git.apache.org/thrift.git, not https://git.apache.org/thrift

Fixes #10797

Change-Id: I67d5312ad8620eb780e42c2e002c8f286f60645a
Reviewed-on: https://go-review.googlesource.com/10092
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomath/big: document rounding for Rat.FloatToString
Robert Griesemer [Wed, 22 Jul 2015 19:33:21 +0000 (12:33 -0700)]
math/big: document rounding for Rat.FloatToString

Fixes #11523.

Change-Id: I172f6facd555a1c6db76f25d5097343c20dea59a
Reviewed-on: https://go-review.googlesource.com/12507
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: disable TestGoroutineParallelism on uniprocessor
Russ Cox [Tue, 21 Jul 2015 00:30:41 +0000 (20:30 -0400)]
runtime: disable TestGoroutineParallelism on uniprocessor

It's a bad test and it's worst on uniprocessors.

Fixes #11143.

Change-Id: I0164231ada294788d7eec251a2fc33e02a26c13b
Reviewed-on: https://go-review.googlesource.com/12522
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix comments referring to trace functions in runtime/pprof
Austin Clements [Wed, 22 Jul 2015 15:54:41 +0000 (11:54 -0400)]
runtime: fix comments referring to trace functions in runtime/pprof

ae1ea2a moved trace-related functions from runtime/pprof to
runtime/trace, but missed a doc comment and a code comment. Update
these to reflect the move.

Change-Id: I6e1e8861e5ede465c08a2e3f80b976145a8b32d8
Reviewed-on: https://go-review.googlesource.com/12525
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agodoc: add line break in install-source.html
Hari haran [Wed, 22 Jul 2015 11:00:32 +0000 (16:30 +0530)]
doc: add line break in install-source.html

Change-Id: I8633a005da7d0c34a5f074fbd979c8e0fc1fba37
Reviewed-on: https://go-review.googlesource.com/12505
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/dist: add command output for dist tests
Ingo Krabbe [Wed, 22 Jul 2015 07:23:21 +0000 (09:23 +0200)]
cmd/dist: add command output for dist tests

It is very useful to see which test commands are executed.
This is of global use, but I wrote it for #11654.

Change-Id: I9bfc8e55d5bef21f4c49b917f58bc9a44aefcade
Reviewed-on: https://go-review.googlesource.com/12510
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/elliptic: call IsOnCurve via the interface.
Adam Langley [Wed, 22 Jul 2015 16:31:29 +0000 (09:31 -0700)]
crypto/elliptic: call IsOnCurve via the interface.

https://go-review.googlesource.com/#/c/2421/ contains an unfortunate
slip where IsOnCurve is called on the CurveParams rather than the curve.
This doesn't really matter, but it's a pain for people doing tricks with
crypto/elliptic and means that 1.5 would be a regression for them
without this change.

See https://groups.google.com/forum/#!topic/golang-dev/i8OPUTYctOk

Change-Id: Ifa5f25f9a95d7484cb53d4883cfd78dc58a0f9a7
Reviewed-on: https://go-review.googlesource.com/12506
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/x509: disable sha2 test with system APIs
Russ Cox [Wed, 22 Jul 2015 17:11:54 +0000 (13:11 -0400)]
crypto/x509: disable sha2 test with system APIs

Fixes #11730.

Change-Id: I5bc60779a87dc07899dd70659a830996bf7812ca
Reviewed-on: https://go-review.googlesource.com/12527
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: fix missing internal import error
Russ Cox [Tue, 21 Jul 2015 00:05:37 +0000 (20:05 -0400)]
cmd/go: fix missing internal import error

Fixes #11331.

Change-Id: I19b8172421044c301bc136fc8f7bfdadbf880e25
Reviewed-on: https://go-review.googlesource.com/12450
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocrypto/tls: check cert chain during VerifyHostname
Russ Cox [Wed, 22 Jul 2015 16:54:00 +0000 (12:54 -0400)]
crypto/tls: check cert chain during VerifyHostname

Fixes #9063.

Change-Id: I536ef1f0b30c94c1ebf7922d84cb2f701b7d8a1a
Reviewed-on: https://go-review.googlesource.com/12526
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agostrconv: add examples to package
Carlos C [Tue, 23 Jun 2015 21:18:35 +0000 (23:18 +0200)]
strconv: add examples to package

Change-Id: I69a2b6a99a53c875162be8a7d86455559cd74504
Reviewed-on: https://go-review.googlesource.com/11371
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/trace: add new package
Dmitry Vyukov [Wed, 22 Jul 2015 11:09:26 +0000 (13:09 +0200)]
runtime/trace: add new package

Move tracing functions from runtime/pprof to the new runtime/trace package.

Fixes #9710

Change-Id: I718bcb2ae3e5959d9f72cab5e6708289e5c8ebd5
Reviewed-on: https://go-review.googlesource.com/12511
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/json: fix decoding of JSON null values
Didier Spezia [Tue, 28 Apr 2015 11:20:19 +0000 (11:20 +0000)]
encoding/json: fix decoding of JSON null values

JSON decoding currently fails for null values bound to any type
which does implement the JSON Unmarshaler interface without checking
for null values (such as time.Time).

It also fails for types implementing the TextUnmarshaler interface.

The expected behavior of the JSON decoding engine in such case is
to process null by keeping the value unchanged without producing
any error.

Make sure null values are handled by the decoding engine itself,
and never passed to the UnmarshalText or UnmarshalJSON methods.

Fixes #9037

Change-Id: I261d85587ba543ef6f1815555b2af9311034d5bb
Reviewed-on: https://go-review.googlesource.com/9376
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomisc/makerelease: delete
Andrew Gerrand [Tue, 21 Jul 2015 23:44:05 +0000 (09:44 +1000)]
misc/makerelease: delete

This is now superseded by golang.org/x/build/cmd/release.

Fixes #8472

Change-Id: I59664d84996a0fbb5c90582a4702714b3b3cf302
Reviewed-on: https://go-review.googlesource.com/12500
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agolib/time: update to IANA release 2015e.
David Symonds [Wed, 22 Jul 2015 02:42:28 +0000 (12:42 +1000)]
lib/time: update to IANA release 2015e.

Fixes #11810.

Change-Id: I8453e53a72e242a69ea34eb393999e7291d4358f
Reviewed-on: https://go-review.googlesource.com/12502
Run-TryBot: David Symonds <dsymonds@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: add a clause about embedded methods to go1compat
Rob Pike [Tue, 21 Jul 2015 04:05:13 +0000 (14:05 +1000)]
doc: add a clause about embedded methods to go1compat

This is a corner case but it is suggested we call it out.

Fixes #11798.

Change-Id: I2ddb5b363cd2921666dbf03bbf98107697ca40e5
Reviewed-on: https://go-review.googlesource.com/12460
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: remove prints during test registration
Brad Fitzpatrick [Tue, 21 Jul 2015 19:47:22 +0000 (12:47 -0700)]
cmd/dist: remove prints during test registration

dist test should not print (especially to stdout) during test
registration.  This confuses other tools interacting with dist using
dist test --list, etc.

Change-Id: Ie4f82c13e49590c23a7a235d90ddbc4f5ed81e0b
Reviewed-on: https://go-review.googlesource.com/12487
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix typo in comment
Ian Lance Taylor [Tue, 21 Jul 2015 21:05:59 +0000 (14:05 -0700)]
cmd/go: fix typo in comment

Change-Id: I3d5e46d376953fbdd21ce8c161214eaed6378d84
Reviewed-on: https://go-review.googlesource.com/12490
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: pass an unmodified environment to a go run program
Ian Lance Taylor [Tue, 21 Jul 2015 19:17:29 +0000 (12:17 -0700)]
cmd/go: pass an unmodified environment to a go run program

Fixes #11709.
Fixed #11449.

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

9 years agogo/types: make types.Typ a slice, unexport UniverseByte/Rune
Robert Griesemer [Tue, 21 Jul 2015 19:32:59 +0000 (12:32 -0700)]
go/types: make types.Typ a slice, unexport UniverseByte/Rune

In lieu of the more invasive https://go-review.googlesource.com/#/c/12373/ .

Change-Id: I0221783fcaa8af04520c80cd2993d7d542d2c431
Reviewed-on: https://go-review.googlesource.com/12486
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: skip TestGoInstallErrorOnCrossCompileToBin in short mode
Ian Lance Taylor [Tue, 21 Jul 2015 18:17:08 +0000 (11:17 -0700)]
cmd/go: skip TestGoInstallErrorOnCrossCompileToBin in short mode

That test will install cmd/pack for linux_386; we don't want to change
GOROOT in short mode.

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

9 years agomisc/cgo/testsovar: needs the `extern` keyword to export variables on non-windows...
Ingo Krabbe [Tue, 21 Jul 2015 10:49:59 +0000 (12:49 +0200)]
misc/cgo/testsovar: needs the `extern` keyword to export variables on non-windows platforms

Change-Id: I87fa25214fbf24469148a63f4e1e61e261105c16
Reviewed-on: https://go-review.googlesource.com/12470
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link: if -B option was used, pass it to the external linker
Ian Lance Taylor [Wed, 15 Jul 2015 07:18:51 +0000 (00:18 -0700)]
cmd/link: if -B option was used, pass it to the external linker

Fixes #10607.

Change-Id: Ib294cf65b07103b60f62b86b21ff2d07b25136fe
Reviewed-on: https://go-review.googlesource.com/12242
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: add missing preposition in go1.5.html
Brad Fitzpatrick [Tue, 21 Jul 2015 02:46:12 +0000 (19:46 -0700)]
doc: add missing preposition in go1.5.html

Change-Id: I2f855b9ad1676b3c4efedd764ce99e21c104a4ec
Reviewed-on: https://go-review.googlesource.com/12446
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc/go1.5.html: update the net.Dial release notes.
Paul Marks [Fri, 17 Jul 2015 21:23:26 +0000 (14:23 -0700)]
doc/go1.5.html: update the net.Dial release notes.

Change-Id: Ie02426b2b726170d858de96fdd8c51bfdf20d7dc
Reviewed-on: https://go-review.googlesource.com/12376
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoapi: add go1.5.txt API file, reset next.txt
Brad Fitzpatrick [Fri, 17 Jul 2015 15:38:52 +0000 (08:38 -0700)]
api: add go1.5.txt API file, reset next.txt

Fixes #11752

Change-Id: If4196b4bbba4f1485608bfafa98fa54781177273
Reviewed-on: https://go-review.googlesource.com/12325
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: remove mention of default GOMAXPROCS(1) in Effective Go
Brad Fitzpatrick [Sat, 18 Jul 2015 16:49:23 +0000 (09:49 -0700)]
doc: remove mention of default GOMAXPROCS(1) in Effective Go

Fixes #11781

Change-Id: Idc46a6a4fb5bf1c4d394eadf2d860d7ef75c8ccf
Reviewed-on: https://go-review.googlesource.com/12390
Reviewed-by: Rob Pike <r@golang.org>
9 years agosyscall: warn not to use FormatMessage
Alex Brainman [Mon, 13 Jul 2015 00:55:49 +0000 (10:55 +1000)]
syscall: warn not to use FormatMessage

Fixes #11147

Change-Id: Ib31160946a53f6f9b11daea211ff04d186b51b3f
Reviewed-on: https://go-review.googlesource.com/12067
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agogo/internal/gccgoimporter: fix handling of "byte" and "rune" alias types
Matthew Dempsky [Tue, 21 Jul 2015 00:04:18 +0000 (17:04 -0700)]
go/internal/gccgoimporter: fix handling of "byte" and "rune" alias types

Fixes #11762.

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

9 years agodoc: document net/http.Request.Cancel in go1.5.html
Brad Fitzpatrick [Mon, 20 Jul 2015 19:30:06 +0000 (12:30 -0700)]
doc: document net/http.Request.Cancel in go1.5.html

Change-Id: If1c12b43ef467c3ef2cbbaaba1bda4ea98032c7e
Reviewed-on: https://go-review.googlesource.com/12430
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: add crypto/sha512 additions to go1.5.html
Brad Fitzpatrick [Mon, 20 Jul 2015 22:14:01 +0000 (15:14 -0700)]
doc: add crypto/sha512 additions to go1.5.html

Change-Id: I805bb7ba40c8ed579c4ca796e408995586d219b3
Reviewed-on: https://go-review.googlesource.com/12434
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agogo/types: remove non-existing mention of MethodSetCache from comment
Robert Griesemer [Mon, 20 Jul 2015 21:49:14 +0000 (14:49 -0700)]
go/types: remove non-existing mention of MethodSetCache from comment

Fixes #11800.

Change-Id: I5eb178331f4ae80821f188e19c0c6fadeb330278
Reviewed-on: https://go-review.googlesource.com/12433
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agocmd/dist: increase timeout for standard tests
Ian Lance Taylor [Mon, 20 Jul 2015 17:18:26 +0000 (10:18 -0700)]
cmd/dist: increase timeout for standard tests

The cmd/go tests run too long on a Raspberry Pi.  I've cut times as
much as I can see without more serious steps like not running tests.

Fixes #11779.

Change-Id: Ice5da052902decea2e6ac32d0f2ce084c39ea1ab
Reviewed-on: https://go-review.googlesource.com/12368
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/go: build errors rather than fmt in a couple of tests
Ian Lance Taylor [Mon, 20 Jul 2015 16:15:46 +0000 (09:15 -0700)]
cmd/go: build errors rather than fmt in a couple of tests

The errors package is smaller and builds faster.

Update #11779.

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

9 years agocmd/go: build errors rather than strings in some tests
Ian Lance Taylor [Mon, 20 Jul 2015 15:30:45 +0000 (08:30 -0700)]
cmd/go: build errors rather than strings in some tests

Speed up the test suite by building the errors package rather than the
strings package in some cases where the specific package we are
building doesn't matter.  The errors package is smaller, and doesn't
have any assembler code.

Also make a couple of tests run in parallel.

Update #11779.

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

9 years agocmd/go: don't run TestInstalls in short mode
Ian Lance Taylor [Mon, 20 Jul 2015 01:20:06 +0000 (18:20 -0700)]
cmd/go: don't run TestInstalls in short mode

It changes GOROOT, so we shouldn't run it in short mode.  Also, it's
fairly slow.

Update #11779.

Change-Id: I3d3344954cf9b2ac70070c878a67cb65ac8fd85c
Reviewed-on: https://go-review.googlesource.com/12364
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: rewrite TestNoteReading to use test harness
Ian Lance Taylor [Mon, 20 Jul 2015 01:14:53 +0000 (18:14 -0700)]
cmd/go: rewrite TestNoteReading to use test harness

On my laptop reduces time required for test from 22 seconds to 0.14
seconds.

Update #11779.

Change-Id: I715d85bd9c6f7683c6915eedd2539813aa5efc58
Reviewed-on: https://go-review.googlesource.com/12363
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/compile: define func value symbols at declaration
Michael Hudson-Doyle [Tue, 14 Jul 2015 23:31:30 +0000 (11:31 +1200)]
cmd/compile: define func value symbols at declaration

This is mostly Russ's https://golang.org/cl/12145 but with some extra fixes to
account for the fact that function declarations without implementations now
break shared libraries, and including my test case.

Fixes #11480.

Change-Id: Iabdc2934a0378e5025e4e7affadb535eaef2c8f1
Reviewed-on: https://go-review.googlesource.com/12340
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: add example for setting trailers in an Handler
Brad Fitzpatrick [Fri, 17 Jul 2015 16:40:04 +0000 (09:40 -0700)]
net/http: add example for setting trailers in an Handler

Change-Id: I6a8bb853a538c80d95589321d3226784bc017eef
Reviewed-on: https://go-review.googlesource.com/12327
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: clarify runtime.GC blocking behavior
Austin Clements [Sun, 19 Jul 2015 06:22:18 +0000 (23:22 -0700)]
runtime: clarify runtime.GC blocking behavior

The runtime.GC documentation was rewritten in df2809f to make it clear
that it blocks until GC is complete, but the re-rewrite in ed9a4c9 and
e28a679 lost this property when clarifying that it may also block the
entire program and not just the caller.

Try to arrive at wording that conveys both of these properties.

Change-Id: I1e255322aa28a21a548556ecf2a44d8d8ac524ef
Reviewed-on: https://go-review.googlesource.com/12392
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: check for findmoduledatap returning nil
Ian Lance Taylor [Sat, 18 Jul 2015 20:35:12 +0000 (13:35 -0700)]
runtime: check for findmoduledatap returning nil

The findmoduledatap function will not return nil in ordinary use, but
check for nil to try to avoid crashing when we are already crashing.

Update #11783.

Change-Id: If7b1adb51efab13b4c1a37b6f3c9ad22641a0b56
Reviewed-on: https://go-review.googlesource.com/12391
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agointernal/trace: fix fuzzer crashers
Dmitry Vyukov [Sat, 18 Jul 2015 00:53:48 +0000 (17:53 -0700)]
internal/trace: fix fuzzer crashers

Fixes #11766
Fixes #11769
Fixes #11767
Fixes #11770

Change-Id: I441382af58f60deb46dcdd70076763b2c47738d4
Reviewed-on: https://go-review.googlesource.com/12378
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agobufio: Remove unneeded error initialization
Silvan Jegen [Tue, 13 Jan 2015 20:41:23 +0000 (21:41 +0100)]
bufio: Remove unneeded error initialization

The default value for error is nil so there is no need to assign this
value here.

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

9 years agocmd/compile: ignore carriage return in magic comments
Ian Lance Taylor [Sat, 18 Jul 2015 05:29:44 +0000 (22:29 -0700)]
cmd/compile: ignore carriage return in magic comments

Update #11771.

Change-Id: I3bb3262619765d3ca79652817e17e8f260f41907
Reviewed-on: https://go-review.googlesource.com/12379
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: classify site-local unicast in address selection
Mikio Hara [Fri, 17 Jul 2015 08:31:49 +0000 (17:31 +0900)]
net: classify site-local unicast in address selection

This change adds site-local unicast classification for users still using
the deprecated addresses internally.

Change-Id: If50870c6d4a85fe471c002b161eec59efcebe2f4
Reviewed-on: https://go-review.googlesource.com/12344
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoos: remove stuttering return value names
Brad Fitzpatrick [Fri, 17 Jul 2015 15:26:29 +0000 (08:26 -0700)]
os: remove stuttering return value names

Old style. Make it compliant with our code review comments document.

Also, make WriteString's return parameter named 'n', not 'ret', for
consistency.

Noticed during another documentation review.

Change-Id: Ie88910c5841f8353bc5c0152e2168b497578e15e
Reviewed-on: https://go-review.googlesource.com/12324
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime: skip TestReturnAfterStackGrowInCallback if gcc is not found
Alex Brainman [Sat, 18 Jul 2015 00:54:50 +0000 (10:54 +1000)]
runtime: skip TestReturnAfterStackGrowInCallback if gcc is not found

Fixes #11754

Change-Id: Ifa423ca6eea46d1500278db290498724a9559d14
Reviewed-on: https://go-review.googlesource.com/12347
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: document GODEBUG=netdns=X and netcgo in go1.5.txt
Brad Fitzpatrick [Fri, 17 Jul 2015 16:25:45 +0000 (09:25 -0700)]
doc: document GODEBUG=netdns=X and netcgo in go1.5.txt

Change-Id: I720aeb1511e407750617e23c4cba1edcddf745bb
Reviewed-on: https://go-review.googlesource.com/12326
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: make the GC message less committal.
Rob Pike [Fri, 17 Jul 2015 22:42:20 +0000 (08:42 +1000)]
runtime: make the GC message less committal.

We shouldn't guarantee this behavior, but suggest it's possible.

Change-Id: I4c2afb48b99be4d91537306d3337171a13c9990a
Reviewed-on: https://go-review.googlesource.com/12346
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd/go: ignore import of "C" when fetching dependencies
Ian Lance Taylor [Thu, 16 Jul 2015 23:25:44 +0000 (16:25 -0700)]
cmd/go: ignore import of "C" when fetching dependencies

The change https://golang.org/cl/12192 changed the get code to use the
list of package imports, not the computed list of dependencies, as the
computed list could be out of date if the package changed when using
go get -u.  Computing the dependency list would skip an import of "C",
but that would still be on the package import list.  This changes the
code to skip "C" when walking the import list.

No test--the best test would be to add an import of "C" to
github.com/rsc/go-get-issue-9224-cmd for TestGoGetUpdate.

Fixes #11738.

Change-Id: Id89ddafeade2391d15688bfd142fafd67844a941
Reviewed-on: https://go-review.googlesource.com/12322
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoos: add test to ensure Rename returns *LinkError
Dave Cheney [Fri, 17 Jul 2015 17:46:38 +0000 (10:46 -0700)]
os: add test to ensure Rename returns *LinkError

Updates #10061

CL 12353 updated the documentation for os.Rename to stipulate the function will
return errors of type *os.LinkError. This CL adds a test to ensure that the
implementations continue to obey this contract.

Change-Id: I41beb8c9d8356c737de251fdc6f652caab3ee636
Reviewed-on: https://go-review.googlesource.com/12329
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: document that GC blocks the whole program
Rob Pike [Fri, 17 Jul 2015 21:37:51 +0000 (07:37 +1000)]
runtime: document that GC blocks the whole program

No code changes. Just make it clear that runtime.GC is not concurrent.

Change-Id: I00a99ebd26402817c665c9a128978cef19f037be
Reviewed-on: https://go-review.googlesource.com/12345
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodoc: fix typo
Paolo Martini [Fri, 17 Jul 2015 15:26:08 +0000 (17:26 +0200)]
doc: fix typo

The document `doc/go_spec.html` uses "preceeding" instead of the word
"preceding" in one place.

Fixed another occurrence in `src/go/types/typexpr.go`.

Change-Id: Ic67f62026b5c9d002c5c5632299f14ecac8b02ae
Reviewed-on: https://go-review.googlesource.com/12354
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoandroidtest.bash: robust cleanup in case of failure.
Hyang-Ah (Hana) Kim [Fri, 17 Jul 2015 19:40:26 +0000 (15:40 -0400)]
androidtest.bash: robust cleanup in case of failure.

Change-Id: I69ed001bca4987e08b46a8288f6feae2aca6a142
Reviewed-on: https://go-review.googlesource.com/12380
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agodoc: document ios build tag for crypto/x509
David Crawshaw [Thu, 16 Jul 2015 19:30:47 +0000 (15:30 -0400)]
doc: document ios build tag for crypto/x509

Change-Id: I6e6d38ae347b4f5a33dff609b89785a038bc384c
Reviewed-on: https://go-review.googlesource.com/12304
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: remove out-of-date comment
Austin Clements [Fri, 17 Jul 2015 16:49:33 +0000 (09:49 -0700)]
runtime: remove out-of-date comment

An out-of-date comment snuck in to cc8f544. Remove it.

Change-Id: I5bc7c17e737d1cabe57b88de06d7579c60ca28ff
Reviewed-on: https://go-review.googlesource.com/12328
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
9 years agoos: improve documentation on Rename
Jeff R. Allen [Fri, 17 Jul 2015 14:33:51 +0000 (16:33 +0200)]
os: improve documentation on Rename

Rename should document that it returns *LinkError,
like Create and Stat do.

Fixes #10061

Change-Id: I7bfe8b0267f6c4a57dd6b26cba44928714711724
Reviewed-on: https://go-review.googlesource.com/12353
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: avoid unnecessary conversion in address selection
Mikio Hara [Fri, 17 Jul 2015 01:16:45 +0000 (10:16 +0900)]
net: avoid unnecessary conversion in address selection

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

9 years agoruntime: don't free large spans until heapBitsSweepSpan returns go1.5beta2
Austin Clements [Thu, 16 Jul 2015 20:27:09 +0000 (16:27 -0400)]
runtime: don't free large spans until heapBitsSweepSpan returns

This fixes a race between 1) sweeping and freeing an unmarked large
span and 2) reusing that span and allocating from it. This race arises
because mSpan_Sweep returns spans for large objects to the heap
*before* heapBitsSweepSpan clears the mark bit on the object in the
span.

Specifically, the following sequence of events can lead to an
incorrectly zeroed bitmap byte, which causes the garbage collector to
not trace any pointers in that object (the pointer bits for the first
four words are cleared, and the scan bits are also cleared, so it
looks like a no-scan object).

1) P0 calls mSpan_Sweep on a large span S0 with an unmarked object on it.

2) mSpan_Sweep calls heapBitsSweepSpan, which invokes the callback for
   the one (unmarked) object on the span.

3) The callback calls mHeap_Free, which makes span S0 available for
   allocation, but this is too early.

4) P1 grabs this S0 from the heap to use for allocation.

5) P1 allocates an object on this span and writes that object's type
   bits to the bitmap.

6) P0 returns from the callback to heapBitsSweepSpan.
   heapBitsSweepSpan clears the byte containing the mark, even though
   this span is now owned by P1 and this byte contains important
   bitmap information.

This fixes this problem by simply delaying the mHeap_Free until after
the heapBitsSweepSpan. I think the overall logic of mSpan_Sweep could
be simplified now, but this seems like the minimal change.

Fixes #11617.

Change-Id: I6b1382c7e7cc35f81984467c0772fe9848b7522a
Reviewed-on: https://go-review.googlesource.com/12320
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/fix: add gotypes module
Rob Pike [Thu, 16 Jul 2015 03:47:01 +0000 (13:47 +1000)]
cmd/fix: add gotypes module

Adjusts for the move from golang.org/x/tools/go/types and .../go/exact
to go/types and go/constant in the main repository.

Change-Id: I0da7248c540939e3e9b09c915b0a296937f1be73
Reviewed-on: https://go-review.googlesource.com/12284
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: don't put mycmd in wrong directory
Mikio Hara [Thu, 16 Jul 2015 06:41:34 +0000 (15:41 +0900)]
cmd/go: don't put mycmd in wrong directory

Change-Id: Ia7cc1d52211b32a2eb2b3888d621b28d6932aca9
Reviewed-on: https://go-review.googlesource.com/12290
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/mail: add example to package
Carlos C [Thu, 9 Jul 2015 13:08:39 +0000 (15:08 +0200)]
net/mail: add example to package

Change-Id: I912cafc66463f81cde839afc8f06b7eadcbf6f57
Reviewed-on: https://go-review.googlesource.com/11992
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoA+C: more updates
Brad Fitzpatrick [Thu, 16 Jul 2015 21:40:35 +0000 (14:40 -0700)]
A+C: more updates

Update #10639

Change-Id: I2d7817ac0aefb5dd2569d7e83afbc51851e24b42
Reviewed-on: https://go-review.googlesource.com/12321
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: RFC 6724 address selection
Brad Fitzpatrick [Thu, 16 Jul 2015 00:02:06 +0000 (17:02 -0700)]
net: RFC 6724 address selection

At least the most important parts, I think.

Fixes #10552

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

9 years agocrypto/x509: iOS build tag
David Crawshaw [Thu, 16 Jul 2015 17:14:56 +0000 (13:14 -0400)]
crypto/x509: iOS build tag

The iOS simulator compiles with GOOS=darwin GOARCH=386, and x509
sets the inappropriate flag -mmacosx-version-min=10.6. Condition
its compilation on the absence of an "ios" build tag.

Fixes #11736.

Change-Id: I4aa230643347320c3cb9d03b972734b2e0db930e
Reviewed-on: https://go-review.googlesource.com/12301
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/url: add example to URL.ResolveReference
Carlos C [Thu, 9 Jul 2015 13:08:39 +0000 (15:08 +0200)]
net/url: add example to URL.ResolveReference

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

9 years agodoc: describe tracing, mention go fix
Rob Pike [Thu, 16 Jul 2015 04:45:46 +0000 (14:45 +1000)]
doc: describe tracing, mention go fix

Also add a link to a couple of the talks from GopherCon 2015.

Change-Id: I11e1c550e999553163d3fb5e900f167c849ce33f
Reviewed-on: https://go-review.googlesource.com/12287
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoflag: add comment stating that Set is called in sequence across the command line
Rob Pike [Thu, 16 Jul 2015 04:30:15 +0000 (14:30 +1000)]
flag: add comment stating that Set is called in sequence across the command line

No code changes.

Change-Id: I3b78b1048318a4b80747fde8cab919282fc444a8
Reviewed-on: https://go-review.googlesource.com/12285
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agotest/fixedbugs: disable issue11656.go on arm64
Russ Cox [Thu, 16 Jul 2015 02:08:27 +0000 (22:08 -0400)]
test/fixedbugs: disable issue11656.go on arm64

For #11656.

Change-Id: I8365d33a15419bd0e54f71182ad0994e41650264
Reviewed-on: https://go-review.googlesource.com/12248
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoRevert "runtime: diagnose invalid pointers during GC"
Russ Cox [Thu, 16 Jul 2015 01:49:47 +0000 (01:49 +0000)]
Revert "runtime: diagnose invalid pointers during GC"

Broke arm64. Update #9880.

This reverts commit 38d9b2a3a942892193195a6912ab23cdaff23e20.

Change-Id: I35fa21005af2183828a9d8b195ebcfbe45ec5138
Reviewed-on: https://go-review.googlesource.com/12247
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoimage/color: fix format typo in the tests.
Nigel Tao [Thu, 16 Jul 2015 01:13:42 +0000 (11:13 +1000)]
image/color: fix format typo in the tests.

Change-Id: I6f79d201aa4e8c0e3be8d965f14ed36518536036
Reviewed-on: https://go-review.googlesource.com/12281
Reviewed-by: Rob Pike <r@golang.org>
9 years agoA+C: Add missing entries, full names.
Chris Broadfoot [Thu, 16 Jul 2015 00:12:43 +0000 (10:12 +1000)]
A+C: Add missing entries, full names.

Updates #10639

Change-Id: Ifece75b8d1d822869df8abf654725a00bef4fc25
Reviewed-on: https://go-review.googlesource.com/12280
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoRevert "cmd/internal/obj: fix pc/sp information for prologue"
Russ Cox [Wed, 15 Jul 2015 23:28:31 +0000 (23:28 +0000)]
Revert "cmd/internal/obj: fix pc/sp information for prologue"

This seems to have broken arm64 in a mysterious way. Will try again later.

This reverts commit 0a3c991fd330276f6876c401541dcbacbb860985.

Change-Id: Ic1b53413c4168977a27381d9cc6fb8d9d7cbb780
Reviewed-on: https://go-review.googlesource.com/12245
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http: don't reuse conns after incomplete 100-continue requests
Brad Fitzpatrick [Sun, 5 Jul 2015 16:15:11 +0000 (09:15 -0700)]
net/http: don't reuse conns after incomplete 100-continue requests

If we receive an HTTP request with "Expect: 100-continue" and the
Handler never read to EOF, the conn is in an unknown state.
Don't reuse that connection.

Fixes #11549

Change-Id: I5be93e7a54e899d615b05f72bdcf12b25304bc60
Reviewed-on: https://go-review.googlesource.com/12262
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoA+C: more updates, including Medium corporate CLA
Brad Fitzpatrick [Wed, 15 Jul 2015 21:42:14 +0000 (14:42 -0700)]
A+C: more updates, including Medium corporate CLA

Updates #10639

Change-Id: I0958e150f6eab122095bfc148746a38028b72dbc
Reviewed-on: https://go-review.googlesource.com/12263
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: fix parsing of Git SCP-like remotes
Andrew Gerrand [Wed, 15 Jul 2015 08:36:49 +0000 (18:36 +1000)]
cmd/go: fix parsing of Git SCP-like remotes

Now that we care about the protocol of Git remotes (for the -insecure
flag), we need to recognize and parse the SCP-like remote format.

Fixes golang/go#11457

Change-Id: Ia26132274fafb1cbfefe2475f7ac5f17ccd6da40
Reviewed-on: https://go-review.googlesource.com/12226
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: fix saved PC/SP after safe-point function in syscall
Austin Clements [Mon, 13 Jul 2015 22:30:10 +0000 (18:30 -0400)]
runtime: fix saved PC/SP after safe-point function in syscall

Running a safe-point function on syscall entry uses systemstack() and
hence clobbers g.sched.pc and g.sched.sp. Fix this by re-saving them
after the systemstack, just like in the other uses of systemstack in
reentersyscall.

Change-Id: I47868a53eba24d81919fda56ef6bbcf72f1f922e
Reviewed-on: https://go-review.googlesource.com/12125
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: run safe-point function before entering _Psyscall
Austin Clements [Mon, 13 Jul 2015 22:27:24 +0000 (18:27 -0400)]
runtime: run safe-point function before entering _Psyscall

Currently, we run a P's safe-point function immediately after entering
_Psyscall state. This is unsafe, since as soon as we put the P in
_Psyscall, we no longer control the P and another M may claim it.
We'll still run the safe-point function only once (because doing so
races on an atomic), but the P may no longer be at a safe-point when
we do so.

In particular, this means that the use of forEachP to dispose all P's
gcw caches is unsafe. A P may enter a syscall, run the safe-point
function, and dispose the P's gcw cache concurrently with another M
claiming the P and attempting to use its gcw cache. If this happens,
we may empty the gcw's workbuf after putting it on
work.{full,partial}, or add pointers to it after putting it in
work.empty. This will cause an assertion failure when we later pop the
workbuf from the list and its object count is inconsistent with the
list we got it from.

Fix this by running the safe-point function just before putting the P
in _Psyscall.

Related to #11640. This probably fixes this issue, but while I'm able
to show that we can enter a bad safe-point state as a result of this,
I can't reproduce that specific failure.

Change-Id: I6989c8ca7ef2a4a941ae1931e9a0748cbbb59434
Reviewed-on: https://go-review.googlesource.com/12124
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix go:nowritebarrier annotation on gcmarkwb_m
Matthew Dempsky [Wed, 15 Jul 2015 20:27:30 +0000 (13:27 -0700)]
runtime: fix go:nowritebarrier annotation on gcmarkwb_m

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

9 years agocmd/compile: recognize embedded field in inlined function
Ian Lance Taylor [Wed, 15 Jul 2015 05:17:41 +0000 (22:17 -0700)]
cmd/compile: recognize embedded field in inlined function

There was already special code to recognize "?" in hidden_structdcl,
which is used for inlined types and variables.  This recognizes "?" in
structdcl as well, a case that arises when a struct type appears
within an inlined function body.

Fixes #10219.

Change-Id: Ic5257ae54f817e0d4a189c2294dcd633c9f2101a
Reviewed-on: https://go-review.googlesource.com/12241
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/json: document and test overwrite of slice, map during Unmarshal
Russ Cox [Wed, 15 Jul 2015 01:32:47 +0000 (21:32 -0400)]
encoding/json: document and test overwrite of slice, map during Unmarshal

Fixes #8837.

Change-Id: Iaaecbb0b324004cb74b16b764126b01315e6a16e
Reviewed-on: https://go-review.googlesource.com/12209
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoasm: fix error messages and comments for "register pair"
Rob Pike [Wed, 15 Jul 2015 02:41:08 +0000 (12:41 +1000)]
asm: fix error messages and comments for "register pair"

The parser treats (R1+R2) on ppc64 the same as (R1,R2) on arm,
but it is not strictly a "register pair". Improve the text.

No semantic change.

Change-Id: Ib8b14881c6467add0d53150a901c01e962afb28b
Reviewed-on: https://go-review.googlesource.com/12212
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: diagnose invalid pointers during GC
Russ Cox [Mon, 8 Jun 2015 03:42:03 +0000 (23:42 -0400)]
runtime: diagnose invalid pointers during GC

For #9880. Let's see what breaks.

Change-Id: Ic8b99a604e60177a448af5f7173595feed607875
Reviewed-on: https://go-review.googlesource.com/10818
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>

9 years agocmd/compile: fix PtrTo(t) for unnamed t with embedded fields
Russ Cox [Wed, 15 Jul 2015 04:01:54 +0000 (00:01 -0400)]
cmd/compile: fix PtrTo(t) for unnamed t with embedded fields

Fixes #8427.

Change-Id: I826a3bc4519845ad30d6dbaf058fe7ed7bee8db0
Reviewed-on: https://go-review.googlesource.com/12233
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath: fix Log2 test failures on ppc64 (and s390)
Russ Cox [Wed, 15 Jul 2015 02:42:16 +0000 (22:42 -0400)]
math: fix Log2 test failures on ppc64 (and s390)

- Make Log2 exact for powers of two.
- Fix error tolerance function to make tolerance
  a function of the correct (expected) value.

Fixes #9066.

Change-Id: I0320a93ce4130deed1c7b7685627d51acb7bc56d
Reviewed-on: https://go-review.googlesource.com/12230
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoencoding/json: fix out of phase error unmarshaling non-string into TextUnmarshaler
Russ Cox [Tue, 14 Jul 2015 23:31:44 +0000 (19:31 -0400)]
encoding/json: fix out of phase error unmarshaling non-string into TextUnmarshaler

Fixes #9650.

Change-Id: I45b879124691e485b86c1e99a3227032283850d2
Reviewed-on: https://go-review.googlesource.com/12208
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agonet/smtp: give example addrs in docs
Russ Cox [Wed, 15 Jul 2015 03:33:29 +0000 (23:33 -0400)]
net/smtp: give example addrs in docs

Fixes #9140.

Change-Id: I3b85053262cac3c30358f8e03a5aca65dbc67623
Reviewed-on: https://go-review.googlesource.com/12231
Reviewed-by: Ian Lance Taylor <iant@golang.org>