]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agomisc/vim: godoc is optional. so should point installation instruction.
Yasuhiro Matsumoto [Fri, 27 Sep 2013 02:35:03 +0000 (12:35 +1000)]
misc/vim: godoc is optional. so should point installation instruction.

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

11 years agoall: fix some mistakes found by go tool vet .
Rob Pike [Fri, 27 Sep 2013 00:09:15 +0000 (10:09 +1000)]
all: fix some mistakes found by go tool vet .

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

11 years agodoc: update links to spec and memory model
Andrew Gerrand [Thu, 26 Sep 2013 23:46:36 +0000 (09:46 +1000)]
doc: update links to spec and memory model

Fixes #6488.

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

11 years agocrypto/tls: don't select TLS 1.2 cipher suites in prior versions.
Adam Langley [Thu, 26 Sep 2013 21:09:56 +0000 (17:09 -0400)]
crypto/tls: don't select TLS 1.2 cipher suites in prior versions.

AES-GCM cipher suites are only defined for TLS 1.2, although there's
nothing really version specific about them. However, development
versions of NSS (meaning Firefox and Chrome) have an issue where
they'll advertise TLS 1.2-only cipher suites in a TLS 1.1 ClientHello
but then balk when the server selects one.

This change causes Go clients not to advertise TLS 1.2 cipher suites
unless TLS 1.2 is being used, and prevents servers from selecting them
unless TLS 1.2 has been negotiated.

https://code.google.com/p/chromium/issues/detail?id=297151
https://bugzilla.mozilla.org/show_bug.cgi?id=919677

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

11 years agoruntime, syscall: update freebsd/arm calling convention to match EABI
Dave Cheney [Thu, 26 Sep 2013 11:35:49 +0000 (21:35 +1000)]
runtime, syscall: update freebsd/arm calling convention to match EABI

Fixes #6451.

There is still some breakages unrelated to the syscall change.

[root@beaglebone ~/go/src]# /root/go/pkg/tool/freebsd_arm/go_bootstrap version
go version devel freebsd/arm
a std@beaglebone ~/go/src]# /root/go/pkg/tool/freebsd_arm/go_bootstrap install -
fatal error: mark - finalizer inconsistency

runtime stack:
runtime.throw(0x3e80ac)
        /root/go/src/pkg/runtime/panic.c:464 +0x5c
addfinroots(0x2)
        /root/go/src/pkg/runtime/mgc0.c:1501 +0x74
runtime.walkfintab(0x6c200)
        /root/go/src/pkg/runtime/mfinal.c:216 +0xa0
addroots()
        /root/go/src/pkg/runtime/mgc0.c:1561 +0x188
gc(0x50632f78)
        /root/go/src/pkg/runtime/mgc0.c:2098 +0x19c
mgc(0x306170a0)
        /root/go/src/pkg/runtime/mgc0.c:2049 +0x30
runtime.mcall(0x3e97b0)
        /root/go/src/pkg/runtime/asm_arm.s:165 +0x3c

goroutine 1 [garbage collection]:
runtime.gc(0x0)
        /root/go/src/pkg/runtime/mgc0.c:2020 +0x1a0 fp=0x50632f80
runtime.mallocgc(0x680, 0x1b1971, 0x1)
        /root/go/src/pkg/runtime/malloc.goc:143 +0x210 fp=0x50632fbc
----- stack segment boundary -----
cnew(0x1b1970, 0x640, 0x1)
        /root/go/src/pkg/runtime/malloc.goc:718 +0xc4 fp=0x50626110
runtime.cnewarray(0x1b1970, 0x640)
        /root/go/src/pkg/runtime/malloc.goc:731 +0x3c fp=0x50626120
makeslice1(0x1ac6d0, 0x500, 0x640, 0x50626190)
        /root/go/src/pkg/runtime/slice.c:57 +0x50 fp=0x5062612c
growslice1(0x1ac6d0, 0x30714a00, 0x500, 0x500, 0x501, ...)
        /root/go/src/pkg/runtime/slice.c:113 +0x8c fp=0x50626144
runtime.growslice(0x1ac6d0, 0x30714a00, 0x500, 0x500, 0x1, ...)
        /root/go/src/pkg/runtime/slice.c:80 +0x19c fp=0x50626174
go/build.(*importReader).readByte(0x3070d1b0, 0xb384e)
        /root/go/src/pkg/go/build/read.go:43 +0xbc fp=0x506261b4
go/build.(*importReader).peekByte(0x3070d1b0, 0x3070d101, 0x3070d180)
        /root/go/src/pkg/go/build/read.go:89 +0x210 fp=0x506261d0
go/build.readComments(0x203e2560, 0x306f79a8, 0x306f79a8, 0x203e2560, 0x306f79a8, ...)
        /root/go/src/pkg/go/build/read.go:194 +0x84 fp=0x506261f4
go/build.(*Context).matchFile(0x3e9730, 0x306209c0, 0x13, 0x306c42b4, 0x5, ...)
        /root/go/src/pkg/go/build/build.go:812 +0x74c fp=0x5062629c
go/build.(*Context).Import(0x3e9730, 0x1f95c8, 0x1, 0x30620960, 0x13, ...)
        /root/go/src/pkg/go/build/build.go:580 +0xd64 fp=0x506268dc
go/build.(*Context).ImportDir(0x3e9730, 0x30620960, 0x13, 0x0, 0x24d901, ...)
        /root/go/src/pkg/go/build/build.go:397 +0x5c fp=0x50626904
main.func·021(0x30620960, 0x13, 0x203e2200, 0x30680330, 0x0, ...)
        /root/go/src/cmd/go/main.go:521 +0x2cc fp=0x5062696c
path/filepath.walk(0x30620960, 0x13, 0x203e2200, 0x30680330, 0x50626ae8, ...)
        /root/go/src/pkg/path/filepath/path.go:341 +0x5c fp=0x506269d8
path/filepath.walk(0x3067e720, 0x11, 0x203e2200, 0x30680210, 0x50626ae8, ...)
        /root/go/src/pkg/path/filepath/path.go:359 +0x308 fp=0x50626a44
path/filepath.Walk(0x3067e720, 0x11, 0x50626ae8, 0x1f9728, 0x1)
        /root/go/src/pkg/path/filepath/path.go:380 +0xb4 fp=0x50626a68
main.matchPackages(0xbfffedea, 0x3, 0x1b1190, 0x3067e600, 0x10)
        /root/go/src/cmd/go/main.go:530 +0x2c0 fp=0x50626b1c
main.allPackages(0xbfffedea, 0x3, 0x1fadc8, 0x3, 0x1)
        /root/go/src/cmd/go/main.go:474 +0x34 fp=0x50626b70
main.importPathsNoDotExpansion(0x30620018, 0x1, 0x1, 0x0, 0xffffffff, ...)
        /root/go/src/cmd/go/main.go:305 +0x2f8 fp=0x50626c04
main.importPaths(0x30620018, 0x1, 0x1, 0x3, 0x0, ...)
        /root/go/src/cmd/go/main.go:315 +0x44 fp=0x50626c88
main.packagesAndErrors(0x30620018, 0x1, 0x1, 0x50626d60, 0x90f44, ...)
        /root/go/src/cmd/go/pkg.go:798 +0x1bc fp=0x50626d1c
main.packagesForBuild(0x30620018, 0x1, 0x1, 0x53490, 0x0, ...)
        /root/go/src/cmd/go/pkg.go:818 +0x44 fp=0x50626dac
main.runInstall(0x3e46e0, 0x30620018, 0x1, 0x1)
        /root/go/src/cmd/go/build.go:311 +0x48 fp=0x50626e60
main.main()
        /root/go/src/cmd/go/main.go:161 +0x518 fp=0x50626f8c
runtime.main()
        /root/go/src/pkg/runtime/proc.c:222 +0x100 fp=0x50626fc0
runtime.goexit()
        /root/go/src/pkg/runtime/proc.c:1396 fp=0x50626fc0

goroutine 3 [syscall]:
os/signal.loop()
        /root/go/src/pkg/os/signal/signal_unix.go:21 +0x24
created by os/signal.init·1
        /root/go/src/pkg/os/signal/signal_unix.go:27 +0x48

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

11 years agocmd/go: "go test -c -test.bench=XX fmt" shouldn't hang
Shenghou Ma [Wed, 25 Sep 2013 20:18:33 +0000 (16:18 -0400)]
cmd/go: "go test -c -test.bench=XX fmt" shouldn't hang
Fixes #6480.

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

11 years agodoc: mention the install locations for godoc, cover, and vet
Andrew Gerrand [Wed, 25 Sep 2013 08:15:29 +0000 (18:15 +1000)]
doc: mention the install locations for godoc, cover, and vet

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

11 years agodoc/go1.2.html: add go/ast.SliceExpr.Slice3
Rob Pike [Wed, 25 Sep 2013 06:17:54 +0000 (16:17 +1000)]
doc/go1.2.html: add go/ast.SliceExpr.Slice3

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

11 years agodoc: fix typo in install-source.html
Andrew Gerrand [Wed, 25 Sep 2013 04:27:23 +0000 (14:27 +1000)]
doc: fix typo in install-source.html

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

11 years agodoc: document installation of go.tools commands
Andrew Gerrand [Wed, 25 Sep 2013 04:10:49 +0000 (14:10 +1000)]
doc: document installation of go.tools commands

Fixes #5663.

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

11 years agocmd/cgo: fix so that tests pass again when using gccgo
Ian Lance Taylor [Wed, 25 Sep 2013 01:11:13 +0000 (18:11 -0700)]
cmd/cgo: fix so that tests pass again when using gccgo

Use the symbol prefixes with the prologue functions when using
gccgo.

Use an & when referring to a function declared as a variable.

Fix the malloc prologue function.

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

11 years agohtml/template: update the Tree field after parsing new templates
Rob Pike [Wed, 25 Sep 2013 00:00:09 +0000 (10:00 +1000)]
html/template: update the Tree field after parsing new templates
After text/template.Parse, all the templates may have changed, so
we need to set them all back to their unescaped state. The code
did this but (mea culpa) forgot to set the Tree field of the html/template
struct.

Since the Tree is reset during escaping, this only matters if an error
arises during escaping and we want to print a message.

Fixes #6459.

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

11 years agogo/ast: add Slice3 field to SliceExpr
Robert Griesemer [Tue, 24 Sep 2013 23:35:35 +0000 (16:35 -0700)]
go/ast: add Slice3 field to SliceExpr

If Slice3 is set, the expression is
a 3-index slice expression (2 colons).
Required for type-checking.

Backward-compatible API extension.

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

11 years agomath/big: Fix variable name in documentation for *Int.Bytes and BitLen.
Kamil Kisiel [Tue, 24 Sep 2013 23:32:23 +0000 (16:32 -0700)]
math/big: Fix variable name in documentation for *Int.Bytes and BitLen.

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

11 years agosync/atomic: adjust for new runtime.cas64 prototype
Russ Cox [Tue, 24 Sep 2013 19:54:48 +0000 (15:54 -0400)]
sync/atomic: adjust for new runtime.cas64 prototype

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

11 years agocmd/cgo: retain Go pointer passed to C call for duration of call
Russ Cox [Tue, 24 Sep 2013 19:52:48 +0000 (15:52 -0400)]
cmd/cgo: retain Go pointer passed to C call for duration of call

Fixes #6397.

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

11 years agocmd/dist, cmd/go: embed default C++ compiler into cmd/go
Shenghou Ma [Tue, 24 Sep 2013 04:17:08 +0000 (00:17 -0400)]
cmd/dist, cmd/go: embed default C++ compiler into cmd/go
Fixes #6426.

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

11 years agonet: re-enable raw socket tests on windows
Alex Brainman [Tue, 24 Sep 2013 03:15:49 +0000 (13:15 +1000)]
net: re-enable raw socket tests on windows

Since CL 38bf89161a72 raw socket tests are not executed
on windows builders. This change re-enable them again.
It will attempt to run raw socket tests only if user
is permitted to create raw socket by OS.

Fixes #6392

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

11 years agoencoding/json: don't cache value addressability when building first encoder
Brad Fitzpatrick [Tue, 24 Sep 2013 02:57:19 +0000 (19:57 -0700)]
encoding/json: don't cache value addressability when building first encoder

newTypeEncoder (called once per type and then cached) was
looking at the first value seen of that type's addressability
and caching the encoder decision.  If the first value seen was
addressable and a future one wasn't, it would panic.

Instead, introduce a new wrapper encoder type that checks
CanAddr at runtime.

Fixes #6458

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

11 years agonet: ensure that ResolveTCPAddr(addr.String()) reproduces addr
Russ Cox [Tue, 24 Sep 2013 02:40:24 +0000 (22:40 -0400)]
net: ensure that ResolveTCPAddr(addr.String()) reproduces addr

And same for UDP.

Fixes #6465.

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

11 years agonet: fix Close of autobind unix listener
Albert Strasheim [Tue, 24 Sep 2013 02:33:42 +0000 (22:33 -0400)]
net: fix Close of autobind unix listener

Fixes #6455.

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

11 years agoreflect: update docs; Interface can return a method value
Andrew Gerrand [Tue, 24 Sep 2013 00:49:54 +0000 (10:49 +1000)]
reflect: update docs; Interface can return a method value

Fixes #6460.

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

11 years agonet/http: accept Content-Range for entire file
Russ Cox [Mon, 23 Sep 2013 21:16:59 +0000 (17:16 -0400)]
net/http: accept Content-Range for entire file

Fixes a bug reported privately.

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

11 years agomisc/pprof: support block profile
Dmitriy Vyukov [Mon, 23 Sep 2013 21:15:20 +0000 (14:15 -0700)]
misc/pprof: support block profile
Fixes #6347.

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

11 years agoapi: update next.txt
Brad Fitzpatrick [Mon, 23 Sep 2013 20:56:21 +0000 (13:56 -0700)]
api: update next.txt

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

11 years agocmd/cgo: update #cgo docs to reflect reality
Russ Cox [Mon, 23 Sep 2013 20:29:53 +0000 (16:29 -0400)]
cmd/cgo: update #cgo docs to reflect reality

The syntax accepted is full build constraints, not just
GOOS, GOARCH, and GOOS/GOARCH.

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

11 years agoruntime/pprof: fix profile parser in test
Russ Cox [Mon, 23 Sep 2013 20:05:36 +0000 (16:05 -0400)]
runtime/pprof: fix profile parser in test

Fixes #6417.

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

11 years agocrypto/tls: document that the package supports TLS 1.2
Russ Cox [Mon, 23 Sep 2013 20:05:23 +0000 (16:05 -0400)]
crypto/tls: document that the package supports TLS 1.2

Fixes #6456.

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

11 years agoundo CL 13321048 / 9567c5da6e25
Russ Cox [Mon, 23 Sep 2013 19:58:35 +0000 (15:58 -0400)]
undo CL 13321048 / 9567c5da6e25

Makes build unnecessarily slower. Will fix the parser instead.

««« original CL description
runtime/pprof: run TestGoroutineSwitch for longer

Short test now takes about 0.5 second here.

Fixes #6417.

The failure was also seen on our builders.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/13321048
»»»

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

11 years agoreflect: add example for StructTag
Kamil Kisiel [Mon, 23 Sep 2013 17:19:08 +0000 (13:19 -0400)]
reflect: add example for StructTag

Fix a few minor vet quibbles while I'm here.

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

11 years agocmd/ld: fix "_image_base__ not defined" problem for cmd/8l.
Shenghou Ma [Mon, 23 Sep 2013 17:08:00 +0000 (13:08 -0400)]
cmd/ld: fix "_image_base__ not defined" problem for cmd/8l.
Fixes #6431.

Change suggested by kin.wilson.za.

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

11 years agogo/build: add go1.2 build tag
Péter Surányi [Mon, 23 Sep 2013 08:11:25 +0000 (18:11 +1000)]
go/build: add go1.2 build tag

Fixes #6449.

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

11 years agofmt: one bad index shouldn't spoil them all
Rob Pike [Mon, 23 Sep 2013 06:03:57 +0000 (16:03 +1000)]
fmt: one bad index shouldn't spoil them all

In an indexed verb such as %[3]d, if the index is out of range, don't
skip processing the rest of the verbs. The bug was that the bad
index set a bit for the whole format instead of just the verb.

Ok for 1.2 because this is a bug in a 1.2 feature.

Fixes #6434

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

11 years agodoc/go1.2: document that godoc and vet will always be installed to their old location...
Shenghou Ma [Mon, 23 Sep 2013 05:23:42 +0000 (01:23 -0400)]
doc/go1.2: document that godoc and vet will always be installed to their old locations (not $GOPATH/bin).

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

11 years agodoc: mention os/exec StdinPipe change in Go 1.2 doc
Andrew Gerrand [Mon, 23 Sep 2013 05:14:26 +0000 (15:14 +1000)]
doc: mention os/exec StdinPipe change in Go 1.2 doc

Fixes #6439.

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

11 years agodoc/go1.2.html: fix 3-index slice example
Rob Pike [Mon, 23 Sep 2013 04:41:20 +0000 (14:41 +1000)]
doc/go1.2.html: fix 3-index slice example
A number was wrong; adjust as suggested to make things clearer.
Fixes #6452

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

11 years agonet/http: send correct time in Date header.
Dmitry Chestnykh [Mon, 23 Sep 2013 02:53:55 +0000 (19:53 -0700)]
net/http: send correct time in Date header.

Date header indicated that it contained GMT time,
however it actually sent local time. Fixed by
converting time to UTC.

Also fixes incorrect comment in appendTime().

Regression since CL 9432046.

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

11 years agomisc/notepadplus: fix some number syntax highlight issue
ChaiShushan [Mon, 23 Sep 2013 01:35:17 +0000 (11:35 +1000)]
misc/notepadplus: fix some number syntax highlight issue

notepadplus can only support some normal golang's hex and imaginary numbers.
it can't detect some special number, eg. 1./1.e/1.i/1+0.1i (omit "0" in ".0").

R=golang-dev, gvdschoot
CC=ajstarks, golang-dev
https://golang.org/cl/13401047

11 years agoA+C: Nathan John Youngman (individual CLA)
Andrew Gerrand [Sun, 22 Sep 2013 23:35:52 +0000 (09:35 +1000)]
A+C: Nathan John Youngman (individual CLA)

Generated by addca.

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

11 years agoruntime/race: update runtime to r191161.
Dmitriy Vyukov [Sun, 22 Sep 2013 17:56:06 +0000 (10:56 -0700)]
runtime/race: update runtime to r191161.
Fixes #6305.

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

11 years agoruntime/pprof: run TestGoroutineSwitch for longer
Alex Brainman [Sun, 22 Sep 2013 07:31:08 +0000 (17:31 +1000)]
runtime/pprof: run TestGoroutineSwitch for longer

Short test now takes about 0.5 second here.

Fixes #6417.

The failure was also seen on our builders.

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

11 years agocmd/api: always do API check if hg is available
Brad Fitzpatrick [Sun, 22 Sep 2013 07:01:17 +0000 (08:01 +0100)]
cmd/api: always do API check if hg is available

Fixes #6124

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

11 years agodoc/go1.2.html: Go 1.2, not Go1.2
Dominik Honnef [Sat, 21 Sep 2013 21:28:52 +0000 (07:28 +1000)]
doc/go1.2.html: Go 1.2, not Go1.2

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

11 years agodoc/go1.2.html: pre-emption; cgo and C++
Rob Pike [Sat, 21 Sep 2013 07:53:44 +0000 (17:53 +1000)]
doc/go1.2.html: pre-emption; cgo and C++

These were bullet points that I had neglected to flesh out.

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

11 years agotest/chan: avoid wrap-around in memstats comparison
Carl Shapiro [Sat, 21 Sep 2013 00:27:56 +0000 (17:27 -0700)]
test/chan: avoid wrap-around in memstats comparison

The select2.go test assumed that the memory allocated between
its two samplings of runtime.ReadMemStats is strictly
increasing.  To avoid failing the tests when this is not true,
a greater-than check is introduced before computing the
difference in allocated memory.

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

11 years agocmd/yacc: report correct line for 'default action causes potential type clash'
Russ Cox [Fri, 20 Sep 2013 20:00:13 +0000 (16:00 -0400)]
cmd/yacc: report correct line for 'default action causes potential type clash'

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

11 years agotest/run: print command line for running an individual test
Russ Cox [Fri, 20 Sep 2013 19:25:59 +0000 (15:25 -0400)]
test/run: print command line for running an individual test

Fixes #5087.

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

11 years agocmd/gc: fix imported and not used error for import .
Russ Cox [Fri, 20 Sep 2013 19:25:43 +0000 (15:25 -0400)]
cmd/gc: fix imported and not used error for import .

Fixes issues 6420.

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

11 years agocmd/gc: print expression in 'duplicate case in switch' error
Russ Cox [Fri, 20 Sep 2013 19:15:43 +0000 (15:15 -0400)]
cmd/gc: print expression in 'duplicate case in switch' error

The line number alone does not help when the line is
case '~', '*', '(', ')', '[', ']', '{', '}', '?', ':', ';', ',', '*', '%', '^', '!', '=', '<', '>', '+', '-', '&', '|':

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

11 years agoruntime: avoid allocation of internal panic values
Russ Cox [Fri, 20 Sep 2013 19:15:25 +0000 (15:15 -0400)]
runtime: avoid allocation of internal panic values

If a fault happens in malloc, inevitably the next thing that happens
is a deadlock trying to allocate the panic value that says the fault
happened. Stop doing that, two ways.

First, reject panic in malloc just as we reject panic in garbage collection.

Second, runtime.panicstring was using an error implementation
backed by a Go string, so the interface held an allocated *string.
Since the actual errors are C strings, define a new error
implementation backed by a C char*, which needs no indirection
and therefore no allocation.

This second fix will avoid allocation for errors like nil panic derefs
or division by zero, so it is worth doing even though the first fix
should take care of faults during malloc.

Update #6419

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

11 years agotest/fixedbugs/bug295.go: fix test in anticipation of future gc fix
Robert Griesemer [Fri, 20 Sep 2013 16:40:56 +0000 (09:40 -0700)]
test/fixedbugs/bug295.go: fix test in anticipation of future gc fix

See also issue 6428.

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

11 years agocmd/ld: fix "ld -s" to not discard pclntab.
Shenghou Ma [Fri, 20 Sep 2013 14:04:52 +0000 (10:04 -0400)]
cmd/ld: fix "ld -s" to not discard pclntab.
Fixes #6245.

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

11 years agocrypto/x509: update comment on system root cert locations.
David Symonds [Fri, 20 Sep 2013 05:49:26 +0000 (15:49 +1000)]
crypto/x509: update comment on system root cert locations.

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

11 years agotest: add a test that causes gccgo to get a failure at link time
Ian Lance Taylor [Thu, 19 Sep 2013 22:20:39 +0000 (15:20 -0700)]
test: add a test that causes gccgo to get a failure at link time

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

11 years agountag go1.2rc1
Andrew Gerrand [Thu, 19 Sep 2013 12:34:33 +0000 (22:34 +1000)]
untag go1.2rc1

Looks like the dist tool really doesn't like tags.

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

11 years agocmd/gc: cleanup SWITCH nodes after walk.
Rémy Oudompheng [Thu, 19 Sep 2013 07:23:04 +0000 (09:23 +0200)]
cmd/gc: cleanup SWITCH nodes after walk.

Keeping pointers from the pre-walk phase confuses
the race detection instrumentation.

Fixes #6418.

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

11 years agotag go1.2rc1
Andrew Gerrand [Thu, 19 Sep 2013 07:12:00 +0000 (17:12 +1000)]
tag go1.2rc1

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

11 years agomisc/dist: add 'label' part of distro name, include blog content
Andrew Gerrand [Thu, 19 Sep 2013 06:51:29 +0000 (16:51 +1000)]
misc/dist: add 'label' part of distro name, include blog content

This will allow us to cut binaries with names like:
        go1.2rc1.darwin-amd64-osx10.6.pkg
        go1.2rc1.darwin-amd64-osx10.8.pkg

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

11 years agocmd/ld: handle IMAGE_SYM_CLASS_LABEL symbols.
Shenghou Ma [Thu, 19 Sep 2013 06:27:53 +0000 (02:27 -0400)]
cmd/ld: handle IMAGE_SYM_CLASS_LABEL symbols.
Was causing "invalid symbol binding" and thus "malformed pe file" error.

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

11 years agocmd/go: fix missing __mingw_fprintf symbol for cgo on windows
Shenghou Ma [Thu, 19 Sep 2013 05:20:02 +0000 (01:20 -0400)]
cmd/go: fix missing __mingw_fprintf symbol for cgo on windows

Fixes #5986.

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

11 years agocmd/ld: handle duplicate static symbols in COFF and Mach-O files.
Shenghou Ma [Thu, 19 Sep 2013 02:27:25 +0000 (22:27 -0400)]
cmd/ld: handle duplicate static symbols in COFF and Mach-O files.
Fixes #5740.

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

11 years agocmd/go: write the WORK=/tmp/... line to stderr
Rob Pike [Thu, 19 Sep 2013 01:19:11 +0000 (11:19 +1000)]
cmd/go: write the WORK=/tmp/... line to stderr
Unlike the other output from the -x flag, it was going to stdout.
Fixes #6362.

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

11 years agotest: add a test that gccgo failed to compile
Ian Lance Taylor [Wed, 18 Sep 2013 23:30:38 +0000 (16:30 -0700)]
test: add a test that gccgo failed to compile

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

11 years agotest: add a test that gccgo failed to compile
Ian Lance Taylor [Wed, 18 Sep 2013 22:47:50 +0000 (15:47 -0700)]
test: add a test that gccgo failed to compile

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

11 years agotest: disable failing tests under ssa/interp.
Alan Donovan [Wed, 18 Sep 2013 18:44:57 +0000 (14:44 -0400)]
test: disable failing tests under ssa/interp.

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

11 years agotest: add a test that crashed gccgo
Ian Lance Taylor [Wed, 18 Sep 2013 01:06:58 +0000 (18:06 -0700)]
test: add a test that crashed gccgo

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

11 years agonet/http/cgi: use 'https://' for urls if HTTPS is set.
Thomas Habets [Wed, 18 Sep 2013 00:48:28 +0000 (10:48 +1000)]
net/http/cgi: use 'https://' for urls if HTTPS is set.

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

11 years agoC: add Thomas Habets (Google CLA)
Andrew Gerrand [Wed, 18 Sep 2013 00:48:11 +0000 (10:48 +1000)]
C: add Thomas Habets (Google CLA)

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

11 years agocmd/gc: fix set but not used error
Dave Cheney [Wed, 18 Sep 2013 00:15:52 +0000 (10:15 +1000)]
cmd/gc: fix set but not used error

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

11 years agocmd/go: add basic docs on calling between Go and C/C++
Ian Lance Taylor [Wed, 18 Sep 2013 00:10:48 +0000 (17:10 -0700)]
cmd/go: add basic docs on calling between Go and C/C++

This is a framework for docs on the subject more than it is
actual docs.

The section header in go/doc.go just says "C", not "C/C++,"
because otherwise godoc doesn't recognize the line as a
section header.

Fixes #5473.

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

11 years agotest: avoid future 'declared and not used' error
Robert Griesemer [Tue, 17 Sep 2013 22:24:54 +0000 (15:24 -0700)]
test: avoid future 'declared and not used' error

See also issue 6414.

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

11 years agoencoding/xml: remove dead code
Robert Griesemer [Tue, 17 Sep 2013 22:24:40 +0000 (15:24 -0700)]
encoding/xml: remove dead code

Avoid future 'declared and not used error'.
See also issue 6414.

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

11 years agoreflect: test method calls on pointers to pointers
Ian Lance Taylor [Tue, 17 Sep 2013 22:22:42 +0000 (15:22 -0700)]
reflect: test method calls on pointers to pointers

Gccgo got this wrong, and evidently nothing else tests it.

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

11 years agocmd/gc: eliminate redundant &x.Field nil checks
Russ Cox [Tue, 17 Sep 2013 20:54:22 +0000 (16:54 -0400)]
cmd/gc: eliminate redundant &x.Field nil checks

This eliminates ~75% of the nil checks being emitted,
on all architectures. We can do better, but we need
a bit more general support from the compiler, and
I don't want to do that so close to Go 1.2.
What's here is simple but effective and safe.

A few small code generation cleanups were required
to make the analysis consistent on all systems about
which nil checks are omitted, at least in the test.

Fixes #6019.

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

11 years agocrypto/tls: don't select ECDSA ciphersuites with only an RSA certificate.
Adam Langley [Tue, 17 Sep 2013 17:30:36 +0000 (13:30 -0400)]
crypto/tls: don't select ECDSA ciphersuites with only an RSA certificate.

47ec7a68b1a2 added support for ECDSA ciphersuites but didn't alter the
cipher suite selection to take that into account. Thus Go servers could
try and select an ECDSA cipher suite while only having an RSA
certificate, leading to connection failures.

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

11 years agocmd/cgo: rearrange and update documentation
Ian Lance Taylor [Tue, 17 Sep 2013 14:11:40 +0000 (07:11 -0700)]
cmd/cgo: rearrange and update documentation

In particular document that the Go tool will look for certain
file extensions and compile with them with either the C or the
C++ compiler.

Fixes #6393.

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

11 years agotext/template/parse, html/template: copy Tree.text during html template clone
Josh Bleecher Snyder [Tue, 17 Sep 2013 04:19:44 +0000 (14:19 +1000)]
text/template/parse, html/template: copy Tree.text during html template clone

The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980
is that parse's Tree.Text wasn't being copied during the clone.

Fix this by adding and using a Copy method for parse.Tree.

Fixes #5980.

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

11 years agocmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings
Dave Cheney [Tue, 17 Sep 2013 03:43:27 +0000 (13:43 +1000)]
cmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings

Update #5764

Like Tribbles, the more you kill, the more spring up in their place.

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

11 years agoruntime: export PCDATA value reader
Carl Shapiro [Tue, 17 Sep 2013 02:03:19 +0000 (19:03 -0700)]
runtime: export PCDATA value reader

This interface is required to use the PCDATA interface
implemented in Go 1.2.  While initially entirely private, the
FUNCDATA side of the interface has been made public.  This
change completes the FUNCDATA/PCDATA interface.

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

11 years agocmd/gc, runtime: inline append in frontend.
Rémy Oudompheng [Tue, 17 Sep 2013 00:31:21 +0000 (20:31 -0400)]
cmd/gc, runtime: inline append in frontend.

A new transformation during walk turns append calls
into a combination of growslice and memmove.

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     141          141   +0.00%
BenchmarkAppend1Byte                 18           11  -39.56%
BenchmarkAppend4Bytes                19           10  -42.63%
BenchmarkAppend7Bytes                18           10  -42.16%
BenchmarkAppend8Bytes                18           10  -40.44%
BenchmarkAppend15Bytes               19           11  -41.67%
BenchmarkAppend16Bytes               19           11  -41.97%
BenchmarkAppend32Bytes               23           14  -38.82%
BenchmarkAppendStr1Byte              14           10  -23.78%
BenchmarkAppendStr4Bytes             14           11  -21.13%
BenchmarkAppendStr8Bytes             14           10  -25.17%
BenchmarkAppendStr16Bytes            19           11  -41.45%
BenchmarkAppendStr32Bytes            18           14  -19.44%
BenchmarkAppendSpecialCase           62           63   +1.77%

R=golang-dev, khr, cshapiro, rsc, dave
CC=golang-dev
https://golang.org/cl/12815046

11 years agocmd/nm: make -S listing a bit more accurate
Russ Cox [Tue, 17 Sep 2013 00:27:57 +0000 (20:27 -0400)]
cmd/nm: make -S listing a bit more accurate

Hide container symbols like text and etext so that
the individual pieces inside are shown instead.
For example, if text and main.init have the same
address, it was a toss-up which name was printed.

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

11 years agobuild: disable precise collection of stack frames
Russ Cox [Tue, 17 Sep 2013 00:26:10 +0000 (20:26 -0400)]
build: disable precise collection of stack frames

The code for call site-specific pointer bitmaps was not ready in time,
but the zeroing required without it is too expensive to use by default.
We will have to wait for precise collection of stack frames until Go 1.3.

The precise collection can be re-enabled by

        GOEXPERIMENT=precisestack ./all.bash

but that will not be the default for a Go 1.2 build.

Fixes #6087.

R=golang-dev, jeremyjackins, dan.kortschak, r
CC=golang-dev
https://golang.org/cl/13677045

11 years agoeffective_go: add a discussion of labeled break and continue
Rob Pike [Mon, 16 Sep 2013 21:41:45 +0000 (07:41 +1000)]
effective_go: add a discussion of labeled break and continue
Fixes #5725.

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

11 years agospec: add example for continue to label
Rob Pike [Mon, 16 Sep 2013 21:41:11 +0000 (07:41 +1000)]
spec: add example for continue to label
Make the break example slightly more interesting
Update #5725
Effective Go will be updated in a separate CL.

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

11 years agocrypto/tls: fix TLS 1.2 client certificates.
Adam Langley [Mon, 16 Sep 2013 20:39:42 +0000 (16:39 -0400)]
crypto/tls: fix TLS 1.2 client certificates.

With TLS 1.2, when sending client certificates the code was omitting
the new (in TLS 1.2) signature and hash fields.

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

11 years agocmd/cgo: remove inaccurate comment
Ian Lance Taylor [Mon, 16 Sep 2013 20:19:32 +0000 (13:19 -0700)]
cmd/cgo: remove inaccurate comment

All these features have in fact been implemented.

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

11 years agocmd/gc: do not report fields when looking for methods
Russ Cox [Mon, 16 Sep 2013 19:55:16 +0000 (15:55 -0400)]
cmd/gc: do not report fields when looking for methods

Fixes #6395.

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

11 years agoruntime: fix uint64 division on 386
Russ Cox [Mon, 16 Sep 2013 19:11:32 +0000 (15:11 -0400)]
runtime: fix uint64 division on 386

The uint64 divide function calls _mul64x32 to do a 64x32-bit multiply
and then compares the result against the 64-bit numerator.
If the result is bigger than the numerator, must use the slow path.

Unfortunately, the 64x32 produces a 96-bit product, and only the
low 64 bits were being used in the comparison. Return all 96 bits,
the bottom 64 via the original uint64* pointer, and the top 32
as the function's return value.

Fixes 386 build (broken by ARM division tests).

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

11 years agocmd/gc: fix divide by zero error in compiler
Russ Cox [Mon, 16 Sep 2013 18:22:37 +0000 (14:22 -0400)]
cmd/gc: fix divide by zero error in compiler

Fixes #6399.

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

11 years agoruntime: fix freebsd build
Russ Cox [Mon, 16 Sep 2013 18:22:24 +0000 (14:22 -0400)]
runtime: fix freebsd build

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

11 years agocmd/cgo: fix build (missing file from earlier CL)
Russ Cox [Mon, 16 Sep 2013 18:21:54 +0000 (14:21 -0400)]
cmd/cgo: fix build (missing file from earlier CL)

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

11 years agonet: make all.bat run for ordinary Windows users
Russ Cox [Mon, 16 Sep 2013 18:05:06 +0000 (14:05 -0400)]
net: make all.bat run for ordinary Windows users

This CL is required for all.bat to work out of the box on
my Windows 8 laptop.

These tests either require the firewall to be turned off
or require the user to be in the Administrators group.
I don't know which.

Alex may follow up with a refinement of the test to
allow them to run if the user is in the Administrators
group.

Fixes #6392.

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

11 years agocmd/cgo: allow C.malloc(0) always
Russ Cox [Mon, 16 Sep 2013 18:04:55 +0000 (14:04 -0400)]
cmd/cgo: allow C.malloc(0) always

Because we can, and because it otherwise might crash
the program if we think we're out of memory.

Fixes #6390.

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

11 years agoruntime: make ARM integer div-by-zero traceback-friendly
Russ Cox [Mon, 16 Sep 2013 18:04:45 +0000 (14:04 -0400)]
runtime: make ARM integer div-by-zero traceback-friendly

The implementation of division in the 5 toolchain is a bit too magical.
Hide the magic from the traceback routines.

Also add a test for the results of the software divide routine.

Fixes #5805.

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

11 years agoruntime, syscall: work around FreeBSD/amd64 kernel bug
Russ Cox [Mon, 16 Sep 2013 18:04:32 +0000 (14:04 -0400)]
runtime, syscall: work around FreeBSD/amd64 kernel bug

The kernel implementation of the fast system call path,
the one invoked by the SYSCALL instruction, is broken for
restarting system calls. A C program demonstrating this is below.

Change the system calls to use INT $0x80 instead, because
that (perhaps slightly slower) system call path actually works.

I filed http://www.freebsd.org/cgi/query-pr.cgi?pr=182161.

The C program demonstrating that it is FreeBSD's fault is below.
It reports the same "Bad address" failures from wait.

#include <sys/time.h>
#include <sys/signal.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static void handler(int);
static void* looper(void*);

int
main(void)
{
        int i;
        struct sigaction sa;
        pthread_cond_t cond;
        pthread_mutex_t mu;

        memset(&sa, 0, sizeof sa);
        sa.sa_handler = handler;
        sa.sa_flags = SA_RESTART;
        memset(&sa.sa_mask, 0xff, sizeof sa.sa_mask);
        sigaction(SIGCHLD, &sa, 0);

        for(i=0; i<2; i++)
                pthread_create(0, 0, looper, 0);

        pthread_mutex_init(&mu, 0);
        pthread_mutex_lock(&mu);
        pthread_cond_init(&cond, 0);
        for(;;)
                pthread_cond_wait(&cond, &mu);

        return 0;
}

static void
handler(int sig)
{
}

int
mywait4(int pid, int *stat, int options, struct rusage *rusage)
{
        int result;

        asm("movq %%rcx, %%r10; syscall"
                : "=a" (result)
                : "a" (7),
                  "D" (pid),
                  "S" (stat),
                  "d" (options),
                  "c" (rusage));
}

static void*
looper(void *v)
{
        int pid, stat, out;
        struct rusage rusage;

        for(;;) {
                if((pid = fork()) == 0)
                        _exit(0);
                out = mywait4(pid, &stat, 0, &rusage);
                if(out != pid) {
                        printf("wait4 returned %d\n", out);
                }
        }
}

Fixes #6372.

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

11 years agocmd/go: document that "main" is a reserved import path
Rob Pike [Mon, 16 Sep 2013 12:53:12 +0000 (22:53 +1000)]
cmd/go: document that "main" is a reserved import path
Fixes #6312.

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

11 years agonet/rpc: log I/O and internal errors only if debugLog is set.
Han-Wen Nienhuys [Mon, 16 Sep 2013 06:29:04 +0000 (16:29 +1000)]
net/rpc: log I/O and internal errors only if debugLog is set.

Fixes #6367.

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

11 years agodoc/go1.2.html: add a "New packages" section similar to
Nigel Tao [Mon, 16 Sep 2013 06:26:07 +0000 (16:26 +1000)]
doc/go1.2.html: add a "New packages" section similar to
http://golang.org/doc/go1.1#new_packages

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

11 years agocmd/nm: put the -S flag in the usage message
Rob Pike [Mon, 16 Sep 2013 06:13:27 +0000 (16:13 +1000)]
cmd/nm: put the -S flag in the usage message
The -S flag reports symbol size, but is missing from the usage message.

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

11 years agodoc: re-organize golang.org site content
Andrew Gerrand [Mon, 16 Sep 2013 05:47:13 +0000 (15:47 +1000)]
doc: re-organize golang.org site content

Remove "References" section.
Remove most articles and redirect to blog.golang.org.
Move /ref/spec and /ref/mem to /doc/spec and /doc/mem.
Remove duplicate links from the remaining
"Documents", "The Project", and "Help" pages.
Defer to the wiki for more links and community content.
Update command reference and mention cover tool.
Add "Pop-out" text to the front page.
Pick one of four videos at random to feature on the front page.

Fixes #2547.
Fixes #5561.
Fixes #6321.

R=r, dominik.honnef
CC=golang-dev
https://golang.org/cl/13724043