]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agonet: add test for protocol numbers lookup using internal information base
Mikio Hara [Thu, 22 Aug 2013 03:13:54 +0000 (12:13 +0900)]
net: add test for protocol numbers lookup using internal information base

Update #5344

R=alex.brainman
CC=golang-dev
https://golang.org/cl/12966046

11 years agonet: fix misspelled variable name (fixes windows build)
Alex Brainman [Thu, 22 Aug 2013 02:34:05 +0000 (12:34 +1000)]
net: fix misspelled variable name (fixes windows build)

R=golang-dev, adg
CC=golang-dev, mikioh.mikioh
https://golang.org/cl/12848047

11 years agonet: add minimal internet protocol number information base
Mikio Hara [Thu, 22 Aug 2013 01:33:37 +0000 (10:33 +0900)]
net: add minimal internet protocol number information base

This CL adds minimal information for supporting platforms that don't
have a complete list of internet protocol numbers.

Fixes #5344.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12898045

11 years agonet: remove redundant argument check from Dial on udp, unix networks
Mikio Hara [Thu, 22 Aug 2013 01:33:06 +0000 (10:33 +0900)]
net: remove redundant argument check from Dial on udp, unix networks

The net package consists of thin three layers like the follwoing;

- Exposed API, that contains net.Dial, net.DialUDP, net.DialUnix
- Socket and network file descriptor, that contains net.netFD and
  its methods, helper functions such as dialUDP, dialUnix
- Network pollster, that contains net.pollDesc and its methods

This CL removes redundant argument check which is already done by
API layer.

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/13092043

11 years agodoc: hide playground on front page if playground disabled
Andrew Gerrand [Thu, 22 Aug 2013 01:12:44 +0000 (11:12 +1000)]
doc: hide playground on front page if playground disabled

Fixes #5630.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12884046

11 years agosyscall: fix stale URL for linux/arm unistd.h
Rémy Oudompheng [Wed, 21 Aug 2013 22:59:48 +0000 (00:59 +0200)]
syscall: fix stale URL for linux/arm unistd.h

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13105047

11 years agoruntime: do not trigger GC on g0
Dmitriy Vyukov [Wed, 21 Aug 2013 22:17:45 +0000 (02:17 +0400)]
runtime: do not trigger GC on g0
GC acquires worldsema, which is a goroutine-level semaphore
which parks goroutines. g0 can not be parked.
Fixes #6193.

R=khr, khr
CC=golang-dev
https://golang.org/cl/12880045

11 years agoundo CL 13010045 / 04f8101b46dd
Carl Shapiro [Wed, 21 Aug 2013 20:51:00 +0000 (13:51 -0700)]
undo CL 13010045 / 04f8101b46dd

Update the original change but do not read interface types in
the arguments area.  Once the arguments area is zeroed as the
locals area is we can safely read interface type values there
too.

««« original CL description
undo CL 12785045 / 71ce80dc4195

This has broken the 32-bit builds.

««« original CL description
cmd/gc, runtime: use type information to scan interface values

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»

R=khr, golang-dev, khr
CC=golang-dev
https://golang.org/cl/13010045
»»»

R=khr, khr
CC=golang-dev
https://golang.org/cl/13073045

11 years agotime: make timers heap 4-ary
Sokolov Yura [Wed, 21 Aug 2013 14:51:37 +0000 (18:51 +0400)]
time: make timers heap 4-ary

This slightly improves performance when a lot of timers are present

$ misc/benchcmp ../old_timers_m.txt ../new_timers_m.txt
benchmark                           old ns/op    new ns/op    delta
BenchmarkAfterFunc                       6884         6605   -4.05%
BenchmarkAfterFunc-2                     4473         4144   -7.36%
BenchmarkAfterFunc-3                     8601         6185  -28.09%
BenchmarkAfterFunc-4                     9378         8773   -6.45%
BenchmarkAfter                           7237         7278   +0.57%
BenchmarkAfter-2                         4638         3923  -15.42%
BenchmarkAfter-3                         8751         6239  -28.71%
BenchmarkAfter-4                         9223         8737   -5.27%
BenchmarkStop                             603          496  -17.74%
BenchmarkStop-2                           795          577  -27.42%
BenchmarkStop-3                           982          680  -30.75%
BenchmarkStop-4                          1164          739  -36.51%
BenchmarkSimultaneousAfterFunc            657          593   -9.74%
BenchmarkSimultaneousAfterFunc-2          816          757   -7.23%
BenchmarkSimultaneousAfterFunc-3          844          830   -1.66%
BenchmarkSimultaneousAfterFunc-4          785          771   -1.78%
BenchmarkStartStop                        238          239   +0.42%
BenchmarkStartStop-2                      249          234   -6.02%
BenchmarkStartStop-3                      271          268   -1.11%
BenchmarkStartStop-4                      293          295   +0.68%

R=golang-dev, dvyukov, bradfitz, r
CC=golang-dev
https://golang.org/cl/13094043

11 years agonet: ensure that Read/Write on all platforms do 0 mallocs
Dmitriy Vyukov [Wed, 21 Aug 2013 10:21:02 +0000 (14:21 +0400)]
net: ensure that Read/Write on all platforms do 0 mallocs

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12780045

11 years agocmd/5g, cmd/6g, cmd/8g: faster compilation
Dmitriy Vyukov [Wed, 21 Aug 2013 10:20:28 +0000 (14:20 +0400)]
cmd/5g, cmd/6g, cmd/8g: faster compilation
Replace linked list walk with memset.
This reduces CPU time taken by 'go install -a std' by ~10%.
Before:
real user sys
0m23.561s 0m16.625s 0m5.848s
0m23.766s 0m16.624s 0m5.846s
0m23.742s 0m16.621s 0m5.868s
after:
0m22.714s 0m14.858s 0m6.138s
0m22.644s 0m14.875s 0m6.120s
0m22.604s 0m14.854s 0m6.081s

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13084043

11 years agodoc/go1.2.txt: cmd/5l: support for external linking for linux/arm
Elias Naur [Wed, 21 Aug 2013 07:45:35 +0000 (17:45 +1000)]
doc/go1.2.txt: cmd/5l: support for external linking for linux/arm

R=r
CC=golang-dev
https://golang.org/cl/13019044

11 years agoreflect: Fix Convert to add indir bit when the value is actually a
Todd Wang [Wed, 21 Aug 2013 04:41:55 +0000 (14:41 +1000)]
reflect: Fix Convert to add indir bit when the value is actually a
pointer.  An example that triggers the bad behavior on a 64bit
machine http://play.golang.org/p/GrNFakAYLN
        rv1 := reflect.ValueOf(complex128(0))
        rt := rv1.Type()
        rv2 := rv1.Convert(rt)
        rv3 := reflect.New(rt).Elem()
        rv3.Set(rv2)

Running the code fails with the following:
        panic: reflect: internal error: storeIword of 16-byte value

I've tested on a 64bit machine and verified this fixes the panic.  I
haven't tested on a 32bit machine so I haven't verified the other
cases, but they follow logically.

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/12805045

11 years agoC: add Todd Wang (Google CLA).
David Symonds [Wed, 21 Aug 2013 04:02:58 +0000 (14:02 +1000)]
C: add Todd Wang (Google CLA).

R=r, adg
CC=golang-dev, toddwang
https://golang.org/cl/13149043

11 years agoall: protect alloc count tests by -testing.short
Rob Pike [Wed, 21 Aug 2013 04:00:45 +0000 (14:00 +1000)]
all: protect alloc count tests by -testing.short

Update #5000
Should reduce the flakiness a little. Malloc counting is important
to general testing but not to the build dashboard, which uses -short.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12866047

11 years agodoc/go1.2.txt: text/template: add comparison functions
Rob Pike [Wed, 21 Aug 2013 02:55:09 +0000 (12:55 +1000)]
doc/go1.2.txt: text/template: add comparison functions

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12801045

11 years agotext/template: implement comparison of basic types
Rob Pike [Wed, 21 Aug 2013 01:27:27 +0000 (11:27 +1000)]
text/template: implement comparison of basic types

Add eq, lt, etc. to allow one to do simple comparisons.
It's basic types only (booleans, integers, unsigned integers,
floats, complex, string) because that's easy, easy to define,
and covers the great majority of useful cases, while leaving
open the possibility of a more sweeping definition later.

{{if eq .X .Y}}X and Y are equal{{else}}X and Y are unequal{{end}}

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13091045

11 years agodoc/go1.2.txt: net: performance improvement on BSD
Mikio Hara [Wed, 21 Aug 2013 00:53:17 +0000 (09:53 +0900)]
doc/go1.2.txt: net: performance improvement on BSD

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12975044

11 years agodoc/go1.2.txt: archive/tar's fixed FileInfo
Rob Pike [Tue, 20 Aug 2013 22:37:32 +0000 (08:37 +1000)]
doc/go1.2.txt: archive/tar's fixed FileInfo

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13140043

11 years agodoc: remove a insignificant line from go1.2.txt
Brad Fitzpatrick [Tue, 20 Aug 2013 22:35:07 +0000 (15:35 -0700)]
doc: remove a insignificant line from go1.2.txt

Not a user-visible API change.  Just a minor garbage
win in contrived cases.

Also, the package is io/ioutil.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12987044

11 years agoarchive/tar,zip: implement the os.FileInfo interface correctly.
Rob Pike [Tue, 20 Aug 2013 22:29:41 +0000 (08:29 +1000)]
archive/tar,zip: implement the os.FileInfo interface correctly.
This is potentially an API-breaking change, but it is an important bug fix.

The CL https://golang.org/cl/7305072/ added stuff to make
the tar file look more like a file system internally, including providing an
implementation of os.FileInfo for the file headers within the archive.
But the code is incorrect because FileInfo.Name is supposed to return
the base name only; this implementation returns the full path. A round
trip test added in the same shows this in action, as the slashes are
preserved as we create a header using the local implementation of
FileInfo.

The CL here changes the behavior of the tar (and zip) FileInfo to honor
the Go spec for that interface. It also clarifies that the FileInfoHeader
function, which takes a FileInfo as an argument, will therefore create
a header with only the base name of the file recorded, and that
subsequent adjustment may be necessary.

There may be code out there that depends on the broken behavior.
We can call out the risk in the release notes.

Fixes #6180.

R=golang-dev, dsymonds, adg, bradfitz
CC=golang-dev
https://golang.org/cl/13118043

11 years agoA+C: Sokolov Yura (individual CLA)
Brad Fitzpatrick [Tue, 20 Aug 2013 15:21:58 +0000 (08:21 -0700)]
A+C: Sokolov Yura (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/12831044

11 years agomisc/xcode: use `xcode-select` to determine path
Emil Hessman [Tue, 20 Aug 2013 10:48:29 +0000 (20:48 +1000)]
misc/xcode: use `xcode-select` to determine path

If xcode-select is available, use it to determine the path to the
DVTFoundation.xcplugindata file.

Fixes #5997.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12741047

11 years agonet: remove obsolete builtin network pollster
Mikio Hara [Tue, 20 Aug 2013 08:32:55 +0000 (17:32 +0900)]
net: remove obsolete builtin network pollster

Update #5199
Update #6146

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/13112044

11 years agonet: enable runtime-integrated network pollster on freebsd/arm
Mikio Hara [Tue, 20 Aug 2013 08:02:42 +0000 (17:02 +0900)]
net: enable runtime-integrated network pollster on freebsd/arm

Fixes #6146.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12927048

11 years agoruntime: integrated network pollster for freebsd/arm
Mikio Hara [Tue, 20 Aug 2013 07:57:30 +0000 (16:57 +0900)]
runtime: integrated network pollster for freebsd/arm

Update #6146

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12927047

11 years agonet/http: support WriteString on the ResponseWriter
Brad Fitzpatrick [Tue, 20 Aug 2013 05:56:54 +0000 (22:56 -0700)]
net/http: support WriteString on the ResponseWriter

Fixes #5377

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12991046

11 years agoos: fix windows build
Rob Pike [Tue, 20 Aug 2013 04:45:46 +0000 (14:45 +1000)]
os: fix windows build
The os windows source uses file as the receiver, not f.
TBR=golang-dev@googlegroups.com

R=adg
CC=golang-dev
https://golang.org/cl/12922044

11 years agoos: be consistent about File methods with nil receivers
Rob Pike [Tue, 20 Aug 2013 04:33:03 +0000 (14:33 +1000)]
os: be consistent about File methods with nil receivers
Some crashed, some didn't. Make a nil receiver always
return ErrInvalid rather than crash.
Fixes #5824.
The program in the bug listing is silent now, at least on my Mac.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13108044

11 years agoapi: update next.txt, except.txt
Rob Pike [Tue, 20 Aug 2013 01:14:45 +0000 (11:14 +1000)]
api: update next.txt, except.txt

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12926046

11 years agotest: exit non-zero on error from nilptr2.go.
Alan Donovan [Mon, 19 Aug 2013 21:50:22 +0000 (17:50 -0400)]
test: exit non-zero on error from nilptr2.go.

(For go.tools/ssa/interp/interp_test, which runs a subset of
these tests under this assumption.)

R=rsc, r
CC=golang-dev
https://golang.org/cl/13108043

11 years agoundo CL 12785045 / 71ce80dc4195
Carl Shapiro [Mon, 19 Aug 2013 21:16:55 +0000 (14:16 -0700)]
undo CL 12785045 / 71ce80dc4195

This has broken the 32-bit builds.

««« original CL description
cmd/gc, runtime: use type information to scan interface values

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»

R=khr, golang-dev, khr
CC=golang-dev
https://golang.org/cl/13010045

11 years agodoc/go_faq.html: link to the SPLASH talk near the top
Rob Pike [Mon, 19 Aug 2013 20:44:41 +0000 (06:44 +1000)]
doc/go_faq.html: link to the SPLASH talk near the top
It's a full answer to the first question; let's let readers know that.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12788048

11 years agomisc/emacs: Detect stale coverage reports
Aaron France [Mon, 19 Aug 2013 20:32:00 +0000 (16:32 -0400)]
misc/emacs: Detect stale coverage reports

When the coverage report file is older than the file we're
showing the coverage report for, then we show a simple message
to state this fact.

R=adonovan, dominik.honnef, bradfitz
CC=golang-dev
https://golang.org/cl/12919044

11 years agoA+C: Aaron France (individual CLA)
Brad Fitzpatrick [Mon, 19 Aug 2013 20:30:31 +0000 (13:30 -0700)]
A+C: Aaron France (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/13073044

11 years agoruntime: don't run finalizers if we're still on the g0 stack.
Keith Randall [Mon, 19 Aug 2013 19:20:50 +0000 (12:20 -0700)]
runtime: don't run finalizers if we're still on the g0 stack.

R=golang-dev, rsc, dvyukov, khr
CC=golang-dev
https://golang.org/cl/11386044

11 years agonet: annotate Read/Write for race detector
Dmitriy Vyukov [Mon, 19 Aug 2013 19:09:24 +0000 (23:09 +0400)]
net: annotate Read/Write for race detector
Fixes #6167.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13052043

11 years agoruntime: do not preempt race calls
Dmitriy Vyukov [Mon, 19 Aug 2013 19:06:46 +0000 (23:06 +0400)]
runtime: do not preempt race calls
In the crash stack trace race cgocall() calls endcgo(),
this means that m->racecall is wrong.
Indeed this can happen is a goroutine is rescheduled to another M
during race call.
Disable preemption for race calls.
Fixes #6155.

R=golang-dev, rsc, cshapiro
CC=golang-dev
https://golang.org/cl/12866045

11 years agocmd/gc, runtime: use type information to scan interface values
Carl Shapiro [Mon, 19 Aug 2013 17:19:59 +0000 (10:19 -0700)]
cmd/gc, runtime: use type information to scan interface values

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045

11 years agocmd/go: only try to clean executables for package main
Andrew Gerrand [Mon, 19 Aug 2013 06:22:33 +0000 (16:22 +1000)]
cmd/go: only try to clean executables for package main

Fixes #5665.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12807044

11 years agocmd/go: diagnose import cycles better
Rob Pike [Mon, 19 Aug 2013 05:50:57 +0000 (15:50 +1000)]
cmd/go: diagnose import cycles better

Before this CL, the import stack was a) not printed and b) overwritten later
in the build, destroying the information about the cycle. This CL fixes both.

I made time depend on os (os already depends on time) and with this CL the error is:

/Users/r/go/src/pkg/fmt/print.go:10:2: import cycle not allowed
package code.google.com/p/XXX/YYY:
        imports fmt
        imports os
        imports time
        imports os

Doesn't give line numbers for the actual imports, as requested in the bug, but
I don't believe that's important.

Fixes #4292.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13100043

11 years agocmd/gc: regenerate y.tab.{c,h} with Bison 2.5.
David Symonds [Mon, 19 Aug 2013 03:47:43 +0000 (13:47 +1000)]
cmd/gc: regenerate y.tab.{c,h} with Bison 2.5.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12744048

11 years agotest: fix build
Rob Pike [Mon, 19 Aug 2013 02:05:33 +0000 (12:05 +1000)]
test: fix build
syntax/*: update messages
sliceerr3.go: bizarre new error fixed by deleting a space.

I could have sworn I ran all.bash before submitting the CL that triggered these.

TBR=golang-dev@googlegroups.com

R=golang-dev
CC=golang-dev
https://golang.org/cl/12812044

11 years agocmd/gc: don't attempt to generate wrappers for blank interface methods
Anthony Martin [Mon, 19 Aug 2013 01:53:34 +0000 (11:53 +1000)]
cmd/gc: don't attempt to generate wrappers for blank interface methods

Fixes #5691.

R=golang-dev, bradfitz, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/10255047

11 years agocmd/gc: better error messages for C-style if statements.
Rob Pike [Mon, 19 Aug 2013 01:49:59 +0000 (11:49 +1000)]
cmd/gc: better error messages for C-style if statements.
Given
        if (i == 0)
                x++
The old message was
        x.go:6: syntax error: unexpected semicolon or newline before {
Now we see
        x.go:6: syntax error: missing { after if clause

Fixes #5687

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12822045

11 years agomath/big: fix nil bug in GobEncode
Rob Pike [Mon, 19 Aug 2013 01:22:09 +0000 (11:22 +1000)]
math/big: fix nil bug in GobEncode

Update #5305.
This handles the case where the nil pointers are inside a slice.
A top-level nil pointer is harder, maybe fundamentally broken by gob's model.
Thinking required.
However, a slice is the important case since people don't expect to be sending
top-level nils much, but they can arise easily in slices.

R=golang-dev, josharian, adg
CC=golang-dev
https://golang.org/cl/13042044

11 years agomake.bash: exit if dist fails
Rob Pike [Mon, 19 Aug 2013 01:18:43 +0000 (11:18 +1000)]
make.bash: exit if dist fails
The shell's -e doesn't work across "eval"; need to error-check by hand.
The recent spate of Darwin build failures pointed out that if the first
run of cmd/dist fails, we keep going. We shouldn't.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13098043

11 years agocmd/dist: join with TMPDIR more carefully to avoid // in path.
David Symonds [Mon, 19 Aug 2013 01:11:27 +0000 (11:11 +1000)]
cmd/dist: join with TMPDIR more carefully to avoid // in path.

This might fix the mkdtemp problem on the darwin builders if they
have TMPDIR set to a path ending in a slash; at worse this will
result in cleaner path names.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13097043

11 years agoarchive/tar: Fix support for long links and improve PAX support.
Marco Hennings [Mon, 19 Aug 2013 00:45:44 +0000 (10:45 +1000)]
archive/tar: Fix support for long links and improve PAX support.

The tar/archive code from golang has a problem with linknames with length >
100. A pax header is added but the original header still written with a too
long field length.

As it is clear that pax support is incomplete I have added missing
implementation parts.

This commit contains code from the golang project in the folder tar/archiv.

The following pax header records are now automatically written:

- gname)
- linkpath
- path
- uname

The following fields can be written with PAX, but the default is to use the
star binary extension.

- gid  (value > 2097151)
- size (value > 8589934591)
- uid (value > 2097151)

The string fields are written when the value is longer as the field or if the
string contains a char that is not encodable as 7-bit ASCII value.

The change was tested against a current ubuntu-cloud image tarball comparing
the compressed result.

+ added some automated tests for the new functionality.

Fixes #6056.

R=dsymonds
CC=golang-dev
https://golang.org/cl/12561043

11 years agoA+C: Marco Hennings (individual CLA)
David Symonds [Mon, 19 Aug 2013 00:45:06 +0000 (10:45 +1000)]
A+C: Marco Hennings (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/13096043

11 years agotesting: don't start timing a Parallel test until it's actually starting
Rob Pike [Mon, 19 Aug 2013 00:15:30 +0000 (10:15 +1000)]
testing: don't start timing a Parallel test until it's actually starting
Fixes #5285.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/13045044

11 years agoencoding/xml: flush buffer after encoding token
Dominik Honnef [Mon, 19 Aug 2013 00:14:10 +0000 (10:14 +1000)]
encoding/xml: flush buffer after encoding token

R=rsc, bradfitz, adg
CC=golang-dev
https://golang.org/cl/13004046

11 years agocmd/dist: more informative error for mkdtemp failing
Rob Pike [Sun, 18 Aug 2013 22:29:43 +0000 (08:29 +1000)]
cmd/dist: more informative error for mkdtemp failing
The Darwin builders are all failing here but strerror doesn't provide context.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/13095043

11 years agonet: make protocol-specific WriteTo, WriteMsg methods return error instead of crash
Mikio Hara [Sun, 18 Aug 2013 10:19:36 +0000 (19:19 +0900)]
net: make protocol-specific WriteTo, WriteMsg methods return error instead of crash

R=golang-dev, dave, rsc, adg, bradfitz
CC=golang-dev
https://golang.org/cl/11809043

11 years agonet/textproto: use ReadDotBytes instead of non-existent ReadDotAll.
Emil Hessman [Sat, 17 Aug 2013 22:11:34 +0000 (08:11 +1000)]
net/textproto: use ReadDotBytes instead of non-existent ReadDotAll.

Fixes #5893.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13086043

11 years agonet/textproto: replace '3-digit' with 'three-digit'
Emil Hessman [Sat, 17 Aug 2013 22:10:00 +0000 (08:10 +1000)]
net/textproto: replace '3-digit' with 'three-digit'

A matter on form in documentation.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13087043

11 years agonet: fix garbage connection close in dual stack tests
Mikio Hara [Sat, 17 Aug 2013 04:40:55 +0000 (13:40 +0900)]
net: fix garbage connection close in dual stack tests

This may possibly be the root cause of flaky dual stack tests.

Update #4176
Update #5001

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13050043

11 years agonet: enable runtime-integrated network pollster on netbsd
Mikio Hara [Sat, 17 Aug 2013 04:40:14 +0000 (13:40 +0900)]
net: enable runtime-integrated network pollster on netbsd

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13080043

11 years agoruntime: integrated network pollster for netbsd/amd64,386,arm
Mikio Hara [Sat, 17 Aug 2013 03:11:29 +0000 (12:11 +0900)]
runtime: integrated network pollster for netbsd/amd64,386,arm

Original CL by minux (9545044).

Update #6146

R=golang-dev, rsc
CC=golang-dev, minux.ma
https://golang.org/cl/12949045

11 years agonet: limit number of concurrent cgo calls
Russ Cox [Sat, 17 Aug 2013 02:43:05 +0000 (22:43 -0400)]
net: limit number of concurrent cgo calls

The limit is 500. There is no way to change it.
This primarily affects name resolution.
If a million goroutines try to resolve DNS names,
only 500 will get to execute cgo calls at a time.
But in return the operating system will not crash.

Fixes #5625.

R=golang-dev, dan.kortschak, r, dvyukov
CC=bradfitz, golang-dev
https://golang.org/cl/13038043

11 years agoruntime: impose thread count limit
Russ Cox [Sat, 17 Aug 2013 02:25:26 +0000 (22:25 -0400)]
runtime: impose thread count limit

Actually working to stay within the limit could cause subtle deadlocks.
Crashing avoids the subtlety.

Fixes #4056.

R=golang-dev, r, dvyukov
CC=golang-dev
https://golang.org/cl/13037043

11 years agocmd/gc: separate "has pointers" from "needs zeroing" in stack frame
Russ Cox [Sat, 17 Aug 2013 01:45:59 +0000 (21:45 -0400)]
cmd/gc: separate "has pointers" from "needs zeroing" in stack frame

When the new call site-specific frame bitmaps are available,
we can cut the zeroing to just those values that need it due
to scope escaping.

R=cshapiro, cshapiro
CC=golang-dev
https://golang.org/cl/13045043

11 years agodoc: describe halt_on_error race detector parameter
Dmitriy Vyukov [Fri, 16 Aug 2013 18:42:54 +0000 (22:42 +0400)]
doc: describe halt_on_error race detector parameter

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13067043

11 years agoruntime/race: add output tests for different GORACE params
Dmitriy Vyukov [Fri, 16 Aug 2013 17:54:04 +0000 (21:54 +0400)]
runtime/race: add output tests for different GORACE params

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13065043

11 years agotest: say that nilptr2.go requires 256+MB stack
Dmitriy Vyukov [Fri, 16 Aug 2013 17:14:38 +0000 (21:14 +0400)]
test: say that nilptr2.go requires 256+MB stack
Fixes #6161.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13059043

11 years agoruntime: fix goroutine stack accounting
Dmitriy Vyukov [Fri, 16 Aug 2013 17:04:05 +0000 (21:04 +0400)]
runtime: fix goroutine stack accounting
Fixes #6166.
Fixes #6168.

R=golang-dev, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/12927045

11 years agomisc/emacs: godef: print the entire description, not just the first line
Dominik Honnef [Fri, 16 Aug 2013 17:03:40 +0000 (13:03 -0400)]
misc/emacs: godef: print the entire description, not just the first line

When identifying structs or interfaces we really want to know
their makeup, not just their name.

R=adonovan
CC=golang-dev
https://golang.org/cl/13042043

11 years agoruntime/race: update runtime to rev 188542
Dmitriy Vyukov [Fri, 16 Aug 2013 13:51:09 +0000 (17:51 +0400)]
runtime/race: update runtime to rev 188542

Fixes #6107.
race: output goroutine 1 as main goroutine

Fixes #6130.
race: option to abort program on first detected error

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/12968044

11 years agonet: fix bug in fdMutex
Dmitriy Vyukov [Fri, 16 Aug 2013 12:02:55 +0000 (16:02 +0400)]
net: fix bug in fdMutex
Fixes #6165.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12984044

11 years agoA+C: change Robert Dinu's email address
Robert Dinu [Fri, 16 Aug 2013 07:19:22 +0000 (17:19 +1000)]
A+C: change Robert Dinu's email address

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12759043

11 years agodoc/go1.2.txt: testing: add TB interface
Rob Pike [Fri, 16 Aug 2013 05:38:18 +0000 (15:38 +1000)]
doc/go1.2.txt: testing: add TB interface

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12890044

11 years agocmd/5g, cmd/6g, cmd/8g: update frame zeroing for new bitmap format
Carl Shapiro [Fri, 16 Aug 2013 05:15:04 +0000 (01:15 -0400)]
cmd/5g, cmd/6g, cmd/8g: update frame zeroing for new bitmap format

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12740046

11 years agotime: fix time zones yet again.
Rob Pike [Fri, 16 Aug 2013 04:57:49 +0000 (14:57 +1000)]
time: fix time zones yet again.
This time we're going for 5!
http://goo.gl/3ETYH7

Fixes #3790
Yeah, right.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13002044

11 years agoundo CL 12822043 / 96fefaa02ae3
David Symonds [Fri, 16 Aug 2013 04:36:06 +0000 (14:36 +1000)]
undo CL 12822043 / 96fefaa02ae3

Fixes #6160.

««« original CL description
go/doc: permit a package synopsis to end with ":\n".

R=gri, r
CC=golang-dev
https://golang.org/cl/12822043
»»»

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13040043

11 years agomisc/emacs: allow godef to work in coverage buffers
Dominik Honnef [Fri, 16 Aug 2013 04:22:38 +0000 (00:22 -0400)]
misc/emacs: allow godef to work in coverage buffers

Jumps to the same file will use the original buffer, not the
coverage buffer. Making it work for the coverage buffer isn't
worth the trouble, especially because it would break as soon as
you jump to a different file and back.

Use error instead of message so it actually terminates

R=adonovan
CC=golang-dev
https://golang.org/cl/13041043

11 years agomisc/emacs: do not use any free variables
Dominik Honnef [Fri, 16 Aug 2013 04:06:19 +0000 (00:06 -0400)]
misc/emacs: do not use any free variables

R=adonovan
CC=golang-dev
https://golang.org/cl/12744046

11 years agomisc/emacs: when defining prog-mode, define it like GNU Emacs 24 would
Dominik Honnef [Fri, 16 Aug 2013 03:40:38 +0000 (20:40 -0700)]
misc/emacs: when defining prog-mode, define it like GNU Emacs 24 would

Fixes #6156.

R=adonovan
CC=golang-dev
https://golang.org/cl/13035043

11 years agomisc/dist: don't copy godoc templates to lib/godoc
Andrew Gerrand [Fri, 16 Aug 2013 03:14:13 +0000 (13:14 +1000)]
misc/dist: don't copy godoc templates to lib/godoc

They're baked into the godoc binary now.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12751047

11 years agocmd/go: fix at least some instances of double compilation
Rob Pike [Fri, 16 Aug 2013 02:49:51 +0000 (12:49 +1000)]
cmd/go: fix at least some instances of double compilation

When the packages the tested package depends on don't build,
we weren't getting out early. Added a simple check for a successful
build to an existing early out.

There may be other ways that double compilation arises, but
this fixes the one listed in the issue.
Fixes #5679

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13036043

11 years agocmd/gc: remove mentions of "ideal" from error messages.
Rob Pike [Fri, 16 Aug 2013 02:40:02 +0000 (12:40 +1000)]
cmd/gc: remove mentions of "ideal" from error messages.
        _ = complex("foo", 0)
        _ = complex(true, 0)
now trigger:
        x.go:4: invalid operation: complex("foo", 0) (mismatched types untyped string and untyped number)
        x.go:5: invalid operation: complex(true, 0) (mismatched types untyped bool and untyped number)

Fixes #4521

R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/12973043

11 years agomisc/emacs: Refactor coverage code into multiple functions
Dominik Honnef [Fri, 16 Aug 2013 02:37:16 +0000 (22:37 -0400)]
misc/emacs: Refactor coverage code into multiple functions

Also fixes color gradient being calculated against the wrong maximum.

R=adonovan
CC=golang-dev
https://golang.org/cl/12968043

11 years agoruntime: impose stack size limit
Russ Cox [Fri, 16 Aug 2013 02:34:06 +0000 (22:34 -0400)]
runtime: impose stack size limit

The goal is to stop only those programs that would keep
going and run the machine out of memory, but before they do that.
1 GB on 64-bit, 250 MB on 32-bit.
That seems implausibly large, and it can be adjusted.

Fixes #2556.
Fixes #4494.
Fixes #5173.

R=khr, r, dvyukov
CC=golang-dev
https://golang.org/cl/12541052

11 years ago image: Inline example image data to make it runnable on playground.
Dimitri Tcaciuc [Fri, 16 Aug 2013 01:43:43 +0000 (11:43 +1000)]
image: Inline example image data to make it runnable on playground.

Use more compressed image to reduce source clutter.

Fixes #5983.

R=nigeltao, adg
CC=golang-dev
https://golang.org/cl/12513044

11 years agoA+C: Dimitri Tcaciuc (individual CLA)
Nigel Tao [Fri, 16 Aug 2013 01:40:56 +0000 (11:40 +1000)]
A+C: Dimitri Tcaciuc (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/13024045

11 years agodatabase/sql: make Rows.Next returning false always implicitly call
Nigel Tao [Fri, 16 Aug 2013 01:23:35 +0000 (11:23 +1000)]
database/sql: make Rows.Next returning false always implicitly call
Rows.Close.

Previously, callers that followed the example code (but not call
rows.Close after "for rows.Next() { ... }") could leak statements if
the driver returned an error other than io.EOF.

R=bradfitz, alex.brainman
CC=golang-dev, rsc
https://golang.org/cl/12677050

11 years agocmd/gc: ensure addable in checknil (fix race build)
Russ Cox [Fri, 16 Aug 2013 01:05:05 +0000 (21:05 -0400)]
cmd/gc: ensure addable in checknil (fix race build)

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12791044

11 years agonet/http: don't send an automatic Content-Length on a 304 Not Modified
Brad Fitzpatrick [Fri, 16 Aug 2013 00:40:05 +0000 (17:40 -0700)]
net/http: don't send an automatic Content-Length on a 304 Not Modified

Also start of some test helper unification, long overdue.
I refrained from cleaning up the rest in this CL.

Fixes #6157

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13030043

11 years agodoc/go1.2.txt: delete 'go doc'
Rob Pike [Fri, 16 Aug 2013 00:35:22 +0000 (10:35 +1000)]
doc/go1.2.txt: delete 'go doc'
It's nearly useless and for plain 'go doc', 'godoc .' works fine.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13004044

11 years agodoc/go1.2.txt: three-index slices are going into 1.2
Rob Pike [Fri, 16 Aug 2013 00:30:31 +0000 (10:30 +1000)]
doc/go1.2.txt: three-index slices are going into 1.2

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12931044

11 years agocmd/go: delete 'go doc'
Rob Pike [Fri, 16 Aug 2013 00:30:05 +0000 (10:30 +1000)]
cmd/go: delete 'go doc'
It's next to useless and confusing as well. Let's make godoc better instead.

Fixes #4849.

R=golang-dev, dsymonds, adg, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/12974043

11 years agonet/http: unify the confusingly-named serve_test and server_test
Brad Fitzpatrick [Thu, 15 Aug 2013 23:47:31 +0000 (16:47 -0700)]
net/http: unify the confusingly-named serve_test and server_test

One was tiny. One was gigantic. Now one is gone and one is giganticer.

No code changes.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13025043

11 years agocmd/gc: &x panics if x does
Russ Cox [Thu, 15 Aug 2013 18:38:32 +0000 (14:38 -0400)]
cmd/gc: &x panics if x does

See golang.org/s/go12nil.

This CL is about getting all the right checks inserted.
A followup CL will add an optimization pass to
remove redundant checks.

R=ken2
CC=golang-dev
https://golang.org/cl/12970043

11 years agospec: &x panics if x does
Russ Cox [Thu, 15 Aug 2013 18:33:26 +0000 (14:33 -0400)]
spec: &x panics if x does

See golang.org/s/go12nil for the extended version.

R=golang-dev, r, adonovan
CC=golang-dev
https://golang.org/cl/12964043

11 years agotests: remove two misuses of nil pointers
Russ Cox [Thu, 15 Aug 2013 15:51:04 +0000 (11:51 -0400)]
tests: remove two misuses of nil pointers

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12858044

11 years agoruntime: fix wrong syscall numbers on freebsd/386, openbsd/386
Mikio Hara [Thu, 15 Aug 2013 14:22:55 +0000 (23:22 +0900)]
runtime: fix wrong syscall numbers on freebsd/386, openbsd/386

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/12876044

11 years agonet: enable runtime-integrated network pollster on freebsd, openbsd
Mikio Hara [Thu, 15 Aug 2013 12:10:03 +0000 (21:10 +0900)]
net: enable runtime-integrated network pollster on freebsd, openbsd

Fixes #5199.

Benchmark results on freebsd/amd64 (virtual machine):

benchmark                             old ns/op    new ns/op    delta
BenchmarkTCP4OneShot-2                   184566       187164   +1.41%
BenchmarkTCP4OneShotTimeout-2            215558       187722  -12.91%
BenchmarkTCP4Persistent-2                 59686        41294  -30.81%
BenchmarkTCP4PersistentTimeout-2          60692        39974  -34.14%
BenchmarkTCP6OneShot-2                   226595       223688   -1.28%
BenchmarkTCP6OneShotTimeout-2            253144       225161  -11.05%
BenchmarkTCP6Persistent-2                 69157        55605  -19.60%
BenchmarkTCP6PersistentTimeout-2          70426        53805  -23.60%
BenchmarkTCP4ConcurrentReadWrite-2        53878        56087   +4.10%
BenchmarkTCP6ConcurrentReadWrite-2        66538        68190   +2.48%

benchmark                            old allocs   new allocs    delta
BenchmarkTCP4OneShot-2                       39           36   -7.69%
BenchmarkTCP4OneShotTimeout-2                42           36  -14.29%
BenchmarkTCP4Persistent-2                     1            0  -100.00%
BenchmarkTCP4PersistentTimeout-2              1            0  -100.00%
BenchmarkTCP6OneShot-2                       41           36  -12.20%
BenchmarkTCP6OneShotTimeout-2                43           36  -16.28%
BenchmarkTCP6Persistent-2                     1            0  -100.00%
BenchmarkTCP6PersistentTimeout-2              1            0  -100.00%
BenchmarkTCP4ConcurrentReadWrite-2            0            0     n/a%
BenchmarkTCP6ConcurrentReadWrite-2            0            0     n/a%

benchmark                             old bytes    new bytes    delta
BenchmarkTCP4OneShot-2                     3084         2544  -17.51%
BenchmarkTCP4OneShotTimeout-2              3129         2519  -19.50%
BenchmarkTCP4Persistent-2                    30            0  -100.00%
BenchmarkTCP4PersistentTimeout-2             31            0  -100.00%
BenchmarkTCP6OneShot-2                     3297         2660  -19.32%
BenchmarkTCP6OneShotTimeout-2              3306         2655  -19.69%
BenchmarkTCP6Persistent-2                    31            0  -100.00%
BenchmarkTCP6PersistentTimeout-2             29            0  -100.00%
BenchmarkTCP4ConcurrentReadWrite-2            2            0  -100.00%
BenchmarkTCP6ConcurrentReadWrite-2            7            0  -100.00%

R=dvyukov, minux.ma, dave, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/8264043

11 years agoruntime: remove old preemption checks
Dmitriy Vyukov [Thu, 15 Aug 2013 10:32:10 +0000 (14:32 +0400)]
runtime: remove old preemption checks
runtime.gcwaiting checks are not needed anymore

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/12934043

11 years agoruntime: fix plan9 build
Dmitriy Vyukov [Thu, 15 Aug 2013 10:24:28 +0000 (14:24 +0400)]
runtime: fix plan9 build

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12986043

11 years agodoc: update go1.2.txt
Rémy Oudompheng [Thu, 15 Aug 2013 08:31:18 +0000 (10:31 +0200)]
doc: update go1.2.txt

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12960043

11 years agonet: rearrange the call order of runtime-integrated network pollster and syscall...
Mikio Hara [Thu, 15 Aug 2013 07:40:33 +0000 (16:40 +0900)]
net: rearrange the call order of runtime-integrated network pollster and syscall functions

This CL rearranges the call order for raw networking primitives like
the following;

- For dialers that open active connections, pollDesc.Init will be
  called before syscall.Connect.

- For stream listeners that open passive stream connections,
  pollDesc.Init will be called just after syscall.Listen.

- For datagram listeners that open datagram connections,
  pollDesc.Init will be called just after syscall.Bind.

This is in preparation for runtime-integrated network pollster for BSD
variants.

Update #5199

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12730043