]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agobytes,string: move the BUG to the comment of the function it's about
Rob Pike [Sat, 16 Mar 2013 00:08:07 +0000 (17:08 -0700)]
bytes,string: move the BUG to the comment of the function it's about
Avoids printing it every time we ask a question about the package from
the command line.

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

12 years agonet/http: don't test for goroutine leaks in short mode
Brad Fitzpatrick [Fri, 15 Mar 2013 23:50:54 +0000 (16:50 -0700)]
net/http: don't test for goroutine leaks in short mode

Too annoying and flaky to debug for now. Later. This
tangent has taken enough time.

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

12 years agocmd/gc: missing type inference for untyped complex() calls.
Rémy Oudompheng [Fri, 15 Mar 2013 23:37:28 +0000 (00:37 +0100)]
cmd/gc: missing type inference for untyped complex() calls.

Fixes #5014.

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

12 years agonet/http: fix test breakage on Windows
Brad Fitzpatrick [Fri, 15 Mar 2013 22:58:43 +0000 (15:58 -0700)]
net/http: fix test breakage on Windows

Treat the Windows net server as uninteresting for leak
purposes too.

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

12 years agogo/doc: fix TODO
Robert Griesemer [Fri, 15 Mar 2013 22:55:31 +0000 (15:55 -0700)]
go/doc: fix TODO

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

12 years agonet/http: less flaky leaking goroutine test
Brad Fitzpatrick [Fri, 15 Mar 2013 22:09:17 +0000 (15:09 -0700)]
net/http: less flaky leaking goroutine test

Fixes #5005

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

12 years agospec: remove special int rule for shifts
Robert Griesemer [Fri, 15 Mar 2013 20:55:50 +0000 (13:55 -0700)]
spec: remove special int rule for shifts

The rule is not concistently followed by gc.
It appears that gccgo is ignoring it. go/types
does not implement this rule. However, both
gccgo and now go/types can compile/type-check
the entire std library (and thus all the shift
expressions occuring in it) w/o errors. For
more details see the discussion in issue 4883.

Fixes #4880.
Fixes #4881.
Fixes #4883.

R=rsc, r, iant, ken, ken, mtj, rogpeppe
CC=golang-dev
https://golang.org/cl/7707043

12 years agoA+C: Herbert Georg Fischer (individual CLA)
Rob Pike [Fri, 15 Mar 2013 20:43:29 +0000 (13:43 -0700)]
A+C: Herbert Georg Fischer (individual CLA)

Generated by addca.

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

12 years agodoc: explain why cmd/go uses https for repositories and how to work around it
Herbert Georg Fischer [Fri, 15 Mar 2013 20:43:10 +0000 (13:43 -0700)]
doc: explain why cmd/go uses https for repositories and how to work around it
Fixes #3418.

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

12 years agocodereview: re-enable 15-second status prints
Russ Cox [Fri, 15 Mar 2013 20:33:04 +0000 (16:33 -0400)]
codereview: re-enable 15-second status prints

Also print all status changes when using hg -v.

The start_status_thread call was lost during the refactoring in
https://golang.org/cl/5395044/diff/6006/lib/codereview/codereview.py
Oops.

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

12 years agoruntime: scan the type of an interface value
Jan Ziak [Fri, 15 Mar 2013 20:07:52 +0000 (16:07 -0400)]
runtime: scan the type of an interface value

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

12 years agonet, runtime: enable runtime-integrated pollster on Linux/ARM.
Shenghou Ma [Fri, 15 Mar 2013 20:01:56 +0000 (04:01 +0800)]
net, runtime: enable runtime-integrated pollster on Linux/ARM.

Results from linux/arm on a Samsung Chromebook (from dfc):
localhost(~/go/src/pkg/net) % ~/go/misc/benchcmp {old,new}.txt
benchmark                           old ns/op    new ns/op    delta
BenchmarkTCP4OneShot                   568840       350526  -38.38%
BenchmarkTCP4OneShot-2                 359054       206708  -42.43%
BenchmarkTCP4OneShotTimeout            637464       363550  -42.97%
BenchmarkTCP4OneShotTimeout-2          374255       216695  -42.10%
BenchmarkTCP4Persistent                184974        64984  -64.87%
BenchmarkTCP4Persistent-2              109902        47195  -57.06%
BenchmarkTCP4PersistentTimeout         210039        64789  -69.15%
BenchmarkTCP4PersistentTimeout-2       124284        43374  -65.10%
BenchmarkTCP6OneShot                   672278       362116  -46.14%
BenchmarkTCP6OneShot-2                 383631       216400  -43.59%
BenchmarkTCP6OneShotTimeout            680740       378306  -44.43%
BenchmarkTCP6OneShotTimeout-2          397524       230152  -42.10%
BenchmarkTCP6Persistent                172346        65292  -62.12%
BenchmarkTCP6Persistent-2              106229        42096  -60.37%
BenchmarkTCP6PersistentTimeout         161149        65138  -59.58%
BenchmarkTCP6PersistentTimeout-2       152276        44548  -70.75%

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

12 years agocmd/gc: ensure unique parameter and result names in function types
Russ Cox [Fri, 15 Mar 2013 19:24:13 +0000 (15:24 -0400)]
cmd/gc: ensure unique parameter and result names in function types

In addition to fixing the bug, the check is now linear instead of quadratic.

Fixes #4469.

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

12 years agodoc/go_faq.html: add entry about pointer to interface
Rob Pike [Fri, 15 Mar 2013 18:38:50 +0000 (11:38 -0700)]
doc/go_faq.html: add entry about pointer to interface

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

12 years agonet: fix build with CGO_ENABLED=0
Dmitriy Vyukov [Fri, 15 Mar 2013 18:23:35 +0000 (22:23 +0400)]
net: fix build with CGO_ENABLED=0

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

12 years agoruntime: use AES hash for compound objects.
Keith Randall [Fri, 15 Mar 2013 17:46:34 +0000 (10:46 -0700)]
runtime: use AES hash for compound objects.

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

12 years agobuild: skip benchmarks on OpenBSD
Russ Cox [Fri, 15 Mar 2013 16:39:14 +0000 (12:39 -0400)]
build: skip benchmarks on OpenBSD

They are making the build die. I want to be able to see that everything else is okay.

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

12 years agoruntime: remove struct BitTarget
Jan Ziak [Fri, 15 Mar 2013 16:37:40 +0000 (12:37 -0400)]
runtime: remove struct BitTarget

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

12 years agobuild: fix for 32-bit windows builds on 64-bit windows system
Russ Cox [Fri, 15 Mar 2013 16:30:14 +0000 (12:30 -0400)]
build: fix for 32-bit windows builds on 64-bit windows system

Thanks to jon.forums@ for the fix.

Fixes #5051.

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

12 years agoruntime: unbreak netbsd builds
Joel Sing [Fri, 15 Mar 2013 15:43:43 +0000 (11:43 -0400)]
runtime: unbreak netbsd builds

Fix signal handling so that Go builds on NetBSD.

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

12 years agocmd/gc: fix escape analysis bug.
Rémy Oudompheng [Fri, 15 Mar 2013 08:03:45 +0000 (09:03 +0100)]
cmd/gc: fix escape analysis bug.

It used to not mark parameters as escaping if only one of the
fields it points to leaks out of the function. This causes
problems when importing from another package.

Fixes #4964.

R=rsc, lvd, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/7648045

12 years agoruntime: replace lock() with casp() in the GC
Jan Ziak [Fri, 15 Mar 2013 08:02:36 +0000 (09:02 +0100)]
runtime: replace lock() with casp() in the GC

Note: BitTarget will be removed by a forthcoming changeset.

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

12 years agocmd/gc: unroll small array types
Jan Ziak [Fri, 15 Mar 2013 05:57:50 +0000 (06:57 +0100)]
cmd/gc: unroll small array types

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

12 years agoruntime: accept GOTRACEBACK=crash to mean 'crash after panic'
Russ Cox [Fri, 15 Mar 2013 05:11:03 +0000 (01:11 -0400)]
runtime: accept GOTRACEBACK=crash to mean 'crash after panic'

This provides a way to generate core dumps when people need them.
The settings are:

        GOTRACEBACK=0  no traceback on panic, just exit
        GOTRACEBACK=1  default - traceback on panic, then exit
        GOTRACEBACK=2  traceback including runtime frames on panic, then exit
        GOTRACEBACK=crash traceback including runtime frames on panic, then crash

Fixes #3257.

R=golang-dev, devon.odell, r, daniel.morsing, ality
CC=golang-dev
https://golang.org/cl/7666044

12 years agocmd/gc: disallow fallthrough in final case of switch
Tyler Bunnell [Fri, 15 Mar 2013 04:35:09 +0000 (00:35 -0400)]
cmd/gc: disallow fallthrough in final case of switch

Small change to cmd/gc to catch a "fallthrough" in the final case of a switch.

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

12 years agocmd/dist: instruct the user to bind $GOBIN on Plan 9
Anthony Martin [Fri, 15 Mar 2013 04:04:19 +0000 (05:04 +0100)]
cmd/dist: instruct the user to bind $GOBIN on Plan 9

R=seed, rminnich, bradfitz, r
CC=golang-dev
https://golang.org/cl/7395059

12 years agoos/signal: add Stop, be careful about SIGHUP
Russ Cox [Fri, 15 Mar 2013 04:00:02 +0000 (00:00 -0400)]
os/signal: add Stop, be careful about SIGHUP

Fixes #4268.
Fixes #4491.

R=golang-dev, nightlyone, fullung, r
CC=golang-dev
https://golang.org/cl/7546048

12 years agogo/build: allow ~ in middle of path, just not at beginning
Jonathan Nieder [Fri, 15 Mar 2013 03:59:49 +0000 (23:59 -0400)]
go/build: allow ~ in middle of path, just not at beginning

CL 7799045 relaxed the restriction in cmd/go on ~ in GOPATH
to allow paths with ~ in the middle while continuing to
protect against the common mistake of using GOPATH='~/home'
instead of GOPATH=~/home.  Unfortunately go/build still
filters these paths out:

        $ GOPATH=/tmp/test~ing go build
        test.go:22:2: cannot find package "test" in any of:
                /usr/lib/go/test (from $GOROOT)
                ($GOPATH not set)

So relax the requirement in go/build, too.

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

12 years agoCONTRIBUTORS: add Jonathan Nieder (Google CLA)
Russ Cox [Fri, 15 Mar 2013 03:59:41 +0000 (23:59 -0400)]
CONTRIBUTORS: add Jonathan Nieder (Google CLA)

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

12 years agomisc/dashboard/codereview: better debugging when some fetches fail.
David Symonds [Fri, 15 Mar 2013 03:45:00 +0000 (14:45 +1100)]
misc/dashboard/codereview: better debugging when some fetches fail.

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

12 years agoruntime: use 64-bit negative error code on 64-bit machines
Russ Cox [Fri, 15 Mar 2013 03:42:11 +0000 (23:42 -0400)]
runtime: use 64-bit negative error code on 64-bit machines

NEGL does a negation of the bottom 32 bits and then zero-extends to 64 bits,
resulting in a negative 32-bit number but a positive 64-bit number.

NEGQ does a full 64-bit negation, so that the result is negative both as
a 32-bit and as a 64-bit number.

This doesn't matter for the functions that are declared to return int32.
It only matters for the ones that return int64 or void* [sic].

This will fix the current incorrect error in the OpenBSD/amd64 build.
The build will still be broken, but it won't report a bogus error.

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

12 years agomisc/dashboard/codereview: add more people.
David Symonds [Fri, 15 Mar 2013 03:33:00 +0000 (14:33 +1100)]
misc/dashboard/codereview: add more people.

I picked everyone who has committed a CL on behalf of someone else in recent times.

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

12 years agodatabase/sql: associate a mutex with each driver interface
Brad Fitzpatrick [Thu, 14 Mar 2013 22:01:45 +0000 (15:01 -0700)]
database/sql: associate a mutex with each driver interface

The database/sql/driver docs make this promise:

   "Conn is a connection to a database. It is not used
   concurrently by multiple goroutines."

That promises exists as part of database/sql's overall
goal of making drivers relatively easy to write.

So far this promise has been kept without the use of locks by
being careful in the database/sql package, but sometimes too
careful. (cf. golang.org/issue/3857)

The CL associates a Mutex with each driver.Conn, and with the
interface value progeny thereof. (e.g. each driver.Tx,
driver.Stmt, driver.Rows, driver.Result, etc) Then whenever
those interface values are used, the Locker is locked.

This CL should be a no-op (aside from some new Lock/Unlock
pairs) and doesn't attempt to fix Issue 3857 or Issue 4459,
but should make it much easier in a subsequent CL.

Update #3857

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

12 years agoruntime: fix netbsd after reorg (again)
Russ Cox [Thu, 14 Mar 2013 21:59:45 +0000 (17:59 -0400)]
runtime: fix netbsd after reorg (again)

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

12 years agoruntime: fix netbsd again after reorg
Russ Cox [Thu, 14 Mar 2013 21:53:01 +0000 (17:53 -0400)]
runtime: fix netbsd again after reorg

This time for sure.
That C file sure looked like a header file to me. :-)

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

12 years agoruntime: fix build for freebsd/arm after reorg
Russ Cox [Thu, 14 Mar 2013 21:50:07 +0000 (17:50 -0400)]
runtime: fix build for freebsd/arm after reorg

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

12 years agoruntime: fix freebsd arm for hash change
Russ Cox [Thu, 14 Mar 2013 21:45:44 +0000 (17:45 -0400)]
runtime: fix freebsd arm for hash change

Was missing definitions of open, read, close.

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

12 years agoruntime: freebsd, netbsd build fixes after reorg
Russ Cox [Thu, 14 Mar 2013 21:39:39 +0000 (17:39 -0400)]
runtime: freebsd, netbsd build fixes after reorg

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

12 years agodatabase/sql: document non-open of Open; add Ping
Brad Fitzpatrick [Thu, 14 Mar 2013 21:06:46 +0000 (14:06 -0700)]
database/sql: document non-open of Open; add Ping

Fixes #4804

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

12 years agoruntime, net: fix arm build
Russ Cox [Thu, 14 Mar 2013 19:42:25 +0000 (19:42 +0000)]
runtime, net: fix arm build

Bring net/fd_linux.go back (it was deleted this morning)
because it is still needed for ARM.

Fix a few typos in the runtime reorg.

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

12 years agocmd/ld: another use-after-free
Russ Cox [Thu, 14 Mar 2013 18:35:47 +0000 (14:35 -0400)]
cmd/ld: another use-after-free

This only shows up in the duplicate symbol error message.

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

12 years agoruntime: refactor os-specific code
Russ Cox [Thu, 14 Mar 2013 18:35:13 +0000 (11:35 -0700)]
runtime: refactor os-specific code

thread_GOOS.c becomes os_GOOS.c.

signal_GOOS_GOARCH.c becomes os_GOOS_GOARCH.c,
but with non-GOARCH-specific code moved into os_GOOS.c.

The actual arch-specific signal handler moves into signal_GOARCH.c
to avoid per-GOOS duplication.

New files signal_GOOS_GOARCH.h provide macros for
accessing fields of the very system-specific signal info structs.

Lots moving, but nothing changing.
This is a preliminarly cleanup so I can work on the signal
handling code to fix some open issues without having to
make each change 13 times.

Tested on Linux and OS X, 386 and amd64.
Will fix Plan 9, Windows, and ARM after the fact if necessary.
(Plan 9 and Windows should be fine; ARM will probably have some typos.)

Net effect: -1081 lines of code.

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

12 years agonet: deflake TestDialTimeout
Albert Strasheim [Thu, 14 Mar 2013 16:42:29 +0000 (09:42 -0700)]
net: deflake TestDialTimeout

Fixes #3867.
Fixes #3307.

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

12 years agoruntime: do not memprofile settype_flush
Dmitriy Vyukov [Thu, 14 Mar 2013 15:11:29 +0000 (19:11 +0400)]
runtime: do not memprofile settype_flush
Fixes #4850.

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

12 years agoruntime: integrated network poller for linux
Dmitriy Vyukov [Thu, 14 Mar 2013 15:06:35 +0000 (19:06 +0400)]
runtime: integrated network poller for linux
vs tip:
BenchmarkTCP4OneShot                    172994        40485  -76.60%
BenchmarkTCP4OneShot-2                   96581        30028  -68.91%
BenchmarkTCP4OneShot-4                   52615        18454  -64.93%
BenchmarkTCP4OneShot-8                   26351        12289  -53.36%
BenchmarkTCP4OneShot-16                  12258        16093  +31.29%
BenchmarkTCP4OneShot-32                  13200        17045  +29.13%

BenchmarkTCP4OneShotTimeout             124814        42932  -65.60%
BenchmarkTCP4OneShotTimeout-2            99090        29040  -70.69%
BenchmarkTCP4OneShotTimeout-4            51860        18455  -64.41%
BenchmarkTCP4OneShotTimeout-8            26100        12073  -53.74%
BenchmarkTCP4OneShotTimeout-16           12198        16654  +36.53%
BenchmarkTCP4OneShotTimeout-32           13438        17143  +27.57%

BenchmarkTCP4Persistent                 115647         7782  -93.27%
BenchmarkTCP4Persistent-2                58024         4808  -91.71%
BenchmarkTCP4Persistent-4                24715         3674  -85.13%
BenchmarkTCP4Persistent-8                16431         2407  -85.35%
BenchmarkTCP4Persistent-16                2336         1875  -19.73%
BenchmarkTCP4Persistent-32                1689         1637   -3.08%

BenchmarkTCP4PersistentTimeout           79754         7859  -90.15%
BenchmarkTCP4PersistentTimeout-2         57708         5952  -89.69%
BenchmarkTCP4PersistentTimeout-4         26907         3823  -85.79%
BenchmarkTCP4PersistentTimeout-8         15036         2567  -82.93%
BenchmarkTCP4PersistentTimeout-16         2507         1903  -24.09%
BenchmarkTCP4PersistentTimeout-32         1717         1627   -5.24%

vs old scheduler:
benchmark                           old ns/op    new ns/op    delta
BenchmarkTCPOneShot                    192244        40485  -78.94%
BenchmarkTCPOneShot-2                   63835        30028  -52.96%
BenchmarkTCPOneShot-4                   35443        18454  -47.93%
BenchmarkTCPOneShot-8                   22140        12289  -44.49%
BenchmarkTCPOneShot-16                  16930        16093   -4.94%
BenchmarkTCPOneShot-32                  16719        17045   +1.95%

BenchmarkTCPOneShotTimeout             190495        42932  -77.46%
BenchmarkTCPOneShotTimeout-2            64828        29040  -55.20%
BenchmarkTCPOneShotTimeout-4            34591        18455  -46.65%
BenchmarkTCPOneShotTimeout-8            21989        12073  -45.10%
BenchmarkTCPOneShotTimeout-16           16848        16654   -1.15%
BenchmarkTCPOneShotTimeout-32           16796        17143   +2.07%

BenchmarkTCPPersistent                  81670         7782  -90.47%
BenchmarkTCPPersistent-2                26598         4808  -81.92%
BenchmarkTCPPersistent-4                15633         3674  -76.50%
BenchmarkTCPPersistent-8                18093         2407  -86.70%
BenchmarkTCPPersistent-16               17472         1875  -89.27%
BenchmarkTCPPersistent-32                7679         1637  -78.68%

BenchmarkTCPPersistentTimeout           83186         7859  -90.55%
BenchmarkTCPPersistentTimeout-2         26883         5952  -77.86%
BenchmarkTCPPersistentTimeout-4         15776         3823  -75.77%
BenchmarkTCPPersistentTimeout-8         18180         2567  -85.88%
BenchmarkTCPPersistentTimeout-16        17454         1903  -89.10%
BenchmarkTCPPersistentTimeout-32         7798         1627  -79.14%

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

12 years agocmd/dist: support goos,goarch build tags
Dmitriy Vyukov [Thu, 14 Mar 2013 15:04:47 +0000 (19:04 +0400)]
cmd/dist: support goos,goarch build tags
This is necessary to submit netpoll for linux,386 linux,amd64

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

12 years agoruntime: make panic possible before malloc is ready
Russ Cox [Thu, 14 Mar 2013 14:10:12 +0000 (10:10 -0400)]
runtime: make panic possible before malloc is ready

Otherwise startup problems can be difficult to debug.

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

12 years agoruntime: revert UseSpanType back to 1
Dmitriy Vyukov [Thu, 14 Mar 2013 09:48:19 +0000 (13:48 +0400)]
runtime: revert UseSpanType back to 1

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

12 years agoruntime: fix build
Dmitriy Vyukov [Thu, 14 Mar 2013 06:59:55 +0000 (10:59 +0400)]
runtime: fix build

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

12 years agoruntime: integrated network poller for darwin
Dmitriy Vyukov [Thu, 14 Mar 2013 06:38:37 +0000 (10:38 +0400)]
runtime: integrated network poller for darwin
vs tip:
benchmark                           old ns/op    new ns/op    delta
BenchmarkTCP4Persistent                 67786        33175  -51.06%
BenchmarkTCP4Persistent-2               49085        31227  -36.38%
BenchmarkTCP4PersistentTimeout          69265        32565  -52.98%
BenchmarkTCP4PersistentTimeout-2        49217        32588  -33.79%

vs old scheduler:
benchmark                           old ns/op    new ns/op    delta
BenchmarkTCP4Persistent                 63517        33175  -47.77%
BenchmarkTCP4Persistent-2               54760        31227  -42.97%
BenchmarkTCP4PersistentTimeout          63234        32565  -48.50%
BenchmarkTCP4PersistentTimeout-2        56956        32588  -42.78%

R=golang-dev, bradfitz, devon.odell, mikioh.mikioh, iant, rsc
CC=golang-dev, pabuhr
https://golang.org/cl/7569043

12 years agonet: prepare connect() for new network poller
Dmitriy Vyukov [Thu, 14 Mar 2013 06:32:42 +0000 (10:32 +0400)]
net: prepare connect() for new network poller
The problem is that new network poller can have spurious
rediness notifications. This implementation ensures that
the socket is actually connected.

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

12 years agocmd/go: allow ~ in middle of path, just not at beginning
Russ Cox [Thu, 14 Mar 2013 03:32:12 +0000 (23:32 -0400)]
cmd/go: allow ~ in middle of path, just not at beginning

An earlier CL disallowed ~ anywhere in GOPATH, to avoid
problems with GOPATH='~/home' instead of GOPATH=~/home.
But ~ is only special in the shell at the beginning of each of
the paths in the list, and some paths do have ~ in the middle.
So relax the requirement slightly.

Fixes #4140.

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

12 years agoencoding/xml: rewrite invalid code points to U+FFFD in Marshal, Escape
Olivier Saingre [Thu, 14 Mar 2013 03:26:03 +0000 (23:26 -0400)]
encoding/xml: rewrite invalid code points to U+FFFD in Marshal, Escape

Fixes #4235.

R=rsc, dave, r, dr.volker.dobler
CC=golang-dev
https://golang.org/cl/7438051

12 years agocmd/go: add go1.1 build tag, add -installsuffix flag
Russ Cox [Wed, 13 Mar 2013 21:37:49 +0000 (17:37 -0400)]
cmd/go: add go1.1 build tag, add -installsuffix flag

The new build tag "go1.1" will be satisfied by any Go 1.z release >= 1.1.
In general, the build tag "go1.x" will be satisfied by any Go 1.z release >= 1.x.
What happens when we reach Go 2 is yet to be decided.

The tags "go1" or "go1.0" are missing, because +build tags did not exist
before then, and also because the Go 1.0 releases do not recognize them.

The new -installsuffix flag gives access to the build context's InstallSuffix
(formerly named InstallTag, but not part of Go 1.0), for use in isolating
builds to custom directories. For example -race implies -installsuffix race,
and an AppEngine-specific build might use -tags appengine -installsuffix appengine.

Fixes #4116.
Fixes #4443.

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

12 years agocmd/vet: make struct tag literal test work better with no go/types
Russ Cox [Wed, 13 Mar 2013 21:37:37 +0000 (17:37 -0400)]
cmd/vet: make struct tag literal test work better with no go/types

Eliminate false positives when you can tell even without
type information that the literal does not need field tags.

Far too noisy otherwise.

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

12 years agocmd/go: better documentation about profiling
Rob Pike [Wed, 13 Mar 2013 20:56:51 +0000 (13:56 -0700)]
cmd/go: better documentation about profiling
Point the user to "go tool pprof" and mention some
important flags.

Fixes #4990.

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

12 years agocmd/gc: silence valgrind error
Dave Cheney [Wed, 13 Mar 2013 20:12:38 +0000 (16:12 -0400)]
cmd/gc: silence valgrind error

valgrind complained that under some circumstances,

    *nr = *nc

was being called when nr and nc were the same *Node. The suggestion my Rémy was to introduce a tmp node to avoid the potential for aliasing in subnode.

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

12 years agocmd/godoc: fix BUGS heading in text mode
Russ Cox [Wed, 13 Mar 2013 19:22:59 +0000 (15:22 -0400)]
cmd/godoc: fix BUGS heading in text mode

All the headings are CAPS not Title.

Fixes #4843.

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

12 years agoencoding/json: properly handle extra objects with fixed size arrays
Rick Arnold [Wed, 13 Mar 2013 18:53:03 +0000 (14:53 -0400)]
encoding/json: properly handle extra objects with fixed size arrays

If a fixed size array is passed in as the decode target and the JSON
to decode has extra array elements that are objects, then previously
the decoder would return a "data changing underfoot" error.

Fixes #3717.

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

12 years agonet: use original raddr if getpeername fails
Tyler Bunnell [Wed, 13 Mar 2013 18:49:24 +0000 (14:49 -0400)]
net: use original raddr if getpeername fails

Fixes #3838.

R=dave, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/7511043

12 years agoencoding/xml: predefine xml name space prefix
Russ Cox [Wed, 13 Mar 2013 18:36:42 +0000 (14:36 -0400)]
encoding/xml: predefine xml name space prefix

Also change prefix generation to use more human-friendly prefixes.

Fixes #5040.

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

12 years agomisc/pprof: fix address lookup regression on Linux
Jeff R. Allen [Wed, 13 Mar 2013 16:40:38 +0000 (09:40 -0700)]
misc/pprof: fix address lookup regression on Linux

Just use "go tool addr2line" no matter what, since we know
it works for all OSs.

Fixes #4818.

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

12 years agounicode/utf8: fix insignificant typos in tests
Jeff R. Allen [Wed, 13 Mar 2013 14:45:31 +0000 (07:45 -0700)]
unicode/utf8: fix insignificant typos in tests

Fixes #4972.

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

12 years agonet: fix windows and plan9 build
Brad Fitzpatrick [Wed, 13 Mar 2013 14:42:55 +0000 (07:42 -0700)]
net: fix windows and plan9 build

Don't call unix-only function in test init.

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

12 years agomisc/emacs: Fix indentation for code following multiline function declarations
Dominik Honnef [Wed, 13 Mar 2013 04:37:18 +0000 (21:37 -0700)]
misc/emacs: Fix indentation for code following multiline function declarations

Correctly indent the body of functions that have been declared
over multiple lines. See http://play.golang.org/p/MHMwNDbFyf for
an example.

Previously, the body of the function would be indented as deep as
the continuation line of the function declaration. Now it gets
indented as deep as the func keyword.

R=adonovan, cw, patrick.allen.higgins
CC=golang-dev
https://golang.org/cl/7628043

12 years agodoc: clarify that gccgo is a GCC front-end
Mike Rosset [Wed, 13 Mar 2013 00:12:56 +0000 (17:12 -0700)]
doc: clarify that gccgo is a GCC front-end

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

12 years agonet: require of both -external and -ipv6 flags to run IPv6 multicast tests
Mikio Hara [Wed, 13 Mar 2013 00:00:01 +0000 (08:00 +0800)]
net: require of both -external and -ipv6 flags to run IPv6 multicast tests

On BSD variants, the tests need surely constructed IPv6
routing table.

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

12 years agogo/test/bench/go1: add regexp test
Rob Pike [Tue, 12 Mar 2013 23:50:10 +0000 (16:50 -0700)]
go/test/bench/go1: add regexp test

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

12 years agotest/bench/go1: add http test
Brad Fitzpatrick [Tue, 12 Mar 2013 23:46:38 +0000 (16:46 -0700)]
test/bench/go1: add http test

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

12 years agoimage/jpeg: ignore extraneous data, the same as what libjpeg does.
Nigel Tao [Tue, 12 Mar 2013 23:44:45 +0000 (10:44 +1100)]
image/jpeg: ignore extraneous data, the same as what libjpeg does.

Fixes #4705.

Note that libjpeg will print a warning to stderr if there are many
extraneous bytes, but can be silent if the extraneous bytes can fit
into its int32 bit-buffer for Huffman decoding. I'm guessing that
this is why whatever encoder that produced the image filed for issue
4705 did not realize that they are, strictly speaking, generating an
invalid JPEG. That issue's attached image has two extraneous bytes.

For example, piping the program below into libjpeg's djpeg program
will print an "18 extraneous bytes" warning, even though N == 20.

$ cat main.go
package main

import (
        "bytes"
        "image"
        "image/color"
        "image/jpeg"
        "os"
)

const N = 20

func main() {
        // Encode a 1x1 red image.
        m := image.NewRGBA(image.Rect(0, 0, 1, 1))
        m.Set(0, 0, color.RGBA{255, 0, 0, 255})
        buf := new(bytes.Buffer)
        jpeg.Encode(buf, m, nil)
        b := buf.Bytes()
        // Strip the final "\xff\xd9" EOI marker.
        b = b[:len(b)-2]
        // Append N dummy 0x80 bytes to the SOS data.
        for i := 0; i < N; i++ {
                b = append(b, 0x80)
        }
        // Put back the "\xff\xd9" EOI marker.
        b = append(b, 0xff, 0xd9)
        os.Stdout.Write(b)
}
$ go run main.go | djpeg /dev/stdin > /tmp/foo.pnm
Corrupt JPEG data: 18 extraneous bytes before marker 0xd9

The resultant /tmp/foo.pnm is a perfectly good 1x1 red image.

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

12 years agonet: make sure to use /tmp in unix domain socket tests
Mikio Hara [Tue, 12 Mar 2013 23:26:21 +0000 (07:26 +0800)]
net: make sure to use /tmp in unix domain socket tests

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

12 years agoruntime: Plan 9, 32-bit: fix build by updating call to open()
Akshat Kumar [Tue, 12 Mar 2013 22:10:18 +0000 (23:10 +0100)]
runtime: Plan 9, 32-bit: fix build by updating call to open()

With the global redefinition of runtime·open by CL 7543043,
we need to provide a third argument and remove the cast
to the string.

Fixes build on 386 version of Plan 9.

R=khr, rsc, rminnich, ality
CC=golang-dev
https://golang.org/cl/7644047

12 years agonet: Plan 9: add lookupProtocol
Akshat Kumar [Tue, 12 Mar 2013 22:05:39 +0000 (23:05 +0100)]
net: Plan 9: add lookupProtocol

Needed by TestResolveIPAddr. This makes us pass tests
again.

R=rsc, rminnich, ality, bradfitz
CC=golang-dev
https://golang.org/cl/7737043

12 years agocmd/ld: fix 'use after free' error in new obj code
Russ Cox [Tue, 12 Mar 2013 21:57:13 +0000 (17:57 -0400)]
cmd/ld: fix 'use after free' error in new obj code

Many thanks to Elias Naur for finding this with Valgrind on Linux.
Perhaps this is what is breaking the windows/amd64 builder.

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

12 years agoapi/next.txt: remove references to go/types, now in separate repo
Rob Pike [Tue, 12 Mar 2013 21:42:37 +0000 (14:42 -0700)]
api/next.txt: remove references to go/types, now in separate repo

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

12 years agohtml/template: Ensure release of namespace mutex in Template.Execute()
Robert Figueiredo [Tue, 12 Mar 2013 21:35:14 +0000 (14:35 -0700)]
html/template: Ensure release of namespace mutex in Template.Execute()

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

12 years agomisc/bbedit, misc/notepadplus: remove executable bits from files.
Benny Siegert [Tue, 12 Mar 2013 21:29:25 +0000 (14:29 -0700)]
misc/bbedit, misc/notepadplus: remove executable bits from files.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/7765043

12 years agospec: rewrite the description of panic and recover.
Rob Pike [Tue, 12 Mar 2013 21:28:16 +0000 (14:28 -0700)]
spec: rewrite the description of panic and recover.
The old description was misleading and inaccurate.

Fixes #4774.

R=iant, rsc, gri
CC=golang-dev
https://golang.org/cl/7761044

12 years agotest/bench/garbage: fix parser benchmark
Jan Ziak [Tue, 12 Mar 2013 21:25:15 +0000 (22:25 +0100)]
test/bench/garbage: fix parser benchmark

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

12 years agogo/types: delete from main repo; part of move to go.exp
Rob Pike [Tue, 12 Mar 2013 20:55:58 +0000 (13:55 -0700)]
go/types: delete from main repo; part of move to go.exp
See also https://golang.org/cl/7656044

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

12 years agoencoding/xml: reject > chain with non-element
Russ Cox [Tue, 12 Mar 2013 20:42:25 +0000 (16:42 -0400)]
encoding/xml: reject > chain with non-element

Fixes #5033.

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

12 years agogo/printer, gofmt: avoid extra final comma in multi-line signatures
Robert Griesemer [Tue, 12 Mar 2013 20:07:15 +0000 (13:07 -0700)]
go/printer, gofmt: avoid extra final comma in multi-line signatures

The parameter list layout function was incorrectly computing the
end of the previous line in cases where a parameter type spanned
multiple lines. As a result, an extra (valid, but not needed)
comma was introduced before the paremeter list's closing parenthesis.

Fixes #4533.

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

12 years agogo/doc: set receiver type position for embedded methods
Robert Griesemer [Tue, 12 Mar 2013 20:06:55 +0000 (13:06 -0700)]
go/doc: set receiver type position for embedded methods

This was a bug that didn't manifest itself before CL 7674044;
but with that CL and without this fix, the go/doc tests fail.
(The bug fixed by 7674044 and the bug fixed here cancelled
each other out w/ respect to the go/doc tests).

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

12 years agonet: refactoring in preparation for integrated network poller
Dmitriy Vyukov [Tue, 12 Mar 2013 20:03:00 +0000 (00:03 +0400)]
net: refactoring in preparation for integrated network poller
Introduce pollDesc struct, to split netFD struct into fd-related
and poller-related parts.

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

12 years agoos/signal: windows is supported, update comment
Shenghou Ma [Tue, 12 Mar 2013 18:40:56 +0000 (02:40 +0800)]
os/signal: windows is supported, update comment
Fixes #5035.

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

12 years agoruntime: Fix plan9 aes hash initialization.
Keith Randall [Tue, 12 Mar 2013 18:03:16 +0000 (11:03 -0700)]
runtime: Fix plan9 aes hash initialization.

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

12 years agoeffective_go.html: fix semaphore example
Rob Pike [Tue, 12 Mar 2013 17:53:01 +0000 (10:53 -0700)]
effective_go.html: fix semaphore example
It didn't work properly according to the Go memory model.
Fixes #5023.

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

12 years agoruntime: faster & safer hash function
Keith Randall [Tue, 12 Mar 2013 17:47:44 +0000 (10:47 -0700)]
runtime: faster & safer hash function

Uses AES hardware instructions on 386/amd64 to implement
a fast hash function.  Incorporates a random key to
thwart hash collision DOS attacks.
Depends on CL#7548043 for new assembly instructions.

Update #3885
Helps some by making hashing faster.  Go time drops from
0.65s to 0.51s.

R=rsc, r, bradfitz, remyoudompheng, khr, dsymonds, minux.ma, elias.naur
CC=golang-dev
https://golang.org/cl/7543043

12 years agoruntime: fix build
Dmitriy Vyukov [Tue, 12 Mar 2013 17:39:49 +0000 (21:39 +0400)]
runtime: fix build

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

12 years agoruntime: add network polling support into scheduler
Dmitriy Vyukov [Tue, 12 Mar 2013 17:14:26 +0000 (21:14 +0400)]
runtime: add network polling support into scheduler
This is a part of the bigger change that moves network poller into runtime:
https://golang.org/cl/7326051/

R=golang-dev, bradfitz, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/7448048

12 years agoencoding/xml: name space bug fixes
Russ Cox [Tue, 12 Mar 2013 15:46:12 +0000 (11:46 -0400)]
encoding/xml: name space bug fixes

If two fields have the same name but different explicit name spaces,
treat as non-conflicting. This allows parsing common XML formats
that have ns1:tag and ns2:tag in the same XML element.
Fixes #4691.

Allow setting the default name space for unadorned tags, by
writing to Decoder.DefaultSpace. This allows turned the job of
parsing common XML formats that have tag and ns2:tag in the
same XML element into the first case by setting DefaultSpace="ns1".
Fixes #3703.

Use name space attributes when decoding.
Attach name space to attributes when encoding.
Could be done with fewer annotations, but semantically correct as is.
Fixes #3526.

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

12 years agonet/rpc/jsonrpc: nil pointer deference on invalid reply.
Adrian Nos [Tue, 12 Mar 2013 15:45:56 +0000 (11:45 -0400)]
net/rpc/jsonrpc: nil pointer deference on invalid reply.
Fixes #5006.

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

12 years agoA+C: Adrian Nos (individual CLA)
Russ Cox [Tue, 12 Mar 2013 15:45:30 +0000 (11:45 -0400)]
A+C: Adrian Nos (individual CLA)

Generated by addca.

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

12 years agoruntime: fix deadlock detector false negative
Dmitriy Vyukov [Tue, 12 Mar 2013 13:21:44 +0000 (17:21 +0400)]
runtime: fix deadlock detector false negative
The issue was that scvg is assigned *after* the scavenger goroutine is started,
so when the scavenger calls entersyscall() the g==scvg check can fail.
Fixes #5025.

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

12 years agoruntime: deflake TestStackMem
Dmitriy Vyukov [Tue, 12 Mar 2013 11:19:06 +0000 (15:19 +0400)]
runtime: deflake TestStackMem
The problem is that there are lots of dead G's from previous tests,
each dead G consumes 1 stack segment.
Fixes #5034.

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

12 years agonet/http: deflake test
Dmitriy Vyukov [Tue, 12 Mar 2013 08:52:49 +0000 (12:52 +0400)]
net/http: deflake test
Update #5005.

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

12 years agoencoding/base32, encoding/base64: fix issues with decoder whitespace handling
Philip K. Warren [Tue, 12 Mar 2013 05:50:10 +0000 (01:50 -0400)]
encoding/base32, encoding/base64: fix issues with decoder whitespace handling

Adds a new reader to filter newlines, which fixes errors seen in the
decoder chunking code. Found additional issues with whitespace handling
after the first padding character.
Fixes #4779.

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

12 years agoA+C: Philip K. Warren (individual CLA)
Russ Cox [Tue, 12 Mar 2013 05:50:03 +0000 (01:50 -0400)]
A+C: Philip K. Warren (individual CLA)

Generated by addca.

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

12 years agonet: never use backlog > 65535
Russ Cox [Tue, 12 Mar 2013 05:48:48 +0000 (01:48 -0400)]
net: never use backlog > 65535

The system call takes an int, but the kernel stores it in a uint16.
At least one Linux system sets /proc/sys/net/core/somaxconn
to 262144, which ends up being 0 in the uint16. Avoid being tricked.

FreeBSD sources also store the backlog in a uint16.
Assume the problem is systemic and fix it everywhere.

Fixes #5030.

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

12 years agoencoding/xml: fix spurious "no semicolon" in error
Russ Cox [Tue, 12 Mar 2013 04:29:36 +0000 (00:29 -0400)]
encoding/xml: fix spurious "no semicolon" in error

Noticed while doing other XML investigations.

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