]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agodoc/install.html: FreeBSD 8 and higher only are supported
Rob Pike [Tue, 15 Apr 2014 23:40:48 +0000 (16:40 -0700)]
doc/install.html: FreeBSD 8 and higher only are supported
Fixes #7188

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/88280044

11 years agodoc/asm.html: remove mention of 6l -a
Rob Pike [Tue, 15 Apr 2014 23:27:48 +0000 (16:27 -0700)]
doc/asm.html: remove mention of 6l -a
Also make it clear this is not a complete description of all features.
Fixes #7790.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/88300044

11 years agonet/http: skip TestTransportClosesBodyOnError on Plan 9
David du Colombier [Tue, 15 Apr 2014 22:48:21 +0000 (00:48 +0200)]
net/http: skip TestTransportClosesBodyOnError on Plan 9

LGTM=rsc
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/87800044

11 years agomath/big: fix doc typos.
Shenghou Ma [Tue, 15 Apr 2014 21:50:19 +0000 (14:50 -0700)]
math/big: fix doc typos.
Fixes #7768.

LGTM=iant, gri
R=golang-codereviews, iant, gri
CC=golang-codereviews
https://golang.org/cl/87260043

11 years agocmd/ld: attempt at fixing openbsd build
Russ Cox [Tue, 15 Apr 2014 19:52:23 +0000 (15:52 -0400)]
cmd/ld: attempt at fixing openbsd build

OpenBSD is excluded from all the usual thread-local storage
code, not just emitting the tbss section in the external link .o
but emitting a PT_TLS section in an internally-linked executable.
I assume it just has no proper TLS support. Exclude it here too.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/87900045

11 years agobuild: disable static cgo linking test on netbsd
Russ Cox [Tue, 15 Apr 2014 19:52:02 +0000 (15:52 -0400)]
build: disable static cgo linking test on netbsd

We get
/usr/lib/libc.a(stack_protector.o): In function `__stack_chk_fail_local':
stack_protector.c:(.text+0x158): multiple definition of `__stack_chk_fail_local'
/var/tmp/go-link-04838a/000001.o:/tmp/gobuilder/netbsd-386-minux-c7a9e9243878/go/src/pkg/runtime/cgo/gcc_386.S:41: first defined here

I am assuming this has never worked and possibly is not intended to work.
(Some systems are vehemently against static linking.)

TBR=iant
CC=golang-codereviews
https://golang.org/cl/88130046

11 years agocmd/ld: use TLS relocations on ELF systems in external linking mode
Russ Cox [Tue, 15 Apr 2014 19:13:52 +0000 (12:13 -0700)]
cmd/ld: use TLS relocations on ELF systems in external linking mode

Fixes #7719.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/87760050

11 years agoliblink: introduce TLS register on 386 and amd64
Russ Cox [Tue, 15 Apr 2014 17:45:39 +0000 (13:45 -0400)]
liblink: introduce TLS register on 386 and amd64

When I did the original 386 ports on Linux and OS X, I chose to
define GS-relative expressions like 4(GS) as relative to the actual
thread-local storage base, which was usually GS but might not be
(it might be FS, or it might be a different constant offset from GS or FS).

The original scope was limited but since then the rewrites have
gotten out of control. Sometimes GS is rewritten, sometimes FS.
Some ports do other rewrites to enable shared libraries and
other linking. At no point in the code is it clear whether you are
looking at the real GS/FS or some synthesized thing that will be
rewritten. The code manipulating all these is duplicated in many
places.

The first step to fixing issue 7719 is to make the code intelligible
again.

This CL adds an explicit TLS pseudo-register to the 386 and amd64.
As a register, TLS refers to the thread-local storage base, and it
can only be loaded into another register:

        MOVQ TLS, AX

An offset from the thread-local storage base is written off(reg)(TLS*1).
Semantically it is off(reg), but the (TLS*1) annotation marks this as
indexing from the loaded TLS base. This emits a relocation so that
if the linker needs to adjust the offset, it can. For example:

        MOVQ TLS, AX
        MOVQ 8(AX)(TLS*1), CX // load m into CX

On systems that support direct access to the TLS memory, this
pair of instructions can be reduced to a direct TLS memory reference:

        MOVQ 8(TLS), CX // load m into CX

The 2-instruction and 1-instruction forms correspond roughly to
ELF TLS initial exec mode and ELF TLS local exec mode, respectively.

Liblink applies this rewrite on systems that support the 1-instruction form.
The decision is made using only the operating system (and probably
the -shared flag, eventually), not the link mode. If some link modes
on a particular operating system require the 2-instruction form,
then all builds for that operating system will use the 2-instruction
form, so that the link mode decision can be delayed to link time.

Obviously it is late to be making changes like this, but I despair
of correcting issue 7719 and issue 7164 without it. To make sure
I am not changing existing behavior, I built a "hello world" program
for every GOOS/GOARCH combination we have and then worked
to make sure that the rewrite generates exactly the same binaries,
byte for byte. There are a handful of TODOs in the code marking
kludges to get the byte-for-byte property, but at least now I can
explain exactly how each binary is handled.

The targets I tested this way are:

        darwin-386
        darwin-amd64
        dragonfly-386
        dragonfly-amd64
        freebsd-386
        freebsd-amd64
        freebsd-arm
        linux-386
        linux-amd64
        linux-arm
        nacl-386
        nacl-amd64p32
        netbsd-386
        netbsd-amd64
        openbsd-386
        openbsd-amd64
        plan9-386
        plan9-amd64
        solaris-amd64
        windows-386
        windows-amd64

There were four exceptions to the byte-for-byte goal:

windows-386 and windows-amd64 have a time stamp
at bytes 137 and 138 of the header.

darwin-386 and plan9-386 have five or six modified
bytes in the middle of the Go symbol table, caused by
editing comments in runtime/sys_{darwin,plan9}_386.s.

Fixes #7164.

LGTM=iant
R=iant, aram, minux.ma, dave
CC=golang-codereviews
https://golang.org/cl/87920043

11 years agotext/template: say more often that templates are safe for parallel execution
Rob Pike [Tue, 15 Apr 2014 15:48:40 +0000 (08:48 -0700)]
text/template: say more often that templates are safe for parallel execution
It was said already but apparently not enough times.

Fixes #6985.

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/86300043

11 years agoruntime: fix program termination when main goroutine calls Goexit
Dmitriy Vyukov [Tue, 15 Apr 2014 15:48:17 +0000 (19:48 +0400)]
runtime: fix program termination when main goroutine calls Goexit
Do not consider idle finalizer/bgsweep/timer goroutines as doing something useful.
We can't simply set isbackground for the whole lifetime of the goroutines,
because when finalizer goroutine calls user function, we do want to consider it
as doing something useful.
This is borken due to timers for quite some time.
With background sweep is become even more broken.
Fixes #7784.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87960044

11 years agocmd/dist: use GOHOSTARCH/GOHOSTOS instead of GOOS/GOARCH for host libraries and binaries
Jan Ziak [Tue, 15 Apr 2014 06:46:21 +0000 (08:46 +0200)]
cmd/dist: use GOHOSTARCH/GOHOSTOS instead of GOOS/GOARCH for host libraries and binaries

Fixes #6559

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/81330045

11 years agoos/exec: quiet distracting log output during test
Brad Fitzpatrick [Tue, 15 Apr 2014 00:20:30 +0000 (17:20 -0700)]
os/exec: quiet distracting log output during test

TLS handshake failures didn't use to log, but do in Go 1.3.
Shut it up so the actual failure can be seen in e.g.
http://build.golang.org/log/ede7e12362a941d93bf1fe21db9208a3e298029e

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/87870043

11 years agoundo CL 87300043 / 1dc800571456
Andrew Gerrand [Tue, 15 Apr 2014 00:20:04 +0000 (10:20 +1000)]
undo CL 87300043 / 1dc800571456

This breaks "go get -d repo/path/...".

««« original CL description
cmd/go: do not miss an error if import path contains "cmd/something"

Fixes #7638

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87300043
»»»

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/87890043

11 years agonet/http: clarify Response.Body Close responsibility
Brad Fitzpatrick [Mon, 14 Apr 2014 23:50:03 +0000 (16:50 -0700)]
net/http: clarify Response.Body Close responsibility

Per TODO email in my inbox.

LGTM=rsc
R=golang-codereviews, rsc
CC=adg, dsymonds, golang-codereviews, r
https://golang.org/cl/87550045

11 years agodoc: simplify a go1.3 change description
Brad Fitzpatrick [Mon, 14 Apr 2014 23:28:52 +0000 (16:28 -0700)]
doc: simplify a go1.3 change description

LGTM=r
R=rsc, r
CC=golang-codereviews
https://golang.org/cl/87750043

11 years agocrypto/x509: fix Windows build.
Adam Langley [Mon, 14 Apr 2014 20:23:58 +0000 (13:23 -0700)]
crypto/x509: fix Windows build.

Windows is building a chain to the AddTrust root which is different
from the native Go code and causing a build failure.

This change alters the test so that both should build to the AddTrust
root.

R=bradfitz

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/87570044

11 years agodoc/help.html: fix typo in word order
Andrew Szeto [Mon, 14 Apr 2014 20:03:03 +0000 (13:03 -0700)]
doc/help.html: fix typo in word order

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/87460043

11 years agocmd/go: do not miss an error if import path contains "cmd/something"
Jan Ziak [Mon, 14 Apr 2014 20:01:27 +0000 (22:01 +0200)]
cmd/go: do not miss an error if import path contains "cmd/something"

Fixes #7638

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87300043

11 years agoA+C: Andrew Szeto (individual CLA)
Brad Fitzpatrick [Mon, 14 Apr 2014 20:00:41 +0000 (13:00 -0700)]
A+C: Andrew Szeto (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/86960046

11 years agoliblink: remove arch-specific constants from file format
Russ Cox [Mon, 14 Apr 2014 19:54:20 +0000 (15:54 -0400)]
liblink: remove arch-specific constants from file format

The relocation and automatic variable types were using
arch-specific numbers. Introduce portable enumerations
instead.

To the best of my knowledge, these are the only arch-specific
bits left in the new object file format.

Remove now, before Go 1.3, because file formats are forever.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/87670044

11 years agocrypto/x509: support SHA-512 by default.
Adam Langley [Mon, 14 Apr 2014 19:12:06 +0000 (12:12 -0700)]
crypto/x509: support SHA-512 by default.

Comodo are now using a SHA-384 signed intermediate. The crypto/x509
package seeks to import hash functions needed for typical operation
without needing to import every hash function possible. Since a SHA-384
certificate is being used by Comodo, crypto/sha512 now appears to fall
into the scope of "typical operation".

R=bradfitz

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/87670045

11 years agonet/http: make race detector happy for recently-added test
Brad Fitzpatrick [Mon, 14 Apr 2014 19:08:32 +0000 (12:08 -0700)]
net/http: make race detector happy for recently-added test

Update #7264

Races:
http://build.golang.org/log/a2e401fdcd4903a61a3375bff5da702a20ddafad
http://build.golang.org/log/ec4c69e92076a747ac6d5df7eb7b382b31ab3d43

I think this is the first time I've actually seen a manifestation
of Issue 7264, and one that I can reproduce.

I don't know why it triggers on this test and not any others
just like it, or why I can't reproduce Issue 7264
independently, even when Dmitry gives me minimal repros.

Work around it for now with some synchronization to make the
race detector happy.

The proper fix will probably be in net/http/httptest itself, not
in all hundred some tests.

LGTM=rsc
R=rsc
CC=dvyukov, golang-codereviews
https://golang.org/cl/87640043

11 years agoA+C: Guillaume J. Charmes (individual CLA)
Ian Lance Taylor [Mon, 14 Apr 2014 18:26:22 +0000 (11:26 -0700)]
A+C: Guillaume J. Charmes (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/87650044

11 years agoliblink, cmd/link: add version number to object file
Russ Cox [Mon, 14 Apr 2014 17:20:51 +0000 (13:20 -0400)]
liblink, cmd/link: add version number to object file

There are changes we know we want to make, but not before Go 1.3
Add a version number so that we can make them more easily later.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/87670043

11 years agodoc: add go1.3 note about the http Transport closing Request.Body
Brad Fitzpatrick [Mon, 14 Apr 2014 17:19:10 +0000 (10:19 -0700)]
doc: add go1.3 note about the http Transport closing Request.Body

LGTM=rsc
R=rsc, r
CC=golang-codereviews
https://golang.org/cl/87620043

11 years agosync: less agressive local caching in Pool
Dmitriy Vyukov [Mon, 14 Apr 2014 17:13:32 +0000 (21:13 +0400)]
sync: less agressive local caching in Pool
Currently Pool can cache up to 15 elements per P, and these elements are not accesible to other Ps.
If a Pool caches large objects, say 2MB, and GOMAXPROCS is set to a large value, say 32,
then the Pool can waste up to 960MB.
The new caching policy caches at most 1 per-P element, the rest is shared between Ps.

Get/Put performance is unchanged. Nested Get/Put performance is 57% worse.
However, overall scalability of nested Get/Put is significantly improved,
so the new policy starts winning under contention.

benchmark                     old ns/op     new ns/op     delta
BenchmarkPool                 27.4          26.7          -2.55%
BenchmarkPool-4               6.63          6.59          -0.60%
BenchmarkPool-16              1.98          1.87          -5.56%
BenchmarkPool-64              1.93          1.86          -3.63%
BenchmarkPoolOverlflow        3970          6235          +57.05%
BenchmarkPoolOverlflow-4      10935         1668          -84.75%
BenchmarkPoolOverlflow-16     13419         520           -96.12%
BenchmarkPoolOverlflow-64     10295         380           -96.31%

LGTM=rsc
R=rsc
CC=golang-codereviews, khr
https://golang.org/cl/86020043

11 years agolibbio: add casts to eliminate -Wconversion warning
Ian Lance Taylor [Mon, 14 Apr 2014 16:36:47 +0000 (09:36 -0700)]
libbio: add casts to eliminate -Wconversion warning

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/87140044

11 years agocmd/dist: mark cmd/link and debug/goobj as unreleased
Russ Cox [Mon, 14 Apr 2014 16:33:51 +0000 (12:33 -0400)]
cmd/dist: mark cmd/link and debug/goobj as unreleased

These are not ready and will not be in Go 1.3.

Fixes #6932.

LGTM=bradfitz
R=golang-codereviews, bradfitz, minux.ma
CC=golang-codereviews, iant, r
https://golang.org/cl/87630043

11 years agocmd/prof, libmach: delete
Russ Cox [Mon, 14 Apr 2014 15:09:25 +0000 (11:09 -0400)]
cmd/prof, libmach: delete

We have never released cmd/prof and don't plan to.
Now that nm, addr2line, and objdump have been rewritten in Go,
cmd/prof is the only thing keeping us from deleting libmach.

Delete cmd/prof, and then since nothing is using libmach, delete libmach.

13,000 lines of C deleted.

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews, iant, r
https://golang.org/cl/87020044

11 years agonet/http: close Body in client code always, even on errors, and document
Brad Fitzpatrick [Mon, 14 Apr 2014 15:06:13 +0000 (08:06 -0700)]
net/http: close Body in client code always, even on errors, and document

Fixes #6981

LGTM=rsc
R=golang-codereviews, nightlyone
CC=adg, dsymonds, golang-codereviews, rsc
https://golang.org/cl/85560045

11 years agocmd/objdump: rewrite in Go
Russ Cox [Mon, 14 Apr 2014 14:58:49 +0000 (10:58 -0400)]
cmd/objdump: rewrite in Go

Update cmd/dist not to build the C version.
Update cmd/go to install the Go version to the tool directory.

Update #7452

This is the basic logic needed for objdump, and it works well enough
to support the pprof list and weblist commands. A real disassembler
needs to be added in order to support the pprof disasm command
and the per-line assembly displays in weblist. That's still to come.

Probably objdump will move to go.tools when the disassembler
is added, but it can stay here for now.

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews, iant, r
https://golang.org/cl/87580043

11 years agoundo CL 66510044 / 6c0339d94123
Russ Cox [Mon, 14 Apr 2014 13:48:11 +0000 (09:48 -0400)]
undo CL 66510044 / 6c0339d94123

Broke other things - see issue 7522.

Fixes #7522.
Reopens issue 7363.

««« original CL description
cmd/gc: make embedded, unexported fields read-only.

Fixes #7363.

LGTM=gri
R=gri, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/66510044
»»»

LGTM=r, mpvl
R=golang-codereviews, r
CC=golang-codereviews, iant, mpvl
https://golang.org/cl/85580046

11 years agoruntime: increase timeout in TestStackGrowth
Russ Cox [Mon, 14 Apr 2014 00:19:10 +0000 (20:19 -0400)]
runtime: increase timeout in TestStackGrowth

It looks like maybe on slower builders 4 seconds is not enough.
Trying to get rid of the flaky failures.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/86870044

11 years agodoc/go1.3.html: windows NewCallbackCDecl
Rob Pike [Sat, 12 Apr 2014 04:56:17 +0000 (14:56 +1000)]
doc/go1.3.html: windows NewCallbackCDecl

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews
https://golang.org/cl/87250043

11 years agoC: add Yan Zou (Google CLA).
Adam Langley [Fri, 11 Apr 2014 17:11:21 +0000 (10:11 -0700)]
C: add Yan Zou (Google CLA).

R=adg

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/86930043

11 years agonet/http: quiet useless warning during shutdown
Brad Fitzpatrick [Fri, 11 Apr 2014 16:40:36 +0000 (09:40 -0700)]
net/http: quiet useless warning during shutdown

What was happening on Issue 7010 was handler intentionally took 30
milliseconds and the proxy's client timeout was 35 milliseconds. Then it
slammed the proxy with a bunch of requests.

Sometimes the server would be too slow to respond in its 5 millisecond
window and the client code would cancel the request, force-closing the
persistConn.  If this came at the right time, the server's reply was
already in flight, and one of the goroutines would report:

Unsolicited response received on idle HTTP channel starting with "H"; err=<nil>

... rightfully scaring the user.

But the error was already handled and returned to the user, and this
connection knows it's been shut down. So look at the closed flag after
acquiring the same mutex guarding another field we were checking, and
don't complain if it's a known shutdown.

Also move closed down below the mutex which guards it.

Fixes #7010

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=adg, golang-codereviews, rsc
https://golang.org/cl/86740044

11 years agocmd/gc: increase specificity of errors in function call context
Jan Ziak [Fri, 11 Apr 2014 13:57:30 +0000 (15:57 +0200)]
cmd/gc: increase specificity of errors in function call context

Fixes #7129

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/86470044

11 years agocmd/gc: fix typo in ordermapassign
Jan Ziak [Fri, 11 Apr 2014 13:28:37 +0000 (15:28 +0200)]
cmd/gc: fix typo in ordermapassign

Fixes #7742

LGTM=dave, rsc
R=rsc, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/85580047

11 years agonet/http/httptest: add test for issue 7264
Dmitriy Vyukov [Fri, 11 Apr 2014 09:01:10 +0000 (13:01 +0400)]
net/http/httptest: add test for issue 7264
The test fails now with -race, so it's disabled.
The intention is that the fix for issue 7264
will also modify this test the same way and enable it.
Reporduce with 'go test -race -issue7264 -cpu=4'.
Update #7264

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/86770043

11 years agoos/signal: use unique program name during TestCtrlBreak
Alex Brainman [Fri, 11 Apr 2014 06:43:36 +0000 (16:43 +1000)]
os/signal: use unique program name during TestCtrlBreak

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/84650047

11 years agonet/http: Return ErrNotMultipart from ParseMultipartForm if content-type isn't multip...
Matthew Cottingham [Fri, 11 Apr 2014 05:50:04 +0000 (22:50 -0700)]
net/http: Return ErrNotMultipart from ParseMultipartForm if content-type isn't multipart/form-data.

Add test for multipart form requests with an invalid content-type to ensure
ErrNotMultipart is returned.

Change ParseMultipartForm to return ErrNotMultipart when it is returned by multipartReader.

Modify test for empty multipart request handling to use POST so that the body is checked.

Fixes #6334.

This is the first changeset working on multipart request handling. Further changesets
could add more tests and clean up the TODO.

LGTM=bradfitz
R=golang-codereviews, gobot, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/44040043

11 years agonet/http: don't reject 0-lengthed bodies with Expect 100-continue
Brad Fitzpatrick [Fri, 11 Apr 2014 05:25:31 +0000 (22:25 -0700)]
net/http: don't reject 0-lengthed bodies with Expect 100-continue

I was implementing rules from RFC 2616. The rules are apparently useless,
ambiguous, and too strict for common software on the Internet. (e.g. curl)

Add more tests, including a test of a chunked request.

Fixes #7625

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=adg, golang-codereviews, rsc
https://golang.org/cl/84480045

11 years agoflag: remove extra space in error message
Rui Ueyama [Fri, 11 Apr 2014 05:15:55 +0000 (22:15 -0700)]
flag: remove extra space in error message

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/86420046

11 years agobufio: fix potential endless loop in ReadByte
Robert Griesemer [Fri, 11 Apr 2014 04:46:00 +0000 (21:46 -0700)]
bufio: fix potential endless loop in ReadByte

Also: Simplify ReadSlice implementation and
ensure that it doesn't call fill() with a full
buffer (this caused a failure in net/textproto
TestLargeReadMIMEHeader because fill() wasn't able
to read more data).

Fixes #7745.

LGTM=bradfitz
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/86590043

11 years agobytes, strings: more consistent error messages
Robert Griesemer [Fri, 11 Apr 2014 04:45:41 +0000 (21:45 -0700)]
bytes, strings: more consistent error messages

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/86060044

11 years agofmt: fix typo in help doc
Rui Ueyama [Fri, 11 Apr 2014 04:14:51 +0000 (21:14 -0700)]
fmt: fix typo in help doc

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/86600045

11 years agoexpvar: fix map key output
Rui Ueyama [Fri, 11 Apr 2014 04:14:04 +0000 (21:14 -0700)]
expvar: fix map key output

To create a valid JSON string, "%s" is not enough.
Fixes #7761.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/86730043

11 years agoruntime: make stack growth test shorter
Russ Cox [Fri, 11 Apr 2014 04:08:07 +0000 (00:08 -0400)]
runtime: make stack growth test shorter

It runs too long in -short mode.

Disable the one in init, because it doesn't respect -short.

Make the part that claims to test execution in a finalizer
actually execute the test in the finalizer.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=aram.h, golang-codereviews, iant, khr
https://golang.org/cl/86550045

11 years agonet/http: fix up Response.Write edge cases
Brad Fitzpatrick [Fri, 11 Apr 2014 00:12:31 +0000 (17:12 -0700)]
net/http: fix up Response.Write edge cases

The Go HTTP server doesn't use Response.Write, but others do,
so make it correct. Add a bunch more tests.

This bug is almost a year old. :/

Fixes #5381

LGTM=adg
R=golang-codereviews, adg
CC=dsymonds, golang-codereviews, rsc
https://golang.org/cl/85740046

11 years agonet/http: document, test, define, clean up Request.Trailer
Brad Fitzpatrick [Fri, 11 Apr 2014 00:01:21 +0000 (17:01 -0700)]
net/http: document, test, define, clean up Request.Trailer

Go's had pretty decent HTTP Trailer support for a long time, but
the docs have been largely non-existent. Fix that.

In the process, re-learn the Trailer code, clean some stuff
up, add some error checks, remove some TODOs, fix a minor bug
or two, and add tests.

LGTM=adg
R=golang-codereviews, adg
CC=dsymonds, golang-codereviews, rsc
https://golang.org/cl/86660043

11 years agodoc/go1.3.html: fix spelling mistakes
Rob Pike [Thu, 10 Apr 2014 22:52:16 +0000 (08:52 +1000)]
doc/go1.3.html: fix spelling mistakes
Keep those builders busy.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/85710046

11 years agobytes, strings: add Reader.ReadAt race tests
Brad Fitzpatrick [Thu, 10 Apr 2014 22:46:07 +0000 (15:46 -0700)]
bytes, strings: add Reader.ReadAt race tests

Tests for the race detector to catch anybody
trying to mutate Reader in ReadAt.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/86700043

11 years agodoc: finish net/http notes in go1.3.html
Brad Fitzpatrick [Thu, 10 Apr 2014 22:09:59 +0000 (15:09 -0700)]
doc: finish net/http notes in go1.3.html

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/86580043

11 years agonet/http: fix requests failing on short gzip body
Alexey Borzenkov [Thu, 10 Apr 2014 21:12:36 +0000 (14:12 -0700)]
net/http: fix requests failing on short gzip body

Fixes #7750.

LGTM=bradfitz
R=golang-codereviews, ibilicc, bradfitz
CC=golang-codereviews
https://golang.org/cl/84850043

11 years agoruntime: make times in GODEBUG=gctrace=1 output clearer
Russ Cox [Thu, 10 Apr 2014 18:34:48 +0000 (14:34 -0400)]
runtime: make times in GODEBUG=gctrace=1 output clearer

TBR=0intro
CC=golang-codereviews
https://golang.org/cl/86620043

11 years agocmd/6g: nacl: zero odd multiple of widthptr correctly
Keith Randall [Thu, 10 Apr 2014 14:59:46 +0000 (07:59 -0700)]
cmd/6g: nacl: zero odd multiple of widthptr correctly

LGTM=iant
R=remyoudompheng, iant
CC=golang-codereviews
https://golang.org/cl/86270043

11 years agosync: fix spurious wakeup from WaitGroup.Wait
Rui Ueyama [Thu, 10 Apr 2014 14:44:44 +0000 (18:44 +0400)]
sync: fix spurious wakeup from WaitGroup.Wait

There is a race condition that causes spurious wakeup from Wait
in the following case:

 G1: decrement wg.counter, observe the counter is now 0
     (should unblock goroutines queued *at this moment*)
 G2: increment wg.counter
 G2: call Wait() to add itself to the wait queue
 G1: acquire wg.m, unblock all waiting goroutines

In the last step G2 is spuriously woken up by G1.
Fixes #7734.

LGTM=rsc, dvyukov
R=dvyukov, 0xjnml, rsc
CC=golang-codereviews
https://golang.org/cl/85580043

11 years agonet/http: don't reuse Transport connection unless Request.Write finished
Brad Fitzpatrick [Thu, 10 Apr 2014 04:50:24 +0000 (21:50 -0700)]
net/http: don't reuse Transport connection unless Request.Write finished

In a typical HTTP request, the client writes the request, and
then the server replies. Go's HTTP client code (Transport) has
two goroutines per connection: one writing, and one reading. A
third goroutine (the one initiating the HTTP request)
coordinates with those two.

Because most HTTP requests are done when the server replies,
the Go code has always handled connection reuse purely in the
readLoop goroutine.

But if a client is writing a large request and the server
replies before it's consumed the entire request (e.g. it
replied with a 403 Forbidden and had no use for the body), it
was possible for Go to re-select that connection for a
subsequent request before we were done writing the first. That
wasn't actually a data race; the second HTTP request would
just get enqueued to write its request on the writeLoop. But
because the previous writeLoop didn't finish writing (and
might not ever), that connection is in a weird state. We
really just don't want to get into a state where we're
re-using a connection when the server spoke out of turn.

This CL changes the readLoop goroutine to verify that the
writeLoop finished before returning the connection.

In the process, it also fixes a potential goroutine leak where
a connection could close but the recycling logic could be
blocked forever waiting for the client to read to EOF or
error. Now it also selects on the persistConn's close channel,
and the closer of that is no longer the readLoop (which was
dead locking in some cases before). It's now closed at the
same place the underlying net.Conn is closed. This likely fixes
or helps Issue 7620.

Also addressed some small cosmetic things in the process.

Update #7620
Fixes #7569

LGTM=adg
R=golang-codereviews, adg
CC=dsymonds, golang-codereviews, rsc
https://golang.org/cl/86290043

11 years agoruntime: no longer skip stack growth test in short mode
David du Colombier [Thu, 10 Apr 2014 04:37:30 +0000 (06:37 +0200)]
runtime: no longer skip stack growth test in short mode

We originally decided to skip this test in short mode
to prevent the parallel runtime test to timeout on the
Plan 9 builder. This should no longer be required since
the issue was fixed in CL 86210043.

LGTM=dave, bradfitz
R=dvyukov, dave, bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/84790044

11 years agoruntime: fix semasleep on Plan 9
David du Colombier [Thu, 10 Apr 2014 04:36:20 +0000 (06:36 +0200)]
runtime: fix semasleep on Plan 9

If you pass ns = 100,000 to this function, timediv will
return ms = 0. tsemacquire in /sys/src/9/port/sysproc.c
will return immediately when ms == 0 and the semaphore
cannot be acquired immediately - it doesn't sleep - so
notetsleep will spin, chewing cpu and repeatedly reading
the time, until the 100us have passed.

Thanks to the time reads it won't take too many iterations,
but whatever we are waiting for does not get a chance to
run. Eventually the notetsleep spin loop returns and we
end up in the stoptheworld spin loop - actually a sleep
loop but we're not doing a good job of sleeping.

After 100ms or so of this, the kernel says enough and
schedules a different thread. That thread manages to do
whatever we're waiting for, and the spinning in the other
thread stops. If tsemacquire had actually slept, this
would have happened much quicker.

Many thanks to Russ Cox for help debugging.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/86210043

11 years agodoc/go1.3.html: minor changes: crypto, net
Rob Pike [Thu, 10 Apr 2014 04:17:48 +0000 (14:17 +1000)]
doc/go1.3.html: minor changes: crypto, net
All that's left is net/http and the stuff I need help describing: FreeBSD and Windows.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/86320043

11 years agocmd/go: always build package during "go test" command
Alex Brainman [Thu, 10 Apr 2014 04:02:24 +0000 (14:02 +1000)]
cmd/go: always build package during "go test" command

even when there are no *_test.go files present.
rsc suggested this change

Fixes #7108

LGTM=r, adg
R=golang-codereviews, r, adg
CC=golang-codereviews
https://golang.org/cl/84300043

11 years agosyscall: fix Getfsstat() for BSD
Preetam Jinka [Thu, 10 Apr 2014 03:58:03 +0000 (13:58 +1000)]
syscall: fix Getfsstat() for BSD

The buffer length should be the size in bytes
instead of the number of structs.

Fixes #6588.

LGTM=mikioh.mikioh
R=golang-codereviews, mikioh.mikioh, adg
CC=golang-codereviews
https://golang.org/cl/84830043

11 years agoA+C: Preetam Jinka (individual CLA)
Andrew Gerrand [Thu, 10 Apr 2014 03:33:32 +0000 (13:33 +1000)]
A+C: Preetam Jinka (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/85550044

11 years agoundo CL 86220044 / 41388e58be65
Robert Griesemer [Thu, 10 Apr 2014 01:23:53 +0000 (18:23 -0700)]
undo CL 86220044 / 41388e58be65

bufio: undo incorrect bug fix

««« original CL description
bufio: fix potential endless loop in ReadByte

Fixes #7745.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/86220044
»»»

LGTM=adg
R=r, adg
CC=golang-codereviews
https://golang.org/cl/85550045

11 years agobufio: fix potential endless loop in ReadByte
Robert Griesemer [Thu, 10 Apr 2014 00:53:09 +0000 (17:53 -0700)]
bufio: fix potential endless loop in ReadByte

Fixes #7745.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/86220044

11 years agobufio: fix UnreadByte
Robert Griesemer [Wed, 9 Apr 2014 21:19:13 +0000 (14:19 -0700)]
bufio: fix UnreadByte

Also:
- fix error messages in tests
- make tests more symmetric

Fixes #7607.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/86180043

11 years agosync.Pool: better documentation
Rob Pike [Wed, 9 Apr 2014 19:45:18 +0000 (05:45 +1000)]
sync.Pool: better documentation
Explain what its purpose is and give examples of good and bad use.
Fixes #7167.

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/85880044

11 years agocmd/6g: relax constraint on variables that need zeroing.
Rémy Oudompheng [Wed, 9 Apr 2014 19:23:36 +0000 (21:23 +0200)]
cmd/6g: relax constraint on variables that need zeroing.

On amd64p32 pointers are 32-bit-aligned and cannot be assumed to
have an offset multiple of widthreg. Instead check that they are
withptr-aligned.

Also change the threshold for region merging to 2*widthreg
instead of 2*widthptr because performance on amd64 and amd64p32
is expected to be the same.

Fixes #7712.

LGTM=khr
R=rsc, dave, khr, brad, bradfitz
CC=golang-codereviews
https://golang.org/cl/84690044

11 years agomisc/emacs: ignore backquote in comment or string
Rui Ueyama [Wed, 9 Apr 2014 16:28:27 +0000 (12:28 -0400)]
misc/emacs: ignore backquote in comment or string

go-mode on Emacs 23 wrongly recognizes a backquote in a comment or
a string as a start of a raw string literal. Below is an example
that go-mode does not work well. This patch is to fix that issue.

  // `
  var x = 1
  // `

LGTM=dominik.honnef
R=golang-codereviews, dominik.honnef, adonovan
CC=golang-codereviews
https://golang.org/cl/84900043

11 years agoruntime: use 3x fewer nanotime calls in garbage collection
Russ Cox [Wed, 9 Apr 2014 14:38:12 +0000 (10:38 -0400)]
runtime: use 3x fewer nanotime calls in garbage collection

Cuts the number of calls from 6 to 2 in the non-debug case.

LGTM=iant
R=golang-codereviews, iant
CC=0intro, aram, golang-codereviews, khr
https://golang.org/cl/86040043

11 years agodoc: tweak Solaris wording
Russ Cox [Wed, 9 Apr 2014 14:08:35 +0000 (10:08 -0400)]
doc: tweak Solaris wording

Suggested in comments on CL 85740043.

LGTM=aram
R=golang-codereviews, aram
CC=dave, golang-codereviews, r
https://golang.org/cl/85990044

11 years agoruntime: fix flaky linux/386 build
Russ Cox [Wed, 9 Apr 2014 14:02:55 +0000 (10:02 -0400)]
runtime: fix flaky linux/386 build

TBR=iant
CC=golang-codereviews
https://golang.org/cl/86030043

11 years agocmd/gc: drop { } around single-line if-statement body
Jan Ziak [Wed, 9 Apr 2014 13:39:28 +0000 (15:39 +0200)]
cmd/gc: drop { } around single-line if-statement body

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/85890043

11 years agocmd/gc: avoid confusing error message "ovf in mpaddxx"
Jan Ziak [Wed, 9 Apr 2014 06:36:27 +0000 (08:36 +0200)]
cmd/gc: avoid confusing error message "ovf in mpaddxx"

Fixes #6889

LGTM=rsc
R=gri, rsc
CC=golang-codereviews
https://golang.org/cl/85080044

11 years agocmd/gc: ignore blank (_) labels in label declarations
Jan Ziak [Wed, 9 Apr 2014 06:34:17 +0000 (08:34 +0200)]
cmd/gc: ignore blank (_) labels in label declarations

Fixes #7538

LGTM=rsc
R=gri, rsc
CC=golang-codereviews
https://golang.org/cl/85040045

11 years agohtml/template: fix two unrelated bugs
Rob Pike [Wed, 9 Apr 2014 05:57:50 +0000 (15:57 +1000)]
html/template: fix two unrelated bugs
1) The code to catch an exception marked the template as escaped
when it was not yet, which caused subsequent executions of the
template to not escape properly.
2) ensurePipelineContains needs to handled Field as well as
Identifier nodes.

Fixes #7379.

LGTM=mikesamuel
R=mikesamuel
CC=golang-codereviews
https://golang.org/cl/85240043

11 years agodoc/go1.3.html: go command, major library changes
Rob Pike [Wed, 9 Apr 2014 05:20:00 +0000 (15:20 +1000)]
doc/go1.3.html: go command, major library changes

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/85840043

11 years agoruntime: fix GOTRACEBACK on Plan 9
David du Colombier [Wed, 9 Apr 2014 04:41:14 +0000 (06:41 +0200)]
runtime: fix GOTRACEBACK on Plan 9

Getenv() should not call malloc when called from
gotraceback(). Instead, we return a static buffer
in this case, with enough room to hold the longest
value.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/85680043

11 years agodoc/go1.3.html: gc precision, nacl, solaris
Rob Pike [Wed, 9 Apr 2014 02:47:35 +0000 (12:47 +1000)]
doc/go1.3.html: gc precision, nacl, solaris

LGTM=rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/85740043

11 years agodoc: add a couple net/http go1.3 items
Brad Fitzpatrick [Wed, 9 Apr 2014 02:46:33 +0000 (19:46 -0700)]
doc: add a couple net/http go1.3 items

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/85760043

11 years agoruntime: cache gotraceback setting
Russ Cox [Wed, 9 Apr 2014 02:35:41 +0000 (22:35 -0400)]
runtime: cache gotraceback setting

On Plan 9 gotraceback calls getenv calls malloc, and we gotraceback
on every call to gentraceback, which happens during garbage collection.
Honestly I don't even know how this works on Plan 9.
I suspect it does not, and that we are getting by because
no one has tried to run with $GOTRACEBACK set at all.

This will speed up all the other systems by epsilon, since they
won't call getenv and atoi repeatedly.

LGTM=bradfitz
R=golang-codereviews, bradfitz, 0intro
CC=golang-codereviews
https://golang.org/cl/85430046

11 years agocmd/go: allow use of Context in 'go list -f'
Rick Arnold [Wed, 9 Apr 2014 02:35:29 +0000 (22:35 -0400)]
cmd/go: allow use of Context in 'go list -f'

Add a $Context variable to the template so that the build.Context values
such as BuildTags can be accessed.

Fixes #6666.

LGTM=adg, rsc
R=golang-codereviews, gobot, adg, rsc
CC=golang-codereviews
https://golang.org/cl/72770043

11 years agoreflect: fix variadic arg for funcs created by MakeFunc.
Carl Chatfield [Wed, 9 Apr 2014 02:35:23 +0000 (22:35 -0400)]
reflect: fix variadic arg for funcs created by MakeFunc.

Short circuit for calling values funcs by MakeFunc was placed
before variadic arg rearrangement code in reflect.call.
Fixes #7534.

LGTM=khr
R=golang-codereviews, bradfitz, khr, rsc
CC=golang-codereviews
https://golang.org/cl/75370043

11 years agoA+C: Carl Chatfield (individual CLA)
Russ Cox [Wed, 9 Apr 2014 02:35:15 +0000 (22:35 -0400)]
A+C: Carl Chatfield (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/85820043

11 years agodoc/go1.3.html: gccgo status
Rob Pike [Tue, 8 Apr 2014 23:45:39 +0000 (09:45 +1000)]
doc/go1.3.html: gccgo status

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/85720043

11 years agocrypto/(ec)dsa: use Fermat's inversion.
Adam Langley [Tue, 8 Apr 2014 23:32:48 +0000 (16:32 -0700)]
crypto/(ec)dsa: use Fermat's inversion.

Now that we have a constant-time P-256 implementation, it's worth
paying more attention elsewhere.

The inversion of k in (EC)DSA was using Euclid's algorithm which isn't
constant-time. This change switches to Fermat's algorithm, which is
much better. However, it's important to note that math/big itself isn't
constant time and is using a 4-bit window for exponentiation with
variable memory access patterns.

(Since math/big depends quite deeply on its values being in minimal (as
opposed to fixed-length) represetation, perhaps crypto/elliptic should
grow a constant-time implementation of exponentiation in the scalar
field.)

R=bradfitz
Fixes #7652.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/82740043

11 years agodoc/go1.3.html: linker, go command, miscellany
Rob Pike [Tue, 8 Apr 2014 22:19:35 +0000 (08:19 +1000)]
doc/go1.3.html: linker, go command, miscellany

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/85660043

11 years agodoc/go1.3.html: Performance, plus some library details
Rob Pike [Tue, 8 Apr 2014 21:12:20 +0000 (07:12 +1000)]
doc/go1.3.html: Performance, plus some library details

LGTM=dvyukov, iant, rsc
R=golang-codereviews, dvyukov, iant, rsc
CC=golang-codereviews
https://golang.org/cl/85250043

11 years agogo/doc: fix URL matched in ToHTML
Robert Griesemer [Tue, 8 Apr 2014 20:51:44 +0000 (13:51 -0700)]
go/doc: fix URL matched in ToHTML

Permit paired parentheses in URLs such as:

http://en.wikipedia.org/wiki/Camellia_(cipher)

Fixes #5043.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/85610043

11 years agoencoding/xml: unmarshal into interfaces
Josh Bleecher Snyder [Tue, 8 Apr 2014 18:55:12 +0000 (14:55 -0400)]
encoding/xml: unmarshal into interfaces

Fixes #6836.

LGTM=rsc
R=golang-codereviews, rsc, r, mike
CC=golang-codereviews
https://golang.org/cl/33140043

11 years agoencoding/xml: Makes XML Marshaler take into account XMLName field from anonymous...
Alexander Zhavnerchik [Tue, 8 Apr 2014 15:12:51 +0000 (11:12 -0400)]
encoding/xml: Makes XML Marshaler take into account XMLName field from anonymous field

Fixes #7614.

LGTM=rsc
R=golang-codereviews, r, rsc, dan.kortschak, applezinc
CC=golang-codereviews
https://golang.org/cl/79210044

11 years agoA+C: Alexander Zhavnerchik (individual CLA)
Russ Cox [Tue, 8 Apr 2014 15:12:46 +0000 (11:12 -0400)]
A+C: Alexander Zhavnerchik (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/85490043

11 years agoreflect, runtime: fix crash in GC due to reflect.call + precise GC
Russ Cox [Tue, 8 Apr 2014 15:11:35 +0000 (11:11 -0400)]
reflect, runtime: fix crash in GC due to reflect.call + precise GC

Given
        type Outer struct {
                *Inner
                ...
        }
the compiler generates the implementation of (*Outer).M dispatching to
the embedded Inner. The implementation is logically:
        func (p *Outer) M() {
                (p.Inner).M()
        }
but since the only change here is the replacement of one pointer
receiver with another, the actual generated code overwrites the
original receiver with the p.Inner pointer and then jumps to the M
method expecting the *Inner receiver.

During reflect.Value.Call, we create an argument frame and the
associated data structures to describe it to the garbage collector,
populate the frame, call reflect.call to run a function call using
that frame, and then copy the results back out of the frame. The
reflect.call function does a memmove of the frame structure onto the
stack (to set up the inputs), runs the call, and the memmoves the
stack back to the frame structure (to preserve the outputs).

Originally reflect.call did not distinguish inputs from outputs: both
memmoves were for the full stack frame. However, in the case where the
called function was one of these wrappers, the rewritten receiver is
almost certainly a different type than the original receiver. This is
not a problem on the stack, where we use the program counter to
determine the type information and understand that during (*Outer).M
the receiver is an *Outer while during (*Inner).M the receiver in the
same memory word is now an *Inner. But in the statically typed
argument frame created by reflect, the receiver is always an *Outer.
Copying the modified receiver pointer off the stack into the frame
will store an *Inner there, and then if a garbage collection happens
to scan that argument frame before it is discarded, it will scan the
*Inner memory as if it were an *Outer. If the two have different
memory layouts, the collection will intepret the memory incorrectly.

Fix by only copying back the results.

Fixes #7725.

LGTM=khr
R=khr
CC=dave, golang-codereviews
https://golang.org/cl/85180043

11 years agoruntime/race: more precise handling of channel synchronization
Dmitriy Vyukov [Tue, 8 Apr 2014 06:18:20 +0000 (10:18 +0400)]
runtime/race: more precise handling of channel synchronization
It turns out there is a relatively common pattern that relies on
inverted channel semaphore:

gate := make(chan bool, N)
for ... {
        // limit concurrency
        gate <- true
        go func() {
                foo(...)
                <-gate
        }()
}
// join all goroutines
for i := 0; i < N; i++ {
        gate <- true
}

So handle synchronization on inverted semaphores with cap>1.
Fixes #7718.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/84880046

11 years agoliblink: remove code that is never executed
Ian Lance Taylor [Tue, 8 Apr 2014 05:12:26 +0000 (22:12 -0700)]
liblink: remove code that is never executed

This code tests linkmode == LinkExternal but is only invoked
by the compiler/assembler, not the linker.

Update #7164

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/85080043

11 years agodoc/go1.3.html: drop support for windows 2000
Rob Pike [Tue, 8 Apr 2014 04:07:17 +0000 (14:07 +1000)]
doc/go1.3.html: drop support for windows 2000

LGTM=bradfitz, alex.brainman
R=golang-codereviews, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/85190043

11 years agoruntime: make sure associated defers are copyable before trying to copy a stack.
Keith Randall [Tue, 8 Apr 2014 00:40:00 +0000 (17:40 -0700)]
runtime: make sure associated defers are copyable before trying to copy a stack.

Defers generated from cgo lie to us about their argument layout.
Mark those defers as not copyable.

CL 83820043 contains an additional test for this code and should be
checked in (and enabled) after this change is in.

Fixes bug 7695.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/84740043

11 years agoruntime: fix heapdump bugs.
Keith Randall [Tue, 8 Apr 2014 00:35:44 +0000 (17:35 -0700)]
runtime: fix heapdump bugs.

Iterate the right number of times in arrays and channels.
Handle channels with zero-sized objects in them.
Output longer type names if we have them.
Compute argument offset correctly.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/82980043

11 years agonet: move error messages related to OpError into net.go
Mikio Hara [Mon, 7 Apr 2014 21:14:49 +0000 (06:14 +0900)]
net: move error messages related to OpError into net.go

Also makes ErrWriteToConnected more appropriate; it's used
not only UDPConn operations but UnixConn operations.

Update #4856

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/84800044