]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

11 years agotime: expand acceptance of time zones when parsing
Rob Pike [Thu, 15 Aug 2013 06:42:54 +0000 (16:42 +1000)]
time: expand acceptance of time zones when parsing
I tried to make it absolutely correct but there are too many
conflicting definitions for the official list of time zones.
Since when we're parsing we know when to expect
a time zone and we know what they look like if not exactly
what the definitive set is, we compromise. We accept any
three-character sequence of upper case letters, possibly
followed by a capital T (all four-letter zones end in T).

There is one crazy special case (ChST) and the possibility
of a signed hour offset for GMT.

Fixes #3790
I hope forever, but I doubt that very much.

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

11 years agoarchive/zip: speed up Zip64 test
Brad Fitzpatrick [Thu, 15 Aug 2013 06:21:57 +0000 (23:21 -0700)]
archive/zip: speed up Zip64 test

Took 76 seconds or so before. By avoiding flate and crc32 on
4GB of data, it's now only 12 seconds.  Still a slow test, but
not painful to run anymore when you forget -short.

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

11 years agotesting: add TB, an interface common to T and B
Brad Fitzpatrick [Thu, 15 Aug 2013 06:21:32 +0000 (23:21 -0700)]
testing: add TB, an interface common to T and B

R=golang-dev, kevlar, rsc, adg, r
CC=golang-dev
https://golang.org/cl/12962043

11 years agoos/exec: document that LookPath's result may be a relative path
Rob Pike [Thu, 15 Aug 2013 04:29:04 +0000 (14:29 +1000)]
os/exec: document that LookPath's result may be a relative path
Fixes #3622

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

11 years agogo_spec.html: clarify that tags are part of struct type identity
Rob Pike [Thu, 15 Aug 2013 03:15:55 +0000 (13:15 +1000)]
go_spec.html: clarify that tags are part of struct type identity
One sentence says they're ignored, another says they take part.
Fix the first.

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

11 years agoruntime/race: add end-to-end test on windows
Alex Brainman [Thu, 15 Aug 2013 02:13:00 +0000 (12:13 +1000)]
runtime/race: add end-to-end test on windows

whatever "end-to-end" means here

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

11 years agocmd/go: fix bad error message in coverage for package without non-test files
Rob Pike [Thu, 15 Aug 2013 00:36:46 +0000 (10:36 +1000)]
cmd/go: fix bad error message in coverage for package without non-test files
Was checking for nil map; must check for empty map instead.

Fixes #6065

Before:

go test -cover
# testmain
/var/folders/00/013l0000h01000cxqpysvccm0004fc/T/go-build233480051/_/Users/r/issue/_test/_testmain.go:11: imported and not used: "_/Users/r/issue"
FAIL _/Users/r/issue [build failed]

Now:

go test -cover
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok   _/Users/r/issue 0.021s

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

11 years agotime: handle GMT possibly with offset
Rob Pike [Thu, 15 Aug 2013 00:10:49 +0000 (10:10 +1000)]
time: handle GMT possibly with offset

Update #3790
Handle time zones like GMT-8.
The more general time zone-matching problem is not yet resolved.

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

11 years agocmd/go: fix detached heads that are remnants of bad git clones.
David Symonds [Wed, 14 Aug 2013 23:44:23 +0000 (09:44 +1000)]
cmd/go: fix detached heads that are remnants of bad git clones.

Fixes #6042.

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

11 years agomisc/emacs: Allow go-coverage to work in existing coverage buffers by reusing previou...
Dominik Honnef [Wed, 14 Aug 2013 23:03:44 +0000 (16:03 -0700)]
misc/emacs: Allow go-coverage to work in existing coverage buffers by reusing previous arguments

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

11 years agoencoding/xml: support generic encoding interfaces
Russ Cox [Wed, 14 Aug 2013 22:52:09 +0000 (18:52 -0400)]
encoding/xml: support generic encoding interfaces

Remove custom support for time.Time.
No new tests: the tests for the time.Time special case
now test the general case.

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

11 years agocmd/go, runtime/cgo: explicitly target ARMv5T
Carl Shapiro [Wed, 14 Aug 2013 22:21:53 +0000 (15:21 -0700)]
cmd/go, runtime/cgo: explicitly target ARMv5T

The baseline architecture had been left to the GCC configured
default which can be more accomodating than the rest of the Go
toolchain.  This prevented instructions used by the 5g compiler,
like BLX, from being used in GCC compiled assembler code.

R=golang-dev, dave, rsc, elias.naur, cshapiro
CC=golang-dev
https://golang.org/cl/12954043

11 years agodoc: update go1.2.txt
Andrew Gerrand [Wed, 14 Aug 2013 22:13:38 +0000 (08:13 +1000)]
doc: update go1.2.txt

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

11 years agodoc: update go1.2.txt
Brad Fitzpatrick [Wed, 14 Aug 2013 21:56:31 +0000 (14:56 -0700)]
doc: update go1.2.txt

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

11 years agonet: simplify dial
Mikio Hara [Wed, 14 Aug 2013 20:53:53 +0000 (05:53 +0900)]
net: simplify dial

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

11 years agocmd/ld: Remove superfluous redundant iself check
Elias Naur [Wed, 14 Aug 2013 20:28:40 +0000 (16:28 -0400)]
cmd/ld: Remove superfluous redundant iself check

        CL 12741044 added an extra iself condition to an if statement that already contained it. Remove it.

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

11 years agoruntime: fix SetBlockProfileRate
Dmitriy Vyukov [Wed, 14 Aug 2013 20:20:36 +0000 (00:20 +0400)]
runtime: fix SetBlockProfileRate
It doughtily misses all possible corner cases.
In particular on machines with <1GHz processors,
SetBlockProfileRate(1) disables profiling.
Fixes #6114.

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

11 years agonet: simplify non-cgo DNS exchange
Mikio Hara [Wed, 14 Aug 2013 20:08:08 +0000 (05:08 +0900)]
net: simplify non-cgo DNS exchange

Also does less buffer allocation in case of TCP fallback.

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

11 years agonet: fix TestTCPLookup
Mikio Hara [Wed, 14 Aug 2013 20:07:35 +0000 (05:07 +0900)]
net: fix TestTCPLookup

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

11 years agodoc: update go1.2.txt
Russ Cox [Wed, 14 Aug 2013 19:37:23 +0000 (15:37 -0400)]
doc: update go1.2.txt

Will submit once I can fill in the CL XXX number.

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

11 years agocmd/5g, cmd/6g, cmd/8g: restore occurrences of R replaced by nil in comments.
Rémy Oudompheng [Wed, 14 Aug 2013 19:24:48 +0000 (21:24 +0200)]
cmd/5g, cmd/6g, cmd/8g: restore occurrences of R replaced by nil in comments.

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

11 years agoencoding/xml: add, support Marshaler interface
Russ Cox [Wed, 14 Aug 2013 18:58:28 +0000 (14:58 -0400)]
encoding/xml: add, support Marshaler interface

See golang.org/s/go12xml for design.

Repeat of CL 12603044, which was submitted accidentally
and then rolled back.

Fixes #2771.
Fixes #4169.
Fixes #5975.
Fixes #6125.

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

11 years agoencoding/xml: add, support Unmarshaler interface
Russ Cox [Wed, 14 Aug 2013 18:57:45 +0000 (14:57 -0400)]
encoding/xml: add, support Unmarshaler interface

See golang.org/s/go12xml for design.

R=golang-dev, dominik.honnef, dan.kortschak
CC=golang-dev
https://golang.org/cl/12556043

11 years agoencoding/json: support encoding.TextMarshaler, encoding.TextUnmarshaler
Russ Cox [Wed, 14 Aug 2013 18:56:07 +0000 (14:56 -0400)]
encoding/json: support encoding.TextMarshaler, encoding.TextUnmarshaler

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

11 years agoruntime: make SetFinalizer(x, f) accept any f for which f(x) is valid
Russ Cox [Wed, 14 Aug 2013 18:54:31 +0000 (14:54 -0400)]
runtime: make SetFinalizer(x, f) accept any f for which f(x) is valid

Originally the requirement was f(x) where f's argument is
exactly x's type.

CL 11858043 relaxed the requirement in a non-standard
way: f's argument must be exactly x's type or interface{}.

If we're going to relax the requirement, it should be done
in a way consistent with the rest of Go. This CL allows f's
argument to have any type for which x is assignable;
that's the same requirement the compiler would impose
if compiling f(x) directly.

Fixes #5368.

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

11 years agoruntime/cgo: use old-style indirect call on arm
Russ Cox [Wed, 14 Aug 2013 18:54:08 +0000 (14:54 -0400)]
runtime/cgo: use old-style indirect call on arm

TBR=elias.naur
CC=golang-dev
https://golang.org/cl/12943043

11 years agoruntime: fix windows build
Dmitriy Vyukov [Wed, 14 Aug 2013 18:18:49 +0000 (22:18 +0400)]
runtime: fix windows build

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

11 years agoruntime: implement SysUnused on windows
Dmitriy Vyukov [Wed, 14 Aug 2013 17:54:07 +0000 (21:54 +0400)]
runtime: implement SysUnused on windows
Fixes #5584.

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

11 years agonet: make TCPStress test shorter
Dmitriy Vyukov [Wed, 14 Aug 2013 17:53:27 +0000 (21:53 +0400)]
net: make TCPStress test shorter
It timeouts on freebsd builders:
http://build.golang.org/log/3d8169e13bff912bebf6fd3c54b34ad2d29a7221
but there are always runnable goroutines,
which suggests that it's slowly progressing.

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

11 years agoruntime: Fix build on older ARM
Elias Naur [Wed, 14 Aug 2013 17:50:12 +0000 (13:50 -0400)]
runtime: Fix build on older ARM

        The ARM external linking CL used BLX instructions in gcc assembler. Replace with BL to retain support on older ARM processors.

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

11 years agonet: make TestDeadlineRace shorter
Dmitriy Vyukov [Wed, 14 Aug 2013 17:20:11 +0000 (21:20 +0400)]
net: make TestDeadlineRace shorter
1. Do less iterations in short mode
2. Bound number of times SetDeadline is executed

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

11 years agoruntime: Fix netbsd/arm and freebsd/arm build
Elias Naur [Wed, 14 Aug 2013 17:18:32 +0000 (13:18 -0400)]
runtime: Fix netbsd/arm and freebsd/arm build

        The ARM external linking CL left missed changes to sys_freebsd_arm.s and sys_netbsd_arm.s already done to sys_linux_arm.s.

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

11 years agocmd/dist: fix darwin build
Russ Cox [Wed, 14 Aug 2013 16:57:05 +0000 (12:57 -0400)]
cmd/dist: fix darwin build

The TLS block on Darwin is not the same as on ELF.

TBR=elias.naur
CC=golang-dev
https://golang.org/cl/12741044

11 years agocmd/cgo: fix windows build
Elias Naur [Wed, 14 Aug 2013 16:47:06 +0000 (12:47 -0400)]
cmd/cgo: fix windows build

        The shared library changes broke the windows build because __attribute__ ((visibility ("hidden"))) is not supported in windows gcc. This change removes the attribute, as it is only needed when building shared libraries.

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

11 years agodatabase/sql: fix accumulation of bad conns on prepared statements
Matt Joiner [Wed, 14 Aug 2013 16:27:30 +0000 (09:27 -0700)]
database/sql: fix accumulation of bad conns on prepared statements

Fixes an issue where prepared statements that outlive many
connections become expensive to invoke.

Fixes #6081

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

11 years agoA+C: Matt Joiner (individual CLA)
Brad Fitzpatrick [Wed, 14 Aug 2013 16:22:26 +0000 (09:22 -0700)]
A+C: Matt Joiner (individual CLA)

Generated by addca.

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

11 years agoruntime.cmd/ld: Add ARM external linking and implement -shared in terms of external...
Elias Naur [Wed, 14 Aug 2013 15:38:54 +0000 (15:38 +0000)]
runtime.cmd/ld: Add ARM external linking and implement -shared in terms of external linking

This CL is an aggregate of 10271047104990439733044. Descriptions of each follow:

10499043
runtime,cmd/ld: Merge TLS symbols and teach 5l about ARM TLS

This CL prepares for external linking support to ARM.

The pseudo-symbols runtime.g and runtime.m are merged into a single
runtime.tlsgm symbol. When external linking, the offset of a thread local
variable is stored at a memory location instead of being embedded into a offset
of a ldr instruction. With a single runtime.tlsgm symbol for both g and m, only
one such offset is needed.

The larger part of this CL moves TLS code from gcc compiled to internally
compiled. The TLS code now uses the modern MRC instruction, and 5l is taught
about TLS fallbacks in case the instruction is not available or appropriate.

10271047
This CL adds support for -linkmode external to 5l.

For 5l itself, use addrel to allow for D_CALL relocations to be handled by the
host linker. Of the cases listed in rsc's comment in issue 4069, only case 5 and
63 needed an update. One of the TODO: addrel cases was since replaced, and the
rest of the cases are either covered by indirection through addpool (cases with
LTO or LFROM flags) or stubs (case 74). The addpool cases are covered because
addpool emits AWORD instructions, which in turn are handled by case 11.

In the runtime, change the argv argument in the rt0* functions slightly to be a
pointer to the argv list, instead of relying on a particular location of argv.

9733044
The -shared flag to 6l outputs a shared library, implemented in Go
and callable from non-Go programs such as C.

The main part of this CL change the thread local storage model.
Go uses the fastest and least general mode, local exec. TLS data in shared
libraries normally requires at least the local dynamic mode, however, this CL
instead opts for using the initial exec mode. Initial exec mode is faster than
local dynamic mode and can be used in linux since the linker has reserved a
limited amount of TLS space for performance sensitive TLS code.

Initial exec mode requires an extra load from the GOT table to determine the
TLS offset. This penalty will not be paid if ld is not in -shared mode, since
TLS accesses will be reduced to local exec.

The elf sections .init_array and .rela.init_array are added to register the Go
runtime entry with cgo at library load time.

The "hidden" attribute is added to Cgo functions called from Go, since Go
does not generate call through the GOT table, and adding non-GOT relocations for
a global function is not supported by gcc. Cgo symbols don't need to be global
and avoiding the GOT table is also faster.

The changes to 8l are only removes code relevant to the old -shared mode where
internal linking was used.

This CL only address the low level linker work. It can be submitted by itself,
but to be useful, the runtime changes in CL 9738047 is also needed.

Design discussion at
https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/zmjXkGrEx6Q

Fixes #5590.

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

11 years agoruntime: improve block profiler support for channels
Dmitriy Vyukov [Wed, 14 Aug 2013 09:56:01 +0000 (13:56 +0400)]
runtime: improve block profiler support for channels
1. Handle select statements.
2. Handle chan close.
3. Show top frame in debug mode (chansend/chanrecv/selectgo).
Fixes #6049.

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

11 years agosync/atomic: fix new swap on arm linux
Russ Cox [Wed, 14 Aug 2013 04:50:47 +0000 (00:50 -0400)]
sync/atomic: fix new swap on arm linux

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

11 years agocmd/5g: fix temp-merging on ARM
Russ Cox [Wed, 14 Aug 2013 04:34:18 +0000 (00:34 -0400)]
cmd/5g: fix temp-merging on ARM

mkvar was taking care of the "LeftAddr" case,
effectively hiding it from the temp-merging optimization.

Move it into prog.c.

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

11 years agotime: make Time implement encoding interfaces
Russ Cox [Wed, 14 Aug 2013 04:34:00 +0000 (00:34 -0400)]
time: make Time implement encoding interfaces

See golang.org/s/go12encoding for design.

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

11 years agonet: make IP implement encoding.MarshalerText, encoding.UnmarshalerText
Russ Cox [Wed, 14 Aug 2013 04:33:20 +0000 (00:33 -0400)]
net: make IP implement encoding.MarshalerText, encoding.UnmarshalerText

See golang.org/s/go12encoding for design.

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

11 years agoundo CL 12603044 / 2ca230b93195
Russ Cox [Wed, 14 Aug 2013 04:20:55 +0000 (00:20 -0400)]
undo CL 12603044 / 2ca230b93195

fat fingers - did not intend to submit.
depends on the Unmarshaler CL anyway.

««« original CL description
encoding/xml: add, support Marshaler interface

See golang.org/s/go12xml for design.

Fixes #2771.
Fixes #4169.
Fixes #5975.
Fixes #6125.

R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://golang.org/cl/12603044
»»»

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

11 years agoencoding/gob: support new generic interfaces in package encoding
Russ Cox [Wed, 14 Aug 2013 04:18:48 +0000 (00:18 -0400)]
encoding/gob: support new generic interfaces in package encoding

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

11 years agoencoding: new package
Russ Cox [Wed, 14 Aug 2013 04:18:20 +0000 (00:18 -0400)]
encoding: new package

See golang.org/s/go12encoding for design.

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

11 years agoencoding/xml: add, support Marshaler interface
Russ Cox [Wed, 14 Aug 2013 04:17:42 +0000 (00:17 -0400)]
encoding/xml: add, support Marshaler interface

See golang.org/s/go12xml for design.

Fixes #2771.
Fixes #4169.
Fixes #5975.
Fixes #6125.

R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://golang.org/cl/12603044

11 years agomisc/notepadplus: support Calltips
ChaiShushan [Wed, 14 Aug 2013 03:41:36 +0000 (13:41 +1000)]
misc/notepadplus: support Calltips

Fixes #5789.

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

11 years agocmd/go: add -t flag to 'go get' to download test dependencies
Andrew Gerrand [Wed, 14 Aug 2013 01:01:17 +0000 (11:01 +1000)]
cmd/go: add -t flag to 'go get' to download test dependencies

Fixes #5126.

R=golang-dev, dsymonds, bradfitz, r, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/12566046

11 years agoruntime: fix build on arm
Russ Cox [Tue, 13 Aug 2013 23:37:54 +0000 (19:37 -0400)]
runtime: fix build on arm

Do not use ? :
I cannot say this enough.

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

11 years agoarchive/zip: add File.DataOffset
Brad Fitzpatrick [Tue, 13 Aug 2013 23:29:51 +0000 (16:29 -0700)]
archive/zip: add File.DataOffset

Accessor to find where the bytes of a file start.

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

11 years agonet: make Dial, Listen and ListenPacket return consistent error value
Mikio Hara [Tue, 13 Aug 2013 22:04:39 +0000 (07:04 +0900)]
net: make Dial, Listen and ListenPacket return consistent error value

Update #4856

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

11 years agodatabase/sql: add a disabled broken test
Brad Fitzpatrick [Tue, 13 Aug 2013 21:56:40 +0000 (14:56 -0700)]
database/sql: add a disabled broken test

Update #6081

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

11 years agoarchive/zip: remove an allocation, speed up a test
Brad Fitzpatrick [Tue, 13 Aug 2013 21:48:08 +0000 (14:48 -0700)]
archive/zip: remove an allocation, speed up a test

Update #6138

TestOver65kFiles spends all its time garbage collecting.
Removing the 1.4 MB of allocations per each of the 65k
files brings this from 34 seconds to 0.23 seconds.

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

11 years agoencoding/binary: make Write work like Read
Rob Pike [Tue, 13 Aug 2013 21:03:56 +0000 (07:03 +1000)]
encoding/binary: make Write work like Read
Use the fast path calculation to shorten the code.
No effect on benchmarks.

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

11 years agocmd/go: nicer error diagnosis in go test
Rob Pike [Tue, 13 Aug 2013 21:03:18 +0000 (07:03 +1000)]
cmd/go: nicer error diagnosis in go test
Before,
        go test -bench .
would just dump the long generic "go help" message. Confusing and
unhelpful. Now the message is short and on point and also reminds the
user about the oft-forgotten "go help testflag".

        % go test -bench
        go test: missing argument for flag bench
        run "go help test" or "go help testflag" for more information
        %

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

11 years agonet: fix build fix
Dmitriy Vyukov [Tue, 13 Aug 2013 20:55:18 +0000 (00:55 +0400)]
net: fix build fix
Now builders say:
pkg/net/dnsclient_unix_test.go:10: imported and not used: "runtime"

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

11 years agonet: fix windows build
Dmitriy Vyukov [Tue, 13 Aug 2013 20:44:57 +0000 (00:44 +0400)]
net: fix windows build
Windows builders say:
pkg\net\dnsclient_unix_test.go:24: undefined: dnsConfig
pkg\net\dnsclient_unix_test.go:25: undefined: exchange

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

11 years agoruntime: dump scheduler state if GODEBUG=schedtrace is set
Dmitriy Vyukov [Tue, 13 Aug 2013 20:30:55 +0000 (00:30 +0400)]
runtime: dump scheduler state if GODEBUG=schedtrace is set
The schedtrace value sets dump period in milliseconds.
In default mode the trace looks as follows:
SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 [1 0 0 0]
SCHED 1001ms: gomaxprocs=4 idleprocs=3 threads=6 idlethreads=3 runqueue=0 [0 0 0 0]
SCHED 2008ms: gomaxprocs=4 idleprocs=1 threads=6 idlethreads=1 runqueue=0 [0 1 0 0]
If GODEBUG=scheddetail=1 is set as well, then the detailed trace is printed:
SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 singleproc=0 gcwaiting=1 mlocked=0 nmspinning=0 stopwait=0 sysmonwait=0
  P0: status=3 tick=1 m=0 runqsize=1/128 gfreecnt=0
  P1: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  P2: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  P3: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  M2: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1
  M1: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1
  M0: p=0 curg=1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=1
  G1: status=2() m=0 lockedm=0
  G2: status=1() m=-1 lockedm=-1

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

11 years agosync/atomic: update comment for ARM 64-bit atomics
Russ Cox [Tue, 13 Aug 2013 20:16:05 +0000 (16:16 -0400)]
sync/atomic: update comment for ARM 64-bit atomics

They don't work on older chips, just like the x86-32 64-bit atomics.

Update #6134

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

11 years agoundo CL 12840043 / 3b9f54db72a1
Keith Randall [Tue, 13 Aug 2013 19:59:39 +0000 (12:59 -0700)]
undo CL 12840043 / 3b9f54db72a1

Breaks the build.  Old bucket arrays kept by iterators
still need to be scanned.

««« original CL description
runtime: tell GC not to scan internal hashmap structures.
We'll do it ourselves via hash_gciter, thanks.
Fixes bug 6119.

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

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

11 years agoruntime: tell GC not to scan internal hashmap structures.
Keith Randall [Tue, 13 Aug 2013 19:36:03 +0000 (12:36 -0700)]
runtime: tell GC not to scan internal hashmap structures.
We'll do it ourselves via hash_gciter, thanks.
Fixes bug 6119.

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

11 years agoundo CL 12787044 / ed695cdf962b
Russ Cox [Tue, 13 Aug 2013 19:33:49 +0000 (23:33 +0400)]
undo CL 12787044 / ed695cdf962b

The NetBSD and OpenBSD failures are apparently real,
not due to the test bug fixed in 100b9fc0c46f.

««« original CL description
runtime/pprof: test netbsd and openbsd again

Maybe these will work now.

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

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

11 years agoruntime: fix LockOSThread
Dmitriy Vyukov [Tue, 13 Aug 2013 18:37:04 +0000 (22:37 +0400)]
runtime: fix LockOSThread
Fixes #6100.

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

11 years agoruntime: more reliable preemption
Dmitriy Vyukov [Tue, 13 Aug 2013 18:14:04 +0000 (22:14 +0400)]
runtime: more reliable preemption
Currently it's possible that a goroutine
that periodically executes non-blocking
cgo/syscalls is never preempted.
This change splits scheduler and syscall
ticks to prevent such situation.

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

11 years agoruntime: do no lose CPU profiling signals
Dmitriy Vyukov [Tue, 13 Aug 2013 18:12:02 +0000 (22:12 +0400)]
runtime: do no lose CPU profiling signals
Currently we lose lots of profiling signals.
Most notably, GC is not accounted at all.
But stack splits, scheduler, syscalls, etc are lost as well.
This creates seriously misleading profile.
With this change all profiling signals are accounted.
Now I see these additional entries that were previously absent:
161  29.7%  29.7%      164  30.3% syscall.Syscall
 12   2.2%  50.9%       12   2.2% scanblock
 11   2.0%  55.0%       11   2.0% markonly
 10   1.8%  58.9%       10   1.8% sweepspan
  2   0.4%  85.8%        2   0.4% runtime.newstack
It is still impossible to understand what causes stack splits,
but at least it's clear how many time is spent on them.
Update #2197.
Update #5659.

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

11 years agoruntime: fix false deadlock crash
Dmitriy Vyukov [Tue, 13 Aug 2013 18:07:42 +0000 (22:07 +0400)]
runtime: fix false deadlock crash
Fixes #6070.
Update #6055.

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

11 years agosync/atomic: fix ARM nomenclature in comments
Dmitriy Vyukov [Tue, 13 Aug 2013 18:07:21 +0000 (22:07 +0400)]
sync/atomic: fix ARM nomenclature in comments

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

11 years agoio: prevent write to PipeWriter after Close
Rick Arnold [Tue, 13 Aug 2013 18:04:09 +0000 (11:04 -0700)]
io: prevent write to PipeWriter after Close

Return an ErrClosedPipe rather than allowing the write to proceed.

Fixes #5330.

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