]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agocrypto/x509: add /etc/ssl/cacert.pem to OmniOS cert search list
Russ Cox [Tue, 14 Jul 2015 20:20:13 +0000 (16:20 -0400)]
crypto/x509: add /etc/ssl/cacert.pem to OmniOS cert search list

Fixes #9146.

Change-Id: If5cb5ae92a201825b9ff32b3d0edfa032b9a0965
Reviewed-on: https://go-review.googlesource.com/12203
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/pprof: store temporary files in temporary directory
Russ Cox [Tue, 14 Jul 2015 19:43:33 +0000 (15:43 -0400)]
cmd/pprof: store temporary files in temporary directory

Fixes #9180.

Change-Id: Id5adaea0ca9005946fb89c88a10c6f59d8c0943c
Reviewed-on: https://go-review.googlesource.com/12202
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/pprof: run $BROWSER and system browser before Chrome
Russ Cox [Tue, 14 Jul 2015 19:38:46 +0000 (15:38 -0400)]
cmd/pprof: run $BROWSER and system browser before Chrome

Fixes #10259.

Change-Id: Ica6b8301cc8291785a3c496fb513050813b2d8df
Reviewed-on: https://go-review.googlesource.com/12201
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path
Russ Cox [Tue, 14 Jul 2015 19:15:37 +0000 (15:15 -0400)]
cmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path

Fixes #11305.

Change-Id: Icaa3a009aa4ab214c9aaf74f52c3e622fa266a9d
Reviewed-on: https://go-review.googlesource.com/12194
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: reject missing source code in go get -d, same as go get -d -u
Russ Cox [Tue, 14 Jul 2015 06:17:39 +0000 (02:17 -0400)]
cmd/go: reject missing source code in go get -d, same as go get -d -u

Fixes #11090.

Change-Id: I1518df7a48346b175ec80079a07225901fdd51fb
Reviewed-on: https://go-review.googlesource.com/12177
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: give full import stack for errors in dependencies of test dependencies
Russ Cox [Tue, 14 Jul 2015 05:56:51 +0000 (01:56 -0400)]
cmd/go: give full import stack for errors in dependencies of test dependencies

Fixes #9558.

Change-Id: I68506af58088155d38d492b49b19c5fc2048b087
Reviewed-on: https://go-review.googlesource.com/12176
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: go test -race -i runtime/race must not install race-enabled cmd/cgo
Russ Cox [Tue, 14 Jul 2015 05:14:08 +0000 (01:14 -0400)]
cmd/go: go test -race -i runtime/race must not install race-enabled cmd/cgo

Fix now uses same test as 'go build'.

Fixes #10500.

Change-Id: I2fcf2d95430643370aa29165d89a188988dee446
Reviewed-on: https://go-review.googlesource.com/12174
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: add cmd/go's -pkgdir build option
Russ Cox [Tue, 14 Jul 2015 04:34:36 +0000 (00:34 -0400)]
doc: add cmd/go's -pkgdir build option

Also use more consistent language for the new build options.

Change-Id: I88cbe200c13f452713be73d2e00337ddb793b8c6
Reviewed-on: https://go-review.googlesource.com/12172
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: add -pkgdir build flag
Russ Cox [Tue, 14 Jul 2015 04:27:59 +0000 (00:27 -0400)]
cmd/go: add -pkgdir build flag

Fixes #10210.

Change-Id: I82ddd665bca31773b1fb1b056338c04818ef68f5
Reviewed-on: https://go-review.googlesource.com/12171
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: remove duplication of build flag info in testflag.go
Russ Cox [Tue, 14 Jul 2015 04:04:50 +0000 (00:04 -0400)]
cmd/go: remove duplication of build flag info in testflag.go

Also adds to 'go test' all the build flags that were missing
due to inconsistency in the duplication (for example, -toolexec).

Fixes #10504.

Change-Id: I1935b5caa13d5e551a0483904adffa8877087df7
Reviewed-on: https://go-review.googlesource.com/12170
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: fix error for go run with files in different directories
Russ Cox [Tue, 14 Jul 2015 03:31:14 +0000 (23:31 -0400)]
cmd/go: fix error for go run with files in different directories

Fixes #9853.

Change-Id: Ic4803aa499ca20215085a87bad649014984d84c8
Reviewed-on: https://go-review.googlesource.com/12149
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: document that <meta> tags should be early in the HTML for go get
Russ Cox [Tue, 14 Jul 2015 02:55:26 +0000 (22:55 -0400)]
cmd/go: document that <meta> tags should be early in the HTML for go get

While we are here, fix a few things not updated for -insecure.

Fixes #8163.

Change-Id: Ib80c9ac00d6b61cce26c3d20bee3d30ab9af1331
Reviewed-on: https://go-review.googlesource.com/12148
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: diagnose trivial test import cycle
Russ Cox [Tue, 14 Jul 2015 02:39:17 +0000 (22:39 -0400)]
cmd/go: diagnose trivial test import cycle

Was detecting only non-trivial ones.

Fixes #9690.

Change-Id: I662d81dd4818ddf29592057c090805772c84287b
Reviewed-on: https://go-review.googlesource.com/12147
Reviewed-by: Rob Pike <r@golang.org>
9 years agoRevert "cmd/compile: define func value symbols at declaration"
Russ Cox [Wed, 15 Jul 2015 04:11:26 +0000 (04:11 +0000)]
Revert "cmd/compile: define func value symbols at declaration"

This reverts commit 3b411bf1a1bb08d6868083981cecba8088dc7aea.

Change-Id: I321a43fa378a43b3e4d7aa97e0222775640af64b
Reviewed-on: https://go-review.googlesource.com/12205
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: define func value symbols at declaration
Russ Cox [Tue, 14 Jul 2015 00:50:51 +0000 (20:50 -0400)]
cmd/compile: define func value symbols at declaration

These used to be defined at use, but that breaks when shared libraries
are involved.

For #11480.

Change-Id: I416a848754fb615c0d75f9f0ccc00723d07f7f01
Reviewed-on: https://go-review.googlesource.com/12145
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/internal/obj: fix pc/sp information for prologue
Russ Cox [Tue, 14 Jul 2015 01:21:49 +0000 (21:21 -0400)]
cmd/internal/obj: fix pc/sp information for prologue

When the prologue call to morestack was moved down to the
bottom of the function, the pc/sp tables were not updated.
If a traceback through a call to morestack is needed, it would
get confused at and stop at morestack.

Confirmed the fix by adding //go:systemstack (which calls
morestackc, but same issue) where it did not belong
and inspecting the crash.

Change-Id: Id0294bb9dba51ef1a49154637228fb57f1086a94
Reviewed-on: https://go-review.googlesource.com/12144
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet/http: do not allow space or slash in Host headers
Jeff R. Allen [Thu, 18 Jun 2015 10:37:26 +0000 (12:37 +0200)]
net/http: do not allow space or slash in Host headers

A malformed Host header can result in a malformed HTTP request.
Clean them to avoid this.

Updates #11206. We may come back and make this stricter for 1.6.

Change-Id: I23c7d821cd9dbf66c3c15d26750f305e3672d984
Reviewed-on: https://go-review.googlesource.com/11241
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: fix setKeepAlivePeriod on Plan 9
David du Colombier [Thu, 2 Jul 2015 06:36:45 +0000 (08:36 +0200)]
net: fix setKeepAlivePeriod on Plan 9

The interface to set TCP keepalive on Plan 9 is
writing the "keepalive n" string to the TCP ctl file,
where n is the milliseconds between keepalives.

Fixes #11266.

Change-Id: Ic96f6c584063665a1ddf921a9a4ddfa13cc7501b
Reviewed-on: https://go-review.googlesource.com/11860
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: add a few more details about arm and ppc64 to asm.html
Rob Pike [Tue, 14 Jul 2015 00:24:40 +0000 (10:24 +1000)]
doc: add a few more details about arm and ppc64 to asm.html

Update #10096

Arm64 and Ppc64 are still pretty sketchy.

Change-Id: Iaf821b0f17bad8c71d338d45de75d4a345cac2dd
Reviewed-on: https://go-review.googlesource.com/12160
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agogo/types: fix internal inInteger operand predicate
Robert Griesemer [Fri, 10 Jul 2015 22:11:06 +0000 (16:11 -0600)]
go/types: fix internal inInteger operand predicate

When testing if a value is an integer, if the value is a constant,
don't ignore the type if it has one.

Fixes #11594.

Change-Id: I2ff387e4f9e8ab7cae35c4838350e0a1fce2e625
Reviewed-on: https://go-review.googlesource.com/12045
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoencoding/xml: improve marshaller sanity checks of directives
Didier Spezia [Sat, 27 Jun 2015 13:07:22 +0000 (13:07 +0000)]
encoding/xml: improve marshaller sanity checks of directives

When building a directive, the current sanity check prevents
a '>' to be used, which makes a DOCTYPE directive with an
internal subset be rejected. It is accepted by the parser
though, so what can be parsed cannot be encoded.

Improved the corresponding sanity check to mirror the behavior
of the parser (in the way it handles angle brackets, quotes,
and comments).

Fixes #10158

Change-Id: Ieffea9f870f2694548e12897f8f47babc0ea4414
Reviewed-on: https://go-review.googlesource.com/11630
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5.html: fix and expand crypto/tls changes
Jonathan Rudenberg [Tue, 14 Jul 2015 23:16:01 +0000 (19:16 -0400)]
doc/go1.5.html: fix and expand crypto/tls changes

- Fix incomplete description of minimum protocol version.
- Add mention of the new ConnectionState.OCSPResponse field.
- Clarify session ticket key rotation description.

Change-Id: I6b62d30a4d0e0f84fd2c0e70e8f66ec14e6a5a90
Reviewed-on: https://go-review.googlesource.com/12197
Reviewed-by: Rob Pike <r@golang.org>
9 years agoA+C: more updates before release
Brad Fitzpatrick [Wed, 15 Jul 2015 01:29:49 +0000 (18:29 -0700)]
A+C: more updates before release

Includes subrepos and some special cases.

Updates #10639

Change-Id: I3c9ad4f6ec689903f88ccf5599d93a338e3eec4d
Reviewed-on: https://go-review.googlesource.com/12211
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoencoding/json: Only allow string option for valid types
Larz Conwell [Sun, 17 May 2015 03:01:39 +0000 (23:01 -0400)]
encoding/json: Only allow string option for valid types

The "string" option only applies for strings, floats, integers, and
booleans as per the documentation. So when decoding ignore the "string"
option if the value is not of one of the types mentioned. This matches
the Marshal step which also ignores the "string" option for invalid
types.

Fixes #9812

Change-Id: I0fb2b43d0668bc0e2985886d989abbf2252070e2
Reviewed-on: https://go-review.googlesource.com/10183
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoA+C: update for release
Brad Fitzpatrick [Wed, 15 Jul 2015 00:35:58 +0000 (17:35 -0700)]
A+C: update for release

This is an automated update for the main branch of the main repo.
Some special cases and other repos will follow.

Updates #10639

Change-Id: I4b149c037e9292b7e323a9f4c009092ce6b70ce5
Reviewed-on: https://go-review.googlesource.com/12159
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc/go1.5.html: fix typo
Jonathan Rudenberg [Tue, 14 Jul 2015 23:22:24 +0000 (19:22 -0400)]
doc/go1.5.html: fix typo

This is the first mention of the fmt package in the changes list.

Change-Id: I5d378d8707e6735e0e590527db4196b517fefd72
Reviewed-on: https://go-review.googlesource.com/12198
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc/go1.5.html: fix typo
Jonathan Rudenberg [Tue, 14 Jul 2015 22:53:13 +0000 (18:53 -0400)]
doc/go1.5.html: fix typo

Change-Id: I8bbdf6c769e089fca8458166dffff5aea0f74675
Reviewed-on: https://go-review.googlesource.com/12196
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocrypto: add SHA-512/224 and SHA-512/256 as described in FIPS 180-4
Nevins Bartolomeo [Wed, 3 Jun 2015 20:55:41 +0000 (16:55 -0400)]
crypto: add SHA-512/224 and SHA-512/256 as described in FIPS 180-4

Change-Id: Ifbab8203dea1eb0df4c834df22e12cb7c37c14fd
Reviewed-on: https://go-review.googlesource.com/10683
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

9 years agocmd/go: do not create subdirs of $GOBIN
David Crawshaw [Sat, 11 Jul 2015 15:28:16 +0000 (11:28 -0400)]
cmd/go: do not create subdirs of $GOBIN

Fixes #9769.

Change-Id: I2959906c71d0ce62cdb750dab78eab631a26f229
Reviewed-on: https://go-review.googlesource.com/12080
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: warn on get from code.google.com that it is shutting down
Ian Lance Taylor [Sat, 11 Jul 2015 13:42:48 +0000 (06:42 -0700)]
cmd/go: warn on get from code.google.com that it is shutting down

Fixes #10193.

Change-Id: Ibbb747babb697a66b943e5da76b0ada41f1fb14f
Reviewed-on: https://go-review.googlesource.com/12070
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5.html: fix typo.
Ian Lance Taylor [Tue, 14 Jul 2015 15:14:03 +0000 (08:14 -0700)]
doc/go1.5.html: fix typo.

Fixes #11704.

Change-Id: If103f8eca7e53b0120885e2ec086db12176ea078
Reviewed-on: https://go-review.googlesource.com/12155
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoimage/jpeg: don't unread a byte if we've already taken bits from it.
Nigel Tao [Tue, 14 Jul 2015 05:46:18 +0000 (15:46 +1000)]
image/jpeg: don't unread a byte if we've already taken bits from it.

This rolls back most of golang.org/cl/8841, aka 2f98bac310, and makes a
different fix. It keeps the TestTruncatedSOSDataDoesntPanic test
introduced by that other CL, which obviously still passes after this CL.

Fixes #11650, a regression (introduced by cl/8841) from Go 1.4.

The original cl/8841 changed the image/jpeg not to panic on an input
given in #10387. We still do not panic on that input, after this CL.

I have a corpus of over 160,000 JPEG images, a sample of a web crawl.
The image/jpeg code ran happily over that whole corpus both before and
after this CL, although that corpus clearly didn't catch the regression
in the first place.

This code was otherwise tested manually. I don't think that it's trivial
to synthesize a JPEG input that happens to run out of Huffman data at
just the right place. The test image attached to #11650 obviously has
that property, but I don't think we can simply add that test image to
the repository: it's 227KiB, and I don't know its copyright status.

I also looked back over the issue tracker for problematic JPEGs that
people have filed. The Go code, after this CL, is still happy on these
files in my directory:
issue2362a.jpeg
issue3916.jpeg
issue3976.jpeg
issue4084.jpeg
issue4259.jpeg
issue4291.jpeg
issue4337.jpeg
issue4500.jpeg
issue4705.jpeg
issue4975.jpeg
issue5112.jpeg
issue6767.jpeg
issue9888.jpeg
issue10133.jpeg
issue10357.jpeg
issue10447.jpeg
issue11648.jpeg
issue11650.jpeg

There were other images attached in the issue tracker that aren't
actually valid JPEGs. They failed both before and after this CL:
broken-issue2362b.jpeg
broken-issue6450.jpeg
broken-issue8693.jpeg
broken-issue10154.jpeg
broken-issue10387.jpeg
broken-issue10388.jpeg
broken-issue10389.jpeg
broken-issue10413.jpeg

In summary, this CL fixes #11650 and, after some automated and manual
testing, I don't think introduces new regressions.

Change-Id: I30b67036e9b087f3051d57dac7ea05fb4fa36f66
Reviewed-on: https://go-review.googlesource.com/12163
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: document behavior change in image/color in release notes
Rob Pike [Tue, 14 Jul 2015 05:20:19 +0000 (15:20 +1000)]
doc: document behavior change in image/color in release notes

Change-Id: I7ad90ab78abb8a39d56c837610d5c311a96b7039
Reviewed-on: https://go-review.googlesource.com/12162
Reviewed-by: Nigel Tao <nigeltao@golang.org>
9 years agoos/exec: fix plan9 build
Brad Fitzpatrick [Tue, 14 Jul 2015 05:13:32 +0000 (22:13 -0700)]
os/exec: fix plan9 build

Fixes build from https://golang.org/cl/12152

Plan 9 lacks syscall.EPIPE. I was misled by api/go1.txt and also
forgot to use the trybots. :(

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

9 years agocmd/go: mark ssh:// URLs as secure
Ross Light [Thu, 25 Jun 2015 20:14:28 +0000 (13:14 -0700)]
cmd/go: mark ssh:// URLs as secure

Add tests for isSecure function.

Change-Id: I49de9d2846b75d4c7be745484f85d351a6fd851d
Reviewed-on: https://go-review.googlesource.com/11514
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix build on non-x86 machines
Russ Cox [Tue, 14 Jul 2015 04:41:18 +0000 (00:41 -0400)]
runtime: fix build on non-x86 machines

Fixes #11656 (again).

Change-Id: I170ff10bfbdb0f34e57c11de42b6ee5291837813
Reviewed-on: https://go-review.googlesource.com/12142
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoos/exec: ignore pipe write errors when command completes successfully
Brad Fitzpatrick [Tue, 14 Jul 2015 00:17:24 +0000 (18:17 -0600)]
os/exec: ignore pipe write errors when command completes successfully

Fixes #9173

Change-Id: I83530533db84b07cb88dbf6ec690be48a06a9d7d
Reviewed-on: https://go-review.googlesource.com/12152
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodoc: update the architecture-specific information in asm.html
Rob Pike [Mon, 13 Jul 2015 05:22:35 +0000 (15:22 +1000)]
doc: update the architecture-specific information in asm.html

Still to do: ARM64 and PPC64. These architectures are woefully underdocumented.

Change-Id: Iedcf767a7e0e1c931812351940bc08f0c3821212
Reviewed-on: https://go-review.googlesource.com/12110
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj: rename *.out.go to a.out.go
Rob Pike [Mon, 13 Jul 2015 03:44:01 +0000 (13:44 +1000)]
cmd/internal/obj: rename *.out.go to a.out.go

The old numerical names like 6.out.go are a relic from the old tools.
Easier to rename than explain.

The anames.go files were modified by go generate; no changes
beyond the explanatory comment at the top.

Change-Id: I84742c75c60e47724baa9d49a91fef1f8581f021
Reviewed-on: https://go-review.googlesource.com/12069
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}
Austin Clements [Wed, 1 Jul 2015 15:04:19 +0000 (11:04 -0400)]
runtime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}

These memstats are currently being computed by gcMark, which was
appropriate in Go 1.4, but gcMark is now just one part of a bigger
picture. In particular, it can't account for the sweep termination
pause time, it can't account for all of the mark termination pause
time, and the reported "pause end" and "last GC" times will be
slightly earlier than they really are.

Lift computing of these statistics into func gc, which has the
appropriate visibility into the process to compute them correctly.

Fixes one of the issues in #10323. This does not add new statistics
appropriate to the concurrent collector; it simply fixes existing
statistics that are being misreported.

Change-Id: I670cb16594a8641f6b27acf4472db15b6e8e086e
Reviewed-on: https://go-review.googlesource.com/11794
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: report MemStats.PauseEnd in UNIX time
Austin Clements [Tue, 30 Jun 2015 22:20:13 +0000 (18:20 -0400)]
runtime: report MemStats.PauseEnd in UNIX time

Currently we report MemStats.PauseEnd in nanoseconds, but with no
particular 0 time. On Linux, the 0 time is when the host started. On
Darwin, it's the UNIX epoch. This is also inconsistent with the other
absolute time in MemStats, LastGC, which is always reported in
nanoseconds since 1970.

Fix PauseEnd so it's always reported in nanoseconds since 1970, like
LastGC.

Fixes one of the issues raised in #10323.

Change-Id: Ie2fe3169d45113992363a03b764f4e6c47e5c6a8
Reviewed-on: https://go-review.googlesource.com/11801
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix x86 stack trace for call to heap memory
Russ Cox [Fri, 10 Jul 2015 16:32:03 +0000 (12:32 -0400)]
runtime: fix x86 stack trace for call to heap memory

Fixes #11656.

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

9 years agoruntime: fix race in TestChanSendBarrier
Russ Cox [Mon, 13 Jul 2015 19:23:59 +0000 (15:23 -0400)]
runtime: fix race in TestChanSendBarrier

Fixes race detector build.

Change-Id: I8bdc78d57487580e6b5b8c415df4653a1ba69e37
Reviewed-on: https://go-review.googlesource.com/12087
Reviewed-by: Austin Clements <austin@google.com>
9 years agonet: clean up builtin DNS stub resolver, fix tests
Mikio Hara [Thu, 11 Jun 2015 03:46:01 +0000 (12:46 +0900)]
net: clean up builtin DNS stub resolver, fix tests

This change does clean up as preparation for fixing #11081.

- renames cfg to resolvConf for clarification
- adds a new type resolverConfig and its methods: init, update,
  tryAcquireSema, releaseSema for mutual exclusion of resolv.conf data
- deflakes, simplifies tests for resolv.conf data; previously the tests
  sometimes left some garbage in the data

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

9 years agocmd/go: fix go get -u with internal
Russ Cox [Fri, 10 Jul 2015 17:05:02 +0000 (13:05 -0400)]
cmd/go: fix go get -u with internal

Fixes #11307.
Fixes #11055.

Change-Id: I8d6b04cb509e62e27d6935b91ffe35fdaea4ebcd
Reviewed-on: https://go-review.googlesource.com/12028
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: add memory barrier for sync send in select
Russ Cox [Sat, 11 Jul 2015 15:53:58 +0000 (11:53 -0400)]
runtime: add memory barrier for sync send in select

Missed select case when adding the barrier last time.
All the more reason to refactor this code in Go 1.6.

Fixes #11643.

Change-Id: Ib0d19d6e0939296c0a3e06dda5e9b76f813bbc7e
Reviewed-on: https://go-review.googlesource.com/12086
Reviewed-by: Austin Clements <austin@google.com>
9 years agogo/internal/gcimporter: populate (*types.Package).Imports
Alan Donovan [Tue, 21 Apr 2015 19:05:18 +0000 (15:05 -0400)]
go/internal/gcimporter: populate (*types.Package).Imports

This is a copy of an upstream change to the tools repo:
https://go-review.googlesource.com/#/c/8924/

This is a second attempt at CL 8954, with the necessary change to
go/build's deps test.

Change-Id: Ib798498cf85fea0baec5667e9324d11f6ae8ad64
Reviewed-on: https://go-review.googlesource.com/9173
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoimage/png: don't read filter bytes for empty interlace passes.
Nigel Tao [Sun, 12 Jul 2015 11:02:13 +0000 (21:02 +1000)]
image/png: don't read filter bytes for empty interlace passes.

Fixes #11604

The gray-gradient.png image was created by a Go program:

----
package main

import (
"image"
"image/color"
"image/png"
"log"
"os"
)

func main() {
f, err := os.Create("a.png")
if err != nil {
log.Fatal(err)
}
defer f.Close()
m := image.NewGray(image.Rect(0, 0, 1, 16))
for i := 0; i < 16; i++ {
m.SetGray(0, i, color.Gray{uint8(i * 0x11)})
}
err = png.Encode(f, m)
if err != nil {
log.Fatal(err)
}
}
----

The equivalent gray-gradient.interlaced.png image was created via ImageMagick:
$ convert -interlace PNG gray-gradient.png gray-gradient.interlaced.png

As a sanity check:
$ file gray-gradient.*
gray-gradient.interlaced.png: PNG image data, 1 x 16, 4-bit grayscale, interlaced
gray-gradient.png:            PNG image data, 1 x 16, 8-bit grayscale, non-interlaced

Change-Id: I7700284f74d1ea30073aede3bce4d7651787bdbc
Reviewed-on: https://go-review.googlesource.com/12064
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/dist: actually disable testso and testsovar on ppc64
Michael Hudson-Doyle [Mon, 13 Jul 2015 03:20:12 +0000 (15:20 +1200)]
cmd/dist: actually disable testso and testsovar on ppc64

This is clearly what was intended all along. ./all.bash passes with this
change.

Change-Id: I16996da11cf1e4d2dc2a4434b7611a724691e8dc
Reviewed-on: https://go-review.googlesource.com/12068
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: add section about standard library to the FAQ
Brad Fitzpatrick [Sun, 5 Jul 2015 17:00:14 +0000 (10:00 -0700)]
doc: add section about standard library to the FAQ

Fixes #10246

Change-Id: Ifa698232a09e1c37f3a9340ffdc1f2650c06fe4c
Reviewed-on: https://go-review.googlesource.com/11900
Reviewed-by: Rob Pike <r@golang.org>
9 years agotime: document that time.Tick creates an unrecoverable resource
Rob Pike [Mon, 13 Jul 2015 01:13:15 +0000 (11:13 +1000)]
time: document that time.Tick creates an unrecoverable resource

Fixes #11662.

Change-Id: I8839b48a1cd3da4c29b6def03cb0c74c1c12942e
Reviewed-on: https://go-review.googlesource.com/12066
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomisc/cgo/testshared: unset GOBIN during test
Ian Lance Taylor [Sun, 12 Jul 2015 17:18:32 +0000 (10:18 -0700)]
misc/cgo/testshared: unset GOBIN during test

Fixes #11273.

Change-Id: I409b6c4168711913076439036d65e8639ca3b06f
Reviewed-on: https://go-review.googlesource.com/12073
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/dist: disable misc/scgo/testsovar on netbsd
Alex Brainman [Sat, 11 Jul 2015 07:19:39 +0000 (17:19 +1000)]
cmd/dist: disable misc/scgo/testsovar on netbsd

Update #11654

Change-Id: Ia199b8dd349542ad8b92b463dd2f3734dd7e66a4
Reviewed-on: https://go-review.googlesource.com/12060
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoall: link to https for golang subdomains too
Brad Fitzpatrick [Sat, 11 Jul 2015 14:51:20 +0000 (08:51 -0600)]
all: link to https for golang subdomains too

The previous commit (git 2ae77376) just did golang.org.  This one
includes golang.org subdomains like blog, play, and build.

Change-Id: I4469f7b307ae2a12ea89323422044e604c5133ae
Reviewed-on: https://go-review.googlesource.com/12071
Reviewed-by: Rob Pike <r@golang.org>
9 years agoflag: Clarifies docs for Arg(int) and FlagSet.Arg(int)
Hariharan Srinath [Sat, 11 Jul 2015 08:50:14 +0000 (14:20 +0530)]
flag: Clarifies docs for Arg(int) and FlagSet.Arg(int)

Adds the clarification that these functions return empty
string if the requested element is not available

Added fullstops

Fixes #11664

Change-Id: I84173862bc785240f7d3ee75a5023673264d172b
Reviewed-on: https://go-review.googlesource.com/12061
Reviewed-by: Rob Pike <r@golang.org>
9 years agoall: link to https instead of http
Brad Fitzpatrick [Fri, 10 Jul 2015 23:17:11 +0000 (17:17 -0600)]
all: link to https instead of http

The one in misc/makerelease/makerelease.go is particularly bad and
probably warrants rotating our keys.

I didn't update old weekly notes, and reverted some changes involving
test code for now, since we're late in the Go 1.5 freeze. Otherwise,
the rest are all auto-generated changes, and all manually reviewed.

Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d
Reviewed-on: https://go-review.googlesource.com/12048
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet/http/fcgi: fix race between serveRequest and cleanUp
Brad Fitzpatrick [Fri, 3 Jul 2015 19:32:40 +0000 (12:32 -0700)]
net/http/fcgi: fix race between serveRequest and cleanUp

Fixes #11552

Change-Id: I87904e9e3fb4bd1fb4c7075a4e2d0151e5bd37df
Reviewed-on: https://go-review.googlesource.com/11890
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: abort on fatal errors and panics in c-shared and c-archive modes
Elias Naur [Sat, 11 Jul 2015 10:59:00 +0000 (12:59 +0200)]
runtime: abort on fatal errors and panics in c-shared and c-archive modes

The default behaviour for fatal errors and runtime panics is to dump
the goroutine stack traces and exit with code 2. However, when the process is
owned by foreign code, it is suprising and inappropriate to suddenly exit
the whole process, even on fatal errors. Instead, re-use the crash behaviour
from GOTRACEBACK=crash and abort.

The motivating use case is issue #11382, where an Android crash reporter
is confused by an exiting process, but I believe the aborting behaviour
is appropriate for all cases where Go does not own the process.

The change is simple and contained and will enable reliable crash reporting
for Android apps in Go 1.5, but I'll leave it to others to judge whether it
is too late for Go 1.5.

Fixes #11382

Change-Id: I477328e1092f483591c99da1fbb8bc4411911785
Reviewed-on: https://go-review.googlesource.com/12032
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 agoruntime: use AddVectoredContinueHandler on Windows XP amd64
Alex Brainman [Mon, 6 Jul 2015 00:34:01 +0000 (10:34 +1000)]
runtime: use AddVectoredContinueHandler on Windows XP amd64

Recent change (CL 10370) unexpectedly broke TestRaiseException on
Windows XP amd64. I still do not know why. But reverting old
CL 8165 fixes the problem.

This effectively makes Windows XP amd64 use AddVectoredContinueHandler
instead of SetUnhandledExceptionFilter for exception handling. That is
what we do for all recent Windows versions too.

Fixes #11481

Change-Id: If2e8037711f05bf97e3c69f5a8d86af67c58f6fc
Reviewed-on: https://go-review.googlesource.com/11888
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath: Expm1 returns -1 with large negative argument.
Charlie Dorian [Wed, 1 Jul 2015 00:14:30 +0000 (20:14 -0400)]
math: Expm1 returns -1 with large negative argument.

Fixes #11442

Change-Id: I2053fe752c6a122924d28565f1338f73e00ed417
Reviewed-on: https://go-review.googlesource.com/11791
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link/internal/ld: stricter object file decoding
Matthew Dempsky [Fri, 10 Jul 2015 21:38:35 +0000 (14:38 -0700)]
cmd/link/internal/ld: stricter object file decoding

Instead of silently truncating integers to their expected range, check
that they're within range and emit errors if not.  Intended to help
narrow down the cause of issue #11617.

Change-Id: Ia7b577270f8438ca7479262702371e26277f1ea7
Reviewed-on: https://go-review.googlesource.com/12050
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime, cmd/go: fix tests to work when GOROOT_FINAL is set
Ian Lance Taylor [Fri, 10 Jul 2015 12:20:20 +0000 (05:20 -0700)]
runtime, cmd/go: fix tests to work when GOROOT_FINAL is set

When GOROOT_FINAL is set when running all.bash, the tests are run
before the files are copied to GOROOT_FINAL.  The tests are run with
GOROOT set, so most work fine.  This fixes two cases that do not.

In cmd/go/go_test.go we were explicitly removing GOROOT from the
environment, causing tests that did not themselves explicitly set
GOROOT to fail.  There was no need to explicitly remove GOROOT, so
don't do it.  If people choose to run "go test cmd/go" with a bad
GOROOT, that is their own lookout.

In the runtime GDB test, the linker has told gdb to find the support
script in GOROOT_FINAL, which will fail.  Check for that case, and
skip the test when we see it.

Fixes #11652.

Change-Id: I4d3a32311e3973c30fd8a79551aaeab6789d0451
Reviewed-on: https://go-review.googlesource.com/12021
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: clarify that NumCPU returns only available CPUs
Ian Lance Taylor [Fri, 10 Jul 2015 13:20:51 +0000 (06:20 -0700)]
runtime: clarify that NumCPU returns only available CPUs

Update #11609.

Change-Id: Ie363facf13f5e62f1af4a8bdc42a18fb36e16ebf
Reviewed-on: https://go-review.googlesource.com/12022
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: fix misidentification of link-local, global unicast IP addresses
Mikio Hara [Sat, 4 Jul 2015 04:49:47 +0000 (13:49 +0900)]
net: fix misidentification of link-local, global unicast IP addresses

Don't treat IPv4-mapped link-local IP addresses as IPv6 link-local
addresses, an IPv4 broadcast address as a global unicast IP address.

Fixes #11585.

Change-Id: I6a7a0c0601f18638f5c624ab63e12ee40f77b182
Reviewed-on: https://go-review.googlesource.com/11883
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: ensure that ResolveIPAddr(addr.String()) reproduces addr
Mikio Hara [Tue, 7 Jul 2015 03:10:15 +0000 (12:10 +0900)]
net: ensure that ResolveIPAddr(addr.String()) reproduces addr

Updates #6465.

Change-Id: I5babbcf4c92dae47c823a41628b01e4ceb2332eb
Reviewed-on: https://go-review.googlesource.com/11951
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/doc: submit to the punched card tyranny
Rob Pike [Fri, 10 Jul 2015 01:52:39 +0000 (11:52 +1000)]
cmd/doc: submit to the punched card tyranny

People use 80-column terminals because their grandparents used
punched cards. When I last used a punched card, in 1978, it seemed
antiquated even then. But today, people still set their terminal
widths to 80 to honor the struggles their fallen ancestors made to
endure this painful technology.

We must all stand and salute the 80 column flag, or risk the opprobium
of our peers.

For Pete's sake, I don't even use a fixed-width font. I don't even
believe in columns.

Fixes #11639 with extreme reluctance.

P.S. To avoid the horror of an automatically folded line of text, this commit message has been formatted to fit on an 80-column line, except for this postscript.

Change-Id: Ia2eb2dcf293dabe804c22ee5abb4bbb703f45c33
Reviewed-on: https://go-review.googlesource.com/12011
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/pe: truncate pe sections to their size in memory
Alex Brainman [Mon, 6 Jul 2015 05:52:33 +0000 (15:52 +1000)]
debug/pe: truncate pe sections to their size in memory

Section.Data returns disk section data, but those are rounded up to
some predefined value. Processing these as is confuses dwarf parser
because of garbage at the end. Truncate Section.Data as per memory
section description.

Sometimes dwarf sections have memory section size of 0
(for pe object files). Keep those to their disk size.

Fixes #11608

Change-Id: I8de0a2271201a24aa9ac8dac44f1e9c8a9285183
Reviewed-on: https://go-review.googlesource.com/11950
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet: add mechanisms to force go or cgo lookup, and to debug default strategy
Brad Fitzpatrick [Thu, 25 Jun 2015 10:52:54 +0000 (12:52 +0200)]
net: add mechanisms to force go or cgo lookup, and to debug default strategy

GODEBUG=netdns=1 prints a one-time strategy decision. (cgo or go DNS lookups)
GODEBUG=netdns=2 prints the per-lookup strategy as a function of the hostname.

The new "netcgo" build tag forces cgo DNS lookups.

GODEBUG=netdns=go (or existing build tag "netgo") forces Go DNS resolution.
GODEBUG=netdns=cgo (or new build tag "netcgo") forces libc DNS resolution.

Options can be combined with e.g. GODEBUG=netdns=go+1 or GODEBUG=netdns=2+cgo.

Fixes #11322
Fixes #11450

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

9 years agoCONTRIBUTORS: add Ross Light's google.com email
Ross Light [Thu, 9 Jul 2015 17:13:09 +0000 (10:13 -0700)]
CONTRIBUTORS: add Ross Light's google.com email

Change-Id: Ide5b0c81405fbf6b83a6f02527d629898e0fcf02
Reviewed-on: https://go-review.googlesource.com/12000
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: make sysmon-triggered GC concurrent
Austin Clements [Wed, 8 Jul 2015 21:18:33 +0000 (14:18 -0700)]
runtime: make sysmon-triggered GC concurrent

sysmon triggers a GC if there has been no GC for two minutes.
Currently, this is a STW GC. There is no reason for this to be STW, so
make it concurrent.

Fixes #10261.

Change-Id: I92f3ac37272d5c2a31480ff1fa897ebad08775a9
Reviewed-on: https://go-review.googlesource.com/11955
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: document the machine-independent changes to the assembler
Rob Pike [Wed, 8 Jul 2015 05:53:47 +0000 (15:53 +1000)]
doc: document the machine-independent changes to the assembler

The architecture-specific details will be updated and expanded in
a subsequent CL (or series thereof).

Update #10096

Change-Id: I59c6be1fcc123fe8626ce2130e6ffe71152c87af
Reviewed-on: https://go-review.googlesource.com/11954
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: R13 is stack pointer on ARM, not 386
Rob Pike [Thu, 9 Jul 2015 05:06:15 +0000 (15:06 +1000)]
doc: R13 is stack pointer on ARM, not 386

Fix typo.

TBR=rsc

Change-Id: I85d1b46744a9a4524e7949e452cdebb53afe0740
Reviewed-on: https://go-review.googlesource.com/11959
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: add -test.count and get -insecure to go1.5.html
Rob Pike [Thu, 9 Jul 2015 00:10:12 +0000 (10:10 +1000)]
doc: add -test.count and get -insecure to go1.5.html

Change-Id: Ie3d603a95826b9b6a7acd4825991f24c3c61408b
Reviewed-on: https://go-review.googlesource.com/11956
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/doc: suppress symbols for commands when showing package docs
Rob Pike [Wed, 8 Jul 2015 01:17:01 +0000 (11:17 +1000)]
cmd/doc: suppress symbols for commands when showing package docs

Change the default behavior when showing the package docs
for a command to elide the symbols. This makes

go doc somecommand

show the top-level package docs only and hide the symbols,
which are probably irrelevant to the user. This has no effect
on explicit requests for internals, such as

go doc somecommand.sometype

The new -cmd flag restores the old behavior.

Fixes #10733.

Change-Id: I4d363081fe7dabf76ec8e5315770ac3609592f80
Reviewed-on: https://go-review.googlesource.com/11953
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/asm: add copyright notices to tests
Rob Pike [Thu, 9 Jul 2015 02:49:01 +0000 (12:49 +1000)]
cmd/asm: add copyright notices to tests

They were missing from the inputs.
Unfortunately this means the .out files all have wrong line numbers,
but they are easy to update.

Change-Id: I254742f24ab803421f34d52d13b9afa93674edd6
Reviewed-on: https://go-review.googlesource.com/11958
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5: mention net/http.Request.Cancel
Aaron Jacobs [Wed, 8 Jul 2015 00:05:39 +0000 (10:05 +1000)]
doc/go1.5: mention net/http.Request.Cancel

This was added in commit 8b4278ffb75e79c277bfa90c5e473bfad9f7c1bd.

Change-Id: I95279f2779c2bab2767e34389fb4324900c01e6c
Reviewed-on: https://go-review.googlesource.com/11952
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/go: disable vendoredImportPath for code outside $GOPATH go1.5beta1
Russ Cox [Tue, 7 Jul 2015 21:51:20 +0000 (17:51 -0400)]
cmd/go: disable vendoredImportPath for code outside $GOPATH

It was crashing.
This fixes the build for
GO15VENDOREXPERIMENT=1 go test -short runtime

Fixes #11416.

Change-Id: I74a9114cdd8ebafcc9d2a6f40bf500db19c6e825
Reviewed-on: https://go-review.googlesource.com/11964
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: allow static init for unsafe.Pointer(&x) where x is global
Russ Cox [Mon, 29 Jun 2015 16:49:25 +0000 (12:49 -0400)]
cmd/compile: allow static init for unsafe.Pointer(&x) where x is global

This avoids both a write barrier and then dynamic initialization
globals of the form

var x something
var xp = unsafe.Pointer(&x)

Using static initialization avoids emitting a relocation for &x,
which helps cgo.

Fixes #9411.

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

9 years agonet/http: fix MaxBytesReader at EOF
Brad Fitzpatrick [Thu, 25 Jun 2015 23:11:14 +0000 (16:11 -0700)]
net/http: fix MaxBytesReader at EOF

Fixes #10884

Change-Id: I7cab3c96548867612f579d2cd4ec736309787443
Reviewed-on: https://go-review.googlesource.com/11961
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: revert overly-strict part of earlier smuggling defense
Brad Fitzpatrick [Tue, 7 Jul 2015 19:19:44 +0000 (13:19 -0600)]
net/http: revert overly-strict part of earlier smuggling defense

The recent https://golang.org/cl/11810 is reportedly a bit too
aggressive.

Apparently some HTTP requests in the wild do contain both a
Transfer-Encoding along with a bogus Content-Length. Instead of
returning a 400 Bad Request error, we should just ignore the
Content-Length like we did before.

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

9 years agocmd/compile: initialize line number properly for temporaries
David Chase [Mon, 29 Jun 2015 20:30:19 +0000 (16:30 -0400)]
cmd/compile: initialize line number properly for temporaries

The expansion of structure, array, slice, and map literals
does not use the right line number in its introduced assignments
to temporaries, which leads to incorrect line number attribution
for expressions in those literals.

Inlining also incorrectly replaced the line numbers of args to
inlined functions.

This was revealed in CL 9721 because a now-avoided temporary
assignment introduced the correct line number.
I.e. before CL 9721
  "tmp_wrongline := expr"
was transformed to
  "tmp_rightline := expr; tmp_wrongline := tmp_rightline"

Also includes a repair to CL 10334 involving line numbers
where a spurious -1 remained (should have been 0, now is 0).

Fixes #11400.

Change-Id: I3a4687efe463977fa1e2c996606f4d91aaf22722
Reviewed-on: https://go-review.googlesource.com/11730
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: randomize scheduling in -race mode
Russ Cox [Wed, 1 Jul 2015 18:12:31 +0000 (14:12 -0400)]
runtime: randomize scheduling in -race mode

Basic randomization of goroutine scheduling for -race mode.
It is probably possible to do much better (there's a paper linked
in the issue that I haven't read, for example), but this suffices
to introduce at least some unpredictability into the scheduling order.
The goal here is to have _something_ for Go 1.5, so that we don't
start hitting more of these scheduling order-dependent bugs
if we change the scheduler order again in Go 1.6.

For #11372.

Change-Id: Idf1154123fbd5b7a1ee4d339e93f97635cc2bacb
Reviewed-on: https://go-review.googlesource.com/11795
Reviewed-by: Austin Clements <austin@google.com>
9 years agocmd/go: ignore volume name case when checking vendor path
Daniel Theophanes [Mon, 22 Jun 2015 17:59:24 +0000 (10:59 -0700)]
cmd/go: ignore volume name case when checking vendor path

Fixes #11409

Change-Id: Ic1610e124b2d8b2b12310fc9538d5078cc7302a0
Reviewed-on: https://go-review.googlesource.com/11316
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: create executable when installing to working directory
Ross Light [Thu, 25 Jun 2015 16:56:08 +0000 (09:56 -0700)]
cmd/go: create executable when installing to working directory

Fixes #11065.

Change-Id: Idd854facd5fa78c0334f86740f351d404f9a5b2d
Reviewed-on: https://go-review.googlesource.com/11511
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: do not panic on invalid import path containing "/vendor/"
Daniel Theophanes [Mon, 29 Jun 2015 17:08:58 +0000 (10:08 -0700)]
cmd/go: do not panic on invalid import path containing "/vendor/"

Fixes #11414

Change-Id: I45a41b98554f00362d9222e9c68a441dbfc23cb8
Reviewed-on: https://go-review.googlesource.com/11700
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http/httputil: make ReverseProxy support Trailers
Brad Fitzpatrick [Mon, 6 Jul 2015 22:57:35 +0000 (15:57 -0700)]
net/http/httputil: make ReverseProxy support Trailers

Go's continuous build system depends on HTTP trailers for the buildlet
interface.

Andrew rewrote the makerelease tool to work in terms of Go's builder
system (now at x/build/cmd/release), but it previously could only
create GCE-based buildlets, which meant x/build/cmd/release couldn't
build the release for Darwin.

https://golang.org/cl/11901 added support for proxying buildlet
connections via the coordinator, but that exposed the fact that
httputil.ReverseProxy couldn't proxy Trailers. A fork of that code
also wasn't possible because net/http needlessly deleted the "Trailer"
response header in the Transport code.  This mistake goes back to
"release-branch.r56" and earlier but was never noticed because nobody
ever uses Trailers, and servers via ResponseWriter never had the
ability to even set trailers before this Go 1.5. Note that setting
trailers requires pre-declaring (in the response header) which
trailers you'll set later (after the response body). Because you could
never set them, before this release you could also never proxy them.

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

9 years agodoc: tools for go1.5.html
Rob Pike [Sun, 5 Jul 2015 23:01:32 +0000 (09:01 +1000)]
doc: tools for go1.5.html

Don't know why, but git deleted the previous version of this change.
This is the same change as https://go-review.googlesource.com/11884,
which I will now abandon, with a couple of fixes.

Almost all done now. Could use help with the TODOs.

Major missing piece is the trace command. Vendoring
section is also weak, but it's also undocumented elsewhere.

Change-Id: I5d8556b23aa6628eb7bf0e330d4dd8d4ac2157c5
Reviewed-on: https://go-review.googlesource.com/11887
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc/go1.5.html: fix typo
Elias Naur [Sat, 4 Jul 2015 16:33:21 +0000 (18:33 +0200)]
doc/go1.5.html: fix typo

Change-Id: If33ffe1da23a8463fc5479f453422d280b736372
Reviewed-on: https://go-review.googlesource.com/11865
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: delete references to old tools (5a etc.) from cmd/go docs
Rob Pike [Sun, 5 Jul 2015 00:43:34 +0000 (10:43 +1000)]
cmd/go: delete references to old tools (5a etc.) from cmd/go docs

Don't talk about commands that no longer exist.

There are still references throughout the tree, mostly in comments,
but they provide a charming historical backdrop for the idle tourist.

Change-Id: I637ebdce05bbc7df5addcc46cb772d2bb9f3e073
Reviewed-on: https://go-review.googlesource.com/11885
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomath/rand: improve NewZipf documentation
Josh Bleecher Snyder [Fri, 3 Jul 2015 18:11:42 +0000 (11:11 -0700)]
math/rand: improve NewZipf documentation

Change-Id: I78f0f9ac33db153c4a0d7f9866da20ebcd3d3639
Reviewed-on: https://go-review.googlesource.com/11872
Reviewed-by: Rob Pike <r@golang.org>
9 years agoimage/draw: fix double-draw when the dst is paletted.
Nigel Tao [Fri, 3 Jul 2015 01:34:18 +0000 (11:34 +1000)]
image/draw: fix double-draw when the dst is paletted.

The second (fallback) draw is a no-op, but it's a non-trivial amount of work.

Fixes #11550.

benchmark               old ns/op     new ns/op     delta
BenchmarkPaletted-4     16301219      7309568       -55.16%

Change-Id: Ic88c537b2b0c710cf517888f3dd15cb702dd142f
Reviewed-on: https://go-review.googlesource.com/11858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: finish the small library changes in go1.5.html; start work on tools
Rob Pike [Thu, 2 Jul 2015 02:56:51 +0000 (12:56 +1000)]
doc: finish the small library changes in go1.5.html; start work on tools

Also add words about the assembler.

Change-Id: I9bd8cc88076f06b0eef36a07f57d1ad5d9261d8d
Reviewed-on: https://go-review.googlesource.com/11853
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/trace: log errors to console in AJAX handler
Dmitry Vyukov [Thu, 2 Jul 2015 18:33:30 +0000 (20:33 +0200)]
cmd/trace: log errors to console in AJAX handler

Fixes #11508

Change-Id: I72e83893b76f75685d6edfe65ca6691d97539226
Reviewed-on: https://go-review.googlesource.com/11864
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoRevert "net, internal/syscall/unix: add SocketConn, SocketPacketConn"
Mikio Hara [Thu, 2 Jul 2015 06:02:03 +0000 (15:02 +0900)]
Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn"

This reverts commit 6f7961da28232c609f7c51b3bed7f15db7dd33e1.

Russ suggests changing the frozon syscall package and obviously it's a
better solution. Perhaps he will also let me know the way how to get the
project owners to agree later.

Fixes #11492.

Change-Id: I98f9f366b72b85db54b4acfc3a604b62fb6d783c
Reviewed-on: https://go-review.googlesource.com/11854
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomime/multipart: fix bug when body contains prefix of the boundary
Brad Fitzpatrick [Tue, 30 Jun 2015 23:50:36 +0000 (16:50 -0700)]
mime/multipart: fix bug when body contains prefix of the boundary

Fixes #10616

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

9 years agointernal/trace: add comment for stable sort
Dmitry Vyukov [Thu, 2 Jul 2015 12:35:23 +0000 (14:35 +0200)]
internal/trace: add comment for stable sort

As per comments in cl/11834.

Change-Id: I285536b882fa9496e15d77d0d4c16ee913aca581
Reviewed-on: https://go-review.googlesource.com/11861
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocrypto: fix non-sentence in documentation for Decrypter
Rob Pike [Thu, 2 Jul 2015 02:42:55 +0000 (12:42 +1000)]
crypto: fix non-sentence in documentation for Decrypter

Comment change only.

Change-Id: I2e32c2b34d5a5659ead6d6082b06e1b039bf1147
Reviewed-on: https://go-review.googlesource.com/11852
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agointernal/trace: stable sort events
Dmitry Vyukov [Wed, 1 Jul 2015 14:41:27 +0000 (16:41 +0200)]
internal/trace: stable sort events

On some VMs two events can happen at the same time. For examples:
179827399 GoStart p=2 g=11 off=936359 g=11
179827399 GoUnblock p=2 g=0 off=936355 g=11
If we do non-stable sort, the events can be reordered making the trace inconsistent.
Do stable sort instead.

Batches are dumped in FIFO order, so if these same-time events are split into
separate batches, stable sort still works.

Events on different CPUs go into different batches and can be reordered.
But the intention is that causally-related events on different CPUs
will have larger (non-zero) time diff.

Update #11320

Change-Id: Id1df96af41dff68ea1782ab4b23d5afd63b890c9
Reviewed-on: https://go-review.googlesource.com/11834
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agodoc: add most major changes and most net changes to go1.5.html
Rob Pike [Wed, 1 Jul 2015 05:49:40 +0000 (15:49 +1000)]
doc: add most major changes and most net changes to go1.5.html

Change-Id: Ied305480f22b60767c4628e5a31236ac01eafc86
Reviewed-on: https://go-review.googlesource.com/11825
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoencoding/xml: minor changes
Roger Peppe [Wed, 1 Jul 2015 08:22:43 +0000 (09:22 +0100)]
encoding/xml: minor changes

Changes suggested by Nigel Tao in https://go-review.googlesource.com/#/c/11635
after that had been submitted.

Change-Id: I7b28e1c8488c8565399a8017453dc7ff1fd215e8
Reviewed-on: https://go-review.googlesource.com/11832
Reviewed-by: Nigel Tao <nigeltao@golang.org>