]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agonet/http: explain the "1.1" in the default User-Agent
Russ Cox [Thu, 12 Sep 2013 00:28:14 +0000 (20:28 -0400)]
net/http: explain the "1.1" in the default User-Agent

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

11 years agospec: define s[i:j:k]
Robert Griesemer [Thu, 12 Sep 2013 00:18:52 +0000 (17:18 -0700)]
spec: define s[i:j:k]

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

11 years agodoc/go1.2.html: status of gccgo's support for 1.2
Rob Pike [Thu, 12 Sep 2013 00:12:26 +0000 (10:12 +1000)]
doc/go1.2.html: status of gccgo's support for 1.2

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

11 years agoA+C: Noah Campbell (individual CLA)
Andrew Gerrand [Thu, 12 Sep 2013 00:11:51 +0000 (10:11 +1000)]
A+C: Noah Campbell (individual CLA)

Generated by addca.

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

11 years agodoc/go1.2.html: some library changes (fmt, template)
Rob Pike [Wed, 11 Sep 2013 23:08:59 +0000 (09:08 +1000)]
doc/go1.2.html: some library changes (fmt, template)
Also link it to the landing page for docs.

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

11 years agocmd/gc: inline copy in frontend to call memmove directly.
Rémy Oudompheng [Wed, 11 Sep 2013 22:15:28 +0000 (00:15 +0200)]
cmd/gc: inline copy in frontend to call memmove directly.

A new node type OSPTR is added to refer to the data pointer of
strings and slices in a simple way during walk(). It will be
useful for future work on simplification of slice arithmetic.

benchmark                  old ns/op    new ns/op    delta
BenchmarkCopy1Byte                 9            8  -13.98%
BenchmarkCopy2Byte                14            8  -40.49%
BenchmarkCopy4Byte                13            8  -35.04%
BenchmarkCopy8Byte                13            8  -37.10%
BenchmarkCopy12Byte               14           12  -15.38%
BenchmarkCopy16Byte               14           12  -17.24%
BenchmarkCopy32Byte               19           14  -27.32%
BenchmarkCopy128Byte              31           26  -15.29%
BenchmarkCopy1024Byte            100           92   -7.50%
BenchmarkCopy1String              10            7  -28.99%
BenchmarkCopy2String              10            7  -28.06%
BenchmarkCopy4String              10            8  -22.69%
BenchmarkCopy8String              10            8  -23.30%
BenchmarkCopy12String             11           11   -5.88%
BenchmarkCopy16String             11           11   -5.08%
BenchmarkCopy32String             15           14   -6.58%
BenchmarkCopy128String            28           25  -10.60%
BenchmarkCopy1024String           95           95   +0.53%

R=golang-dev, bradfitz, cshapiro, dave, daniel.morsing, rsc, khr, khr
CC=golang-dev
https://golang.org/cl/9101048

11 years agocmd/5g, cmd/6g, cmd/8g: remove O(n) reset loop in copyprop
Russ Cox [Wed, 11 Sep 2013 19:22:11 +0000 (15:22 -0400)]
cmd/5g, cmd/6g, cmd/8g: remove O(n) reset loop in copyprop

Simpler version of CL 13084043.

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

11 years agoundo CL 13084043 / ef4ee02a5853
Russ Cox [Wed, 11 Sep 2013 19:14:11 +0000 (15:14 -0400)]
undo CL 13084043 / ef4ee02a5853

There is a cleaner, simpler way.

««« original CL description
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
»»»

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

11 years agocmd/gc: allow x[i:j:k] (and x[:j:k]) into the release
Russ Cox [Wed, 11 Sep 2013 18:55:46 +0000 (14:55 -0400)]
cmd/gc: allow x[i:j:k] (and x[:j:k]) into the release

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

11 years agocmd/api: fix tool for recent go/build change
Russ Cox [Wed, 11 Sep 2013 18:42:34 +0000 (14:42 -0400)]
cmd/api: fix tool for recent go/build change

Asking about runtime/cgo when CgoEnabled=false now correctly
returns an error from build.Import (specifically, NoGoError), because
there are no buildable Go files in that directory.

The API tool was depending on it returning a package with no Go
files instead. Correct that assumption.

Fixes all.bash on local machines.
(Dashboard appears not to be running the api tool at all.)

Update #6124

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

11 years agoundo CL 13632053 / dc7bfe0f022d
Russ Cox [Wed, 11 Sep 2013 18:35:08 +0000 (14:35 -0400)]
undo CL 13632053 / dc7bfe0f022d

It was never going to last.

««« original CL description
cmd/api: break the builds

There is some question about whether the api tool is
running on Windows (see issue 6124), and now I'm
starting to question whether it runs on any of the builders,
since both darwin/amd64 and linux/amd64 are crashing for me
in the api tool due to a recent cgo-related change, and yet
the dashboard is happy.

If the dashboard is still happy after this CL, we have a problem.

Update #6124

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

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

11 years agocmd/api: break the builds
Russ Cox [Wed, 11 Sep 2013 18:34:11 +0000 (14:34 -0400)]
cmd/api: break the builds

There is some question about whether the api tool is
running on Windows (see issue 6124), and now I'm
starting to question whether it runs on any of the builders,
since both darwin/amd64 and linux/amd64 are crashing for me
in the api tool due to a recent cgo-related change, and yet
the dashboard is happy.

If the dashboard is still happy after this CL, we have a problem.

Update #6124

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

11 years agoruntime: keep args and frame in struct Func
Russ Cox [Wed, 11 Sep 2013 18:18:52 +0000 (14:18 -0400)]
runtime: keep args and frame in struct Func

args is useful for printing tracebacks.

frame is not necessary anymore, but we might some day
get back to functions where the frame size does not vary
by program counter, and if so we'll need it. Avoid needing
to introduce a new struct format later by keeping it now.

Fixes #5907.

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

11 years agogo/build: reject directory with only cgo files if cgo not in use
Russ Cox [Wed, 11 Sep 2013 17:25:30 +0000 (13:25 -0400)]
go/build: reject directory with only cgo files if cgo not in use

The old test for "no Go files" was p.Name == "", meaning we never
saw a Go package statement. That test fails if there are cgo files
that we parsed (and recorded the package name) but then chose
not to use (because cgo is not available).

Test the actual file lists instead.

Fixes #6078.

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

11 years agocmd/yacc: replace units example with simpler expr example
Ian Lance Taylor [Wed, 11 Sep 2013 16:01:47 +0000 (09:01 -0700)]
cmd/yacc: replace units example with simpler expr example

The units example is nice but is covered by the Lucent
license, which may be a concern for some people making a
commercial source code distribution of Go.

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

11 years agoruntime: show m stack during crash on m stack
Russ Cox [Wed, 11 Sep 2013 16:00:37 +0000 (12:00 -0400)]
runtime: show m stack during crash on m stack

The various throwing > 0 finish a change started
in a previous CL, which sets throwing = -1 to mean
"don't show the internals". That gets set during the
"all goroutines are asleep - deadlock!" crash, and it
should also be set during any other expected crash
that does not indicate a problem within the runtime.

Most runtime.throw do indicate a problem within the
runtime, however, so we should be able to enumerate
the ones that should be silent. The goroutine sleeping
deadlock is the only one I can think of.

Update #5139

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

11 years agoruntime: show runtime.panic frame in traceback
Russ Cox [Wed, 11 Sep 2013 15:59:19 +0000 (11:59 -0400)]
runtime: show runtime.panic frame in traceback

Otherwise, if panic starts running deferred functions,
the code that panicked appears to be calling those
functions directly, which is not the case and can be
confusing.

For example:

main.Two()
        /Users/rsc/x.go:12 +0x2a
runtime.panic(0x20dc0, 0x2100cc010)
        /Users/rsc/g/go/src/pkg/runtime/panic.c:248 +0x106
main.One()
        /Users/rsc/x.go:8 +0x55

This makes clear(er) that main.Two is being called during
a panic, not as a direct call from main.One.

Fixes #5832.

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

11 years agonet: defend against broken getaddrinfo on Linux
Russ Cox [Wed, 11 Sep 2013 15:38:56 +0000 (11:38 -0400)]
net: defend against broken getaddrinfo on Linux

getaddrinfo is supposed to set errno when it returns
EAI_SYSTEM, but sometimes it does not.

Fixes #6232.

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

11 years agocmd/cgo: replace C.malloc with our own wrapper
Russ Cox [Wed, 11 Sep 2013 15:30:08 +0000 (11:30 -0400)]
cmd/cgo: replace C.malloc with our own wrapper

This allows us to make two changes:

1. Force the argument type to be size_t, even on broken
   systems that declare malloc to take a ulong.

2. Call runtime.throw if malloc fails.
   (That is, the program crashes; it does not panic.)

Fixes #3403.
Fixes #5926.

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

11 years agonet: implement TCP connection setup with fast failover
Mikio Hara [Wed, 11 Sep 2013 14:48:53 +0000 (10:48 -0400)]
net: implement TCP connection setup with fast failover

This CL adds minimal support of Happy Eyeballs-like TCP connection
setup to Dialer API. Happy Eyeballs and derivation techniques are
described in the following:

- Happy Eyeballs: Success with Dual-Stack Hosts
  http://tools.ietf.org/html/rfc6555

- Analysing Dual Stack Behaviour and IPv6 Quality
  http://www.potaroo.net/presentations/2012-04-17-dual-stack-quality.pdf

Usually, the techniques consist of three components below.

- DNS query racers, that run A and AAAA queries in parallel or series
- A short list of destination addresses
- TCP SYN racers, that run IPv4 and IPv6 transport in parallel or series

This CL implements only the latter two. The existing DNS query
component gathers together A and AAAA records in series, so we don't
touch it here. This CL just uses extended resolveInternetAddr and makes
it possible to run multiple Dial racers in parallel.

For example, when the given destination is a DNS name and the name has
multiple address family A and AAAA records, and it happens on the TCP
wildcard network "tcp" with DualStack=true like the following:

(&net.Dialer{DualStack: true}).Dial("tcp", "www.example.com:80")

The function will return a first established connection either TCP over
IPv4 or TCP over IPv6, and close the other connection internally.

Fixes #3610.
Fixes #5267.

Benchmark results on freebsd/amd64 virtual machine, tip vs. tip+12416043:

benchmark                           old ns/op    new ns/op    delta
BenchmarkTCP4OneShot                    50696        52141   +2.85%
BenchmarkTCP4OneShotTimeout             65775        66426   +0.99%
BenchmarkTCP4Persistent                 10986        10457   -4.82%
BenchmarkTCP4PersistentTimeout          11207        10445   -6.80%
BenchmarkTCP6OneShot                    62009        63718   +2.76%
BenchmarkTCP6OneShotTimeout             78351        79138   +1.00%
BenchmarkTCP6Persistent                 14695        14659   -0.24%
BenchmarkTCP6PersistentTimeout          15032        14646   -2.57%
BenchmarkTCP4ConcurrentReadWrite         7215         6217  -13.83%
BenchmarkTCP6ConcurrentReadWrite         7528         7493   -0.46%

benchmark                          old allocs   new allocs    delta
BenchmarkTCP4OneShot                       36           36    0.00%
BenchmarkTCP4OneShotTimeout                36           36    0.00%
BenchmarkTCP4Persistent                     0            0     n/a%
BenchmarkTCP4PersistentTimeout              0            0     n/a%
BenchmarkTCP6OneShot                       37           37    0.00%
BenchmarkTCP6OneShotTimeout                37           37    0.00%
BenchmarkTCP6Persistent                     0            0     n/a%
BenchmarkTCP6PersistentTimeout              0            0     n/a%
BenchmarkTCP4ConcurrentReadWrite            0            0     n/a%
BenchmarkTCP6ConcurrentReadWrite            0            0     n/a%

benchmark                           old bytes    new bytes    delta
BenchmarkTCP4OneShot                     2500         2503    0.12%
BenchmarkTCP4OneShotTimeout              2508         2505   -0.12%
BenchmarkTCP4Persistent                     0            0     n/a%
BenchmarkTCP4PersistentTimeout              0            0     n/a%
BenchmarkTCP6OneShot                     2713         2707   -0.22%
BenchmarkTCP6OneShotTimeout              2722         2720   -0.07%
BenchmarkTCP6Persistent                     0            0     n/a%
BenchmarkTCP6PersistentTimeout              0            0     n/a%
BenchmarkTCP4ConcurrentReadWrite            0            0     n/a%
BenchmarkTCP6ConcurrentReadWrite            0            0     n/a%

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

11 years agocmd/go: use pattern to prune file tree walk
Russ Cox [Wed, 11 Sep 2013 13:57:05 +0000 (09:57 -0400)]
cmd/go: use pattern to prune file tree walk

For example, if the pattern is m... there is
no need to look in directories not beginning with m.

Fixes #5214.

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

11 years agocmd/cgo: don't say "gcc produced no output" if we ran clang
Russ Cox [Wed, 11 Sep 2013 13:56:51 +0000 (09:56 -0400)]
cmd/cgo: don't say "gcc produced no output" if we ran clang

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

11 years agomisc/cgo/test: test of issue 4339
Russ Cox [Wed, 11 Sep 2013 13:56:38 +0000 (09:56 -0400)]
misc/cgo/test: test of issue 4339

This is not quite what that issue reports,
because this does not involve a DLL.
But I wanted to make sure this much was working.

Update #4339

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

11 years agobytes: additional test coverage
Dave Cheney [Wed, 11 Sep 2013 11:20:15 +0000 (21:20 +1000)]
bytes: additional test coverage

Add coverage for some uncovered bytes methods. The increase in actual coverage is disapointing small.

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

11 years agocmd/api: make api check directory per-user
Robert Daniel Kortschak [Wed, 11 Sep 2013 00:50:56 +0000 (10:50 +1000)]
cmd/api: make api check directory per-user

Fixes #6353.

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

11 years agocmd/go: report correct directory for 'no version control'
Russ Cox [Tue, 10 Sep 2013 19:28:29 +0000 (15:28 -0400)]
cmd/go: report correct directory for 'no version control'

The scan starts at the directory we care about and works
backward to the GOPATH root. The error should say the
original directory name, not the name of the GOPATH root.

Fixes #6175.

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

11 years agobuild: more "undefined behavior" fixes
Russ Cox [Tue, 10 Sep 2013 18:54:55 +0000 (14:54 -0400)]
build: more "undefined behavior" fixes

Fixes #5764.

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

11 years agocmd/6l, cmd/8l: fix MOVL MOVQ optab
Russ Cox [Tue, 10 Sep 2013 18:53:41 +0000 (14:53 -0400)]
cmd/6l, cmd/8l: fix MOVL MOVQ optab

The entry for LEAL/LEAQ in these optabs was listed as having
two data bytes in the y array. In fact they had and expect no data
bytes. However, the general loop expects to be able to look at at
least one data byte, to make sure it is not 0x0f. So give them each
a single data byte set to 0 (not 0x0f).

Since the MOV instructions have the largest optab cases, this
requires growing the size of the data array.

Clang found this bug because the general o->op[z] == 0x0f
test was using z == 22, which was out of bounds.

In practice the next byte in memory was probably not 0x0f
so it wasn't truly broken. But might as well be clean.

Update #5764

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

11 years agolibmach: accept OS X binary generated by external linker
Arnaud Ysmal [Tue, 10 Sep 2013 18:50:34 +0000 (11:50 -0700)]
libmach: accept OS X binary generated by external linker

Fixes cpu subtype check when using external linker which sets the CPU_SUBTYPE_LIB64 bit (1<<31).
Fixes #6197.

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

11 years agoA+C: Arnaud Ysmal (individual CLA)
Brad Fitzpatrick [Tue, 10 Sep 2013 18:49:35 +0000 (11:49 -0700)]
A+C: Arnaud Ysmal (individual CLA)

Generated by addca.

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

11 years agocmd/go: show FAIL for errors during test setup
Russ Cox [Tue, 10 Sep 2013 18:43:57 +0000 (14:43 -0400)]
cmd/go: show FAIL for errors during test setup

For example, if an x_test.go file contains a syntax error,
b.test fails with an error message. But it wasn't printing
the same FAIL line that a build failure later would print.
This makes all the test failures that happen (once we
decide to start running tests) consistently say FAIL.

Fixes #4701.

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

11 years agocmd/go: fix go test using package main_test
Russ Cox [Tue, 10 Sep 2013 18:43:35 +0000 (14:43 -0400)]
cmd/go: fix go test using package main_test

A package main binary (that is, a command) being installed
does not mean we can skip the build of the package archive
during a test.

Fixes #3417.

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

11 years agocmd/go: run benchmarks in sequence
Russ Cox [Tue, 10 Sep 2013 18:43:21 +0000 (14:43 -0400)]
cmd/go: run benchmarks in sequence

Fixes #5662.

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

11 years agogo/doc: restore handling of multi-paragraph BUG comments
Russ Cox [Tue, 10 Sep 2013 18:41:20 +0000 (14:41 -0400)]
go/doc: restore handling of multi-paragraph BUG comments

It was lost when the generic "Notes" support went in.

Had to change the test setup, because it precluded even
being able test multi-line comments, much less multi-paragraph
comments.

Now 'godoc sync/atomic' works correctly again.

Fixes #6135.

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

11 years agocmd/go: fix error for 'go install x.go' when GOBIN is not set
Russ Cox [Tue, 10 Sep 2013 18:41:07 +0000 (14:41 -0400)]
cmd/go: fix error for 'go install x.go' when GOBIN is not set

Fixes #6191.
Fixes #5426.

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

11 years agocmd/go: report real package in errors for go get with wildcard
Ian Lance Taylor [Tue, 10 Sep 2013 18:27:29 +0000 (11:27 -0700)]
cmd/go: report real package in errors for go get with wildcard

Fixes #5054.

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

11 years agocmd/go: build SWIG shared libraries in work directory
Ian Lance Taylor [Tue, 10 Sep 2013 18:00:26 +0000 (11:00 -0700)]
cmd/go: build SWIG shared libraries in work directory

Remove test of whether SWIG shared library is older than
sources--should be covered by test of package file anyhow.

Fixes #5739.

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

11 years agocmd/go: better error for shadowed directories in GOPATH
Russ Cox [Tue, 10 Sep 2013 17:17:21 +0000 (13:17 -0400)]
cmd/go: better error for shadowed directories in GOPATH

Fixes #5774.

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

11 years agoruntime: explicit init of runtime-gdb helpers
Alexis Imperial-Legrand [Tue, 10 Sep 2013 17:00:08 +0000 (13:00 -0400)]
runtime: explicit init of runtime-gdb helpers

If using other gdb python scripts loaded before Go's gdb-runtime.py
and that have a different init prototype:
Traceback (most recent call last):
  File "/usr/lib/go/src/pkg/runtime/runtime-gdb.py", line 446, in <module>
    k()
TypeError: __init__() takes exactly 3 arguments (1 given)

The problem is that gdb keeps all python scripts in the same namespace,
so vars() contains them. To avoid that, load helpers one by one.

R=iant, rsc
CC=gobot, golang-dev
https://golang.org/cl/9752044

11 years agoCONTRIBUTORS: add Alexis Imperial-Legrand (Google CLA)
Russ Cox [Tue, 10 Sep 2013 17:00:01 +0000 (13:00 -0400)]
CONTRIBUTORS: add Alexis Imperial-Legrand (Google CLA)

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

11 years agocmd/go: fix build -n output when using swig
Russ Cox [Tue, 10 Sep 2013 16:55:07 +0000 (12:55 -0400)]
cmd/go: fix build -n output when using swig

$INTBITS will not be defined, of course, but that's the best we can do.

Fixes #5978.

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

11 years agocmd/go: implement -x correctly for 'go vet', 'go fmt', and so on
Russ Cox [Tue, 10 Sep 2013 16:47:52 +0000 (12:47 -0400)]
cmd/go: implement -x correctly for 'go vet', 'go fmt', and so on

Fixes #5676.

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

11 years agogo/build: allow $ in cgo LDFLAGS
Russ Cox [Tue, 10 Sep 2013 16:47:43 +0000 (12:47 -0400)]
go/build: allow $ in cgo LDFLAGS

Fixes #6038.

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

11 years agolibmach: change three more BGET macro invocations back
Russ Cox [Tue, 10 Sep 2013 16:24:43 +0000 (12:24 -0400)]
libmach: change three more BGET macro invocations back

Various compilers complain about the macro expansion not
being used. I fixed a few yesterday. More today.

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

11 years agoruntime: clean up / align comment tabbing
Keith Randall [Tue, 10 Sep 2013 16:02:22 +0000 (09:02 -0700)]
runtime: clean up / align comment tabbing

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

11 years agonet: remove dreg of obsoleted network poller
Mikio Hara [Tue, 10 Sep 2013 11:00:21 +0000 (20:00 +0900)]
net: remove dreg of obsoleted network poller

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

11 years agodoc/go1.2.html: introduction, language changes
Rob Pike [Tue, 10 Sep 2013 05:13:45 +0000 (15:13 +1000)]
doc/go1.2.html: introduction, language changes

R=golang-dev, remyoudompheng, dominik.honnef, adg
CC=golang-dev
https://golang.org/cl/13341049

11 years agoos/exec: change windows LookPath so it works like cmd.exe
Alex Brainman [Tue, 10 Sep 2013 04:50:29 +0000 (14:50 +1000)]
os/exec: change windows LookPath so it works like cmd.exe

Fixes #6224

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

11 years agoencoding/json: document actual behavior for Unmarshal into interface{}
Russ Cox [Mon, 9 Sep 2013 23:11:05 +0000 (19:11 -0400)]
encoding/json: document actual behavior for Unmarshal into interface{}

Fixes #4900.

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

11 years agocontainer/list: unexpected panic if Next/Prev called outside of list.
Richard Eric Gavaletz [Mon, 9 Sep 2013 22:41:36 +0000 (15:41 -0700)]
container/list: unexpected panic if Next/Prev called outside of list.

Before CL 7065067 calling Next on an element returned either the
next/prev element or nil was returned.  After the CL if an element
was not part of a list e.Next() and e.Prev() will panic.  This CL
returns to the documented behavior, that Next/Prev returns the
next/prev list element or nil.

Fixes #6349.

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

11 years agopath/filepath: fix race with other tests
Russ Cox [Mon, 9 Sep 2013 20:42:18 +0000 (16:42 -0400)]
path/filepath: fix race with other tests

Bug3486 tried to walk the entire file tree, but other tests might
be creating and removing files in that tree. In particular, package os
creates and removes files in the os directory, and issue 5863
reports failures due to seeing those files appear and then disappear.

Change the test to walk just the test tree, which should not be
changing.

Fixes #5863.

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

11 years agoencoding/xml: fix panic in Marshal
Russ Cox [Mon, 9 Sep 2013 20:42:07 +0000 (16:42 -0400)]
encoding/xml: fix panic in Marshal

Fixes #6341.

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

11 years agosyslog: fix data race on 'crashy' in test function
Russ Cox [Mon, 9 Sep 2013 20:17:59 +0000 (16:17 -0400)]
syslog: fix data race on 'crashy' in test function

Fixes #5894.

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

11 years agolog/syslog: use alternate format for logging to local syslog daemon
Russ Cox [Mon, 9 Sep 2013 20:17:44 +0000 (16:17 -0400)]
log/syslog: use alternate format for logging to local syslog daemon

Fixes #5803.
Is it correct behavior? Who knows.

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

11 years agocmd/go: if there are C++ sources, use g++ as default external linker
Ian Lance Taylor [Mon, 9 Sep 2013 19:50:49 +0000 (12:50 -0700)]
cmd/go: if there are C++ sources, use g++ as default external linker

This will bring in the C++ standard library without requiring
any special #cgo LDFLAGS options.

When using gccgo, just add -lstdc++ to link line; this should
do no harm if it is not needed.

No tests, since we don't want to assume a C++ compiler.

Update #5629

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

11 years agobuild: remove various uses of C undefined behavior
Russ Cox [Mon, 9 Sep 2013 19:07:23 +0000 (15:07 -0400)]
build: remove various uses of C undefined behavior

If you thought gcc -ansi -pedantic was pedantic, just wait
until you meet clang -fsanitize=undefined.

I think this addresses all the reported "errors", but we'll
need another run to be sure.

all.bash still passes.

Update #5764

Dave, can you please try again?

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

11 years agoruntime: remove OABI check from ARM startup
Russ Cox [Mon, 9 Sep 2013 19:06:05 +0000 (15:06 -0400)]
runtime: remove OABI check from ARM startup

The code in question is trying to print a nice error message
when a Go EABI binary runs on an OABI machine.
Unfortunately, the only way to do that is to use
ARM Thumb instructions, which we otherwise don't use.

There exist ARM EABI machines that do not support Thumb.
We could run on them if not for this OABI check, so disable it.

Fixes #5685.

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

11 years agocmd/6g: handle very wide offsets.
Rémy Oudompheng [Mon, 9 Sep 2013 18:36:19 +0000 (20:36 +0200)]
cmd/6g: handle very wide offsets.

Fixes #6036.

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

11 years agocmd/gc: allow inlined struct == to mention unsafe.Pointer even in safe mode
Russ Cox [Mon, 9 Sep 2013 17:11:41 +0000 (13:11 -0400)]
cmd/gc: allow inlined struct == to mention unsafe.Pointer even in safe mode

Fixes #5578.

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

11 years agocmd/cgo: record full source path to input .go files
Russ Cox [Mon, 9 Sep 2013 17:04:14 +0000 (13:04 -0400)]
cmd/cgo: record full source path to input .go files

Fixes #5122.

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

11 years agocmd/gc: squelch spurious "invalid recursive type" error
Russ Cox [Mon, 9 Sep 2013 17:03:59 +0000 (13:03 -0400)]
cmd/gc: squelch spurious "invalid recursive type" error

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

11 years agocmd/gc: diagnose '_ = nil' better
Russ Cox [Mon, 9 Sep 2013 16:49:39 +0000 (12:49 -0400)]
cmd/gc: diagnose '_ = nil' better

Fixes #6004.

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

11 years agocmd/gc: more detail in import conflict error message
Russ Cox [Mon, 9 Sep 2013 16:30:53 +0000 (12:30 -0400)]
cmd/gc: more detail in import conflict error message

Cannot happen when using the go command, but help
people running commands by hand or with other tools.

Fixes #5888.

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

11 years agocmd/gc: show package name in 'imported and not used' error
Russ Cox [Mon, 9 Sep 2013 16:21:09 +0000 (12:21 -0400)]
cmd/gc: show package name in 'imported and not used' error

Fixes #5957.

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

11 years agocmd/gc: fix 'internal error: typename ideal bool'
Russ Cox [Mon, 9 Sep 2013 16:00:16 +0000 (12:00 -0400)]
cmd/gc: fix 'internal error: typename ideal bool'

Fixes #6298.

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

11 years agoruntime: unbreak build on dragonfly
Joel Sing [Mon, 9 Sep 2013 15:48:06 +0000 (08:48 -0700)]
runtime: unbreak build on dragonfly

Update dragonfly memory functions to work with new memory statistics.

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

11 years agotime: allow more time for TestOverflowRuntimeTimer to succeed
Alex Brainman [Mon, 9 Sep 2013 05:50:11 +0000 (15:50 +1000)]
time: allow more time for TestOverflowRuntimeTimer to succeed

Attempting to fix windows gobuilders

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

11 years agodoc/go1.2.html: first cut
Rob Pike [Mon, 9 Sep 2013 03:29:08 +0000 (13:29 +1000)]
doc/go1.2.html: first cut
Lay out the doc and write text for the minor changes.
(I left the net ones for someone who understands them better,
or for someone to describe them to me better so I can write them.)
Much still to do.

Delete go1.2.txt so there's only one thing to update.

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

11 years agocompress/flate: small documentation fix
Dominik Honnef [Sun, 8 Sep 2013 23:37:05 +0000 (09:37 +1000)]
compress/flate: small documentation fix

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

11 years agomisc/dist: Specify a version for the darwin package.
Emil Hessman [Sun, 8 Sep 2013 23:36:39 +0000 (09:36 +1000)]
misc/dist: Specify a version for the darwin package.

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

11 years agosort: fix up example expected output formatting
Robert Daniel Kortschak [Sun, 8 Sep 2013 03:21:03 +0000 (13:21 +1000)]
sort: fix up example expected output formatting

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

11 years agosort: add a simpler sort.Interface example
Andriy Lytvynov [Sun, 8 Sep 2013 01:17:23 +0000 (11:17 +1000)]
sort: add a simpler sort.Interface example

Existing example renamed to Example_sortWrapper.
Fixes #6335.

R=golang-dev, rsc, taj.khattra, r
CC=golang-dev
https://golang.org/cl/13586043

11 years agoruntime: Smhasher tests of our map hash function.
Keith Randall [Fri, 6 Sep 2013 23:23:46 +0000 (16:23 -0700)]
runtime: Smhasher tests of our map hash function.

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

11 years agonet: don't error when marshalling nil IP addresses
Brad Fitzpatrick [Fri, 6 Sep 2013 22:29:09 +0000 (15:29 -0700)]
net: don't error when marshalling nil IP addresses

See https://code.google.com/p/go/issues/detail?id=6339#c3

Fixes #6339

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

11 years agocompress/flate: prevent panic when reinitializing huffmanDecoder with bad input
Ehren Kret [Fri, 6 Sep 2013 22:09:42 +0000 (15:09 -0700)]
compress/flate: prevent panic when reinitializing huffmanDecoder with bad input

The huffmanDecoder struct appears to be intented for reuse by calling init a
second time with a second sequence of code lengths. Unfortunately, it can
currently panic if the second sequence of code lengths has a minimum value
greater than 10 due to failure to reinitialize the links table.

This change prevents the panic by resetting the huffmanDecoder struct back to
the struct's zero value at the beginning of the init method if the
huffmanDecoder is being reused (determined by checking if min has been set to a
non-zero value).

Fixes #6255.

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

11 years agoA+C: Ehren Kret (individual CLA)
Brad Fitzpatrick [Fri, 6 Sep 2013 22:03:14 +0000 (15:03 -0700)]
A+C: Ehren Kret (individual CLA)

Generated by addca.

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

11 years agoruntime: account for all sys memory in MemStats
Dmitriy Vyukov [Fri, 6 Sep 2013 20:55:40 +0000 (16:55 -0400)]
runtime: account for all sys memory in MemStats
Currently lots of sys allocations are not accounted in any of XxxSys,
including GC bitmap, spans table, GC roots blocks, GC finalizer blocks,
iface table, netpoll descriptors and more. Up to ~20% can unaccounted.
This change introduces 2 new stats: GCSys and OtherSys for GC metadata
and all other misc allocations, respectively.
Also ensures that all XxxSys indeed sum up to Sys. All sys memory allocation
functions require the stat for accounting, so that it's impossible to miss something.
Also fix updating of mcache_sys/inuse, they were not updated after deallocation.

test/bench/garbage/parser before:
Sys 670064344
HeapSys 610271232
StackSys 65536
MSpanSys 14204928
MCacheSys 16384
BuckHashSys 1439992

after:
Sys 670064344
HeapSys 610271232
StackSys 65536
MSpanSys 14188544
MCacheSys 16384
BuckHashSys 3194304
GCSys 39198688
OtherSys 3129656

Fixes #5799.

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

11 years agocmd/go: rename go.exe if cannot delete it during clean
Alex Brainman [Fri, 6 Sep 2013 20:55:35 +0000 (16:55 -0400)]
cmd/go: rename go.exe if cannot delete it during clean

Fixes #6179

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

11 years agocmd/gc: add missing typecheck for walk-generated constants.
Rémy Oudompheng [Fri, 6 Sep 2013 20:55:30 +0000 (16:55 -0400)]
cmd/gc: add missing typecheck for walk-generated constants.

Fixes #6131.

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

11 years agoarchive/tar: fix a case where USTAR-split is not working correctly.
Marco Hennings [Fri, 6 Sep 2013 20:49:38 +0000 (16:49 -0400)]
archive/tar: fix a case where USTAR-split is not working correctly.

For some long filenames the USTAR-split code does not work
correctly. It is wrongly assumed that the path would not be too long,
but it is.

The user visible result was that a filename was split, but it still
caused an error.

The cause was a wrongly calculated nlen. In addition I noticed that
at this place it is also seems necessary to check if the prefix will
fit in the 155 chars available for the prefix.

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

11 years agosort: fix Example_sortMultiKeys
Andriy Lytvynov [Fri, 6 Sep 2013 20:49:34 +0000 (16:49 -0400)]
sort: fix Example_sortMultiKeys

Old example referenced global var from multiSorter.Sort and ignored it's argument.
Changed one of example calls to actually pass slice to sort.

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

11 years agocmd/5g, cmd/6g, cmd/8g: simplify for loop in bitmap generation
Russ Cox [Fri, 6 Sep 2013 20:49:11 +0000 (16:49 -0400)]
cmd/5g, cmd/6g, cmd/8g: simplify for loop in bitmap generation

Lucio De Re reports that the more complex
loop miscompiles on Plan 9.

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

11 years agocmd/gofmt: sort more, remove some duplicate imports
Josh Bleecher Snyder [Fri, 6 Sep 2013 20:25:15 +0000 (16:25 -0400)]
cmd/gofmt: sort more, remove some duplicate imports

* Sort imports by import path, then import name, then comment. Currently, gofmt sorts only by import path.
* If two imports have the same import path and import name, and one of them has no comment, remove the import with no comment. (See the discussion at issue 4414.)

Based on @rsc's https://golang.org/cl/7231070/

Fixes #4414.

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

11 years agotest: fix build (update for new error message)
Russ Cox [Fri, 6 Sep 2013 20:15:30 +0000 (16:15 -0400)]
test: fix build (update for new error message)

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

11 years agomisc/emacs: use built-in buffer-base-buffer instead of own variable
Dominik Honnef [Fri, 6 Sep 2013 20:08:11 +0000 (16:08 -0400)]
misc/emacs: use built-in buffer-base-buffer instead of own variable

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

11 years agocodereview: update use of promptchoice for Mercurial 2.7
Anthony Martin [Fri, 6 Sep 2013 19:48:21 +0000 (15:48 -0400)]
codereview: update use of promptchoice for Mercurial 2.7

Fixes #6186.

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

11 years agocmd/gc: remove "send used as value" hint
Russ Cox [Fri, 6 Sep 2013 19:47:52 +0000 (15:47 -0400)]
cmd/gc: remove "send used as value" hint

This message was helpful for pre-Go 1 users updating to Go 1.
That time is past. Now the message is confusing because it
depends on knowing what pre-Go 1 looked like.

Update #4697.

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

11 years agoruntime: handle timer overflow in tsleep
Anthony Martin [Fri, 6 Sep 2013 19:47:39 +0000 (15:47 -0400)]
runtime: handle timer overflow in tsleep

Make sure we never pass a timer into timerproc with
a negative duration since it will cause other timers
to never expire.

Fixes #5321.

R=golang-dev, minux.ma, remyoudompheng, mikioh.mikioh, r, bradfitz, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/9035047

11 years agoapi: update go1.1, except and next.txt with constant values
Brad Fitzpatrick [Fri, 6 Sep 2013 19:01:18 +0000 (12:01 -0700)]
api: update go1.1, except and next.txt with constant values

O_SYNC changes only on linux-arm (and linux-arm-cgo), but
changes to match O_SYNC on linux-{386,amd64} and what Linux
upstream now uses.  See discussion and links on
https://golang.org/cl/13261050/

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

11 years agocmd/api: include constant values
Brad Fitzpatrick [Fri, 6 Sep 2013 19:01:01 +0000 (12:01 -0700)]
cmd/api: include constant values

Update #5935

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

11 years agoreflect: unexport BUCKETSIZE, MAXKEYSIZE, MAXVALSIZE
Brad Fitzpatrick [Fri, 6 Sep 2013 19:00:42 +0000 (12:00 -0700)]
reflect: unexport BUCKETSIZE, MAXKEYSIZE, MAXVALSIZE

But keep their case for ease of searching.

They were added recently. We don't want them part of go1.2's API.

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

11 years agocrypto/rand: make Read use io.ReadFull
Brad Fitzpatrick [Fri, 6 Sep 2013 19:00:27 +0000 (12:00 -0700)]
crypto/rand: make Read use io.ReadFull

Fixes #6084

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

11 years agonet: Fix inaccurate docs for AcceptTCP and AcceptUnix.
Kamil Kisiel [Fri, 6 Sep 2013 19:00:03 +0000 (12:00 -0700)]
net: Fix inaccurate docs for AcceptTCP and AcceptUnix.

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

11 years agomisc/notepadplus: add interface to function list and use clang color in comments
ChaiShushan [Fri, 6 Sep 2013 18:59:53 +0000 (11:59 -0700)]
misc/notepadplus: add interface to function list and use clang color in comments

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

11 years agocmd/dist: Plan 9 build needs an additional include path
Lucio De Re [Fri, 6 Sep 2013 06:15:44 +0000 (16:15 +1000)]
cmd/dist: Plan 9 build needs an additional include path
cmd/cc: bv.c imports libc.h twice

When using the Plan 9 compiler, the invocation

        #include <../ld/textflag.h>

works for the toolchain, but not for the MACH library.

Module cmd/cc/bv.c includes libc.h and "cc.h", which in
turn also includes libc.h.  In the Plan 9 context, this
causes a number of duplicate definitions.

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

11 years agocmd/go: don't leave test binary around for coverage
Rob Pike [Fri, 6 Sep 2013 05:54:26 +0000 (15:54 +1000)]
cmd/go: don't leave test binary around for coverage
It's not needed to analyze coverage data.
Fixes #6120

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

11 years agotest/nilptr: add more tests
Russ Cox [Fri, 6 Sep 2013 03:06:34 +0000 (23:06 -0400)]
test/nilptr: add more tests

These tests were suggested in golang.org/issue/6080.
They were fixed as part of the new nil pointer checks
that I added a few weeks ago.

Recording the tests as part of marking the issue closed.

Fixes #6080.

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

11 years agoundo CL 13004046 / 5db14b33d6ef
Rob Pike [Thu, 5 Sep 2013 21:54:43 +0000 (07:54 +1000)]
undo CL 13004046 / 5db14b33d6ef

Flushing after every token negates the point of buffering. A different approach is required.

««« original CL description
encoding/xml: flush buffer after encoding token

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

»»»

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

11 years agocmd/ld: emit relocations for .debug_frame in external link mode
Ian Lance Taylor [Thu, 5 Sep 2013 19:55:21 +0000 (12:55 -0700)]
cmd/ld: emit relocations for .debug_frame in external link mode

This should have been part of revision 16731:cdedb129e020, but
I missed it.  This fixes printing local variables when doing
an external link.

No test because we aren't doing any debug info testing yet.

Fixes #5719.

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

11 years agocompress/zlib: add Reset method to Writer.
Rémy Oudompheng [Thu, 5 Sep 2013 19:50:47 +0000 (21:50 +0200)]
compress/zlib: add Reset method to Writer.

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