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

11 years agodoc/go1.2.html: compiler changes
Rob Pike [Mon, 16 Sep 2013 03:03:00 +0000 (13:03 +1000)]
doc/go1.2.html: compiler changes
Document the semantic changes within the gc toolchain.

Also delete the mention of unbalanced right delims in template
That change was rolled back.

Absent typos, things we've forgotten, and new things that happen,
the release notes are ready.

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

11 years agosort: move example to package level and simplify further
Andrew Gerrand [Mon, 16 Sep 2013 03:02:01 +0000 (13:02 +1000)]
sort: move example to package level and simplify further

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

11 years agodoc: add uninstallation instructions
Andrew Gerrand [Mon, 16 Sep 2013 01:20:07 +0000 (11:20 +1000)]
doc: add uninstallation instructions

Fixes #5821.

R=golang-dev, kamil.kisiel
CC=golang-dev
https://golang.org/cl/13720043

11 years agocmd/gofmt: document -s transformations
Andrew Gerrand [Mon, 16 Sep 2013 01:19:39 +0000 (11:19 +1000)]
cmd/gofmt: document -s transformations

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

11 years agodoc/go1.2.html: net/http, encoding, performance, library changes
Rob Pike [Mon, 16 Sep 2013 00:28:53 +0000 (10:28 +1000)]
doc/go1.2.html: net/http, encoding, performance, library changes
Everything is done except compiler changes and additional platforms, if any.

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

11 years agoencoding/gob: ignore chan and func fields of structures
Rob Pike [Mon, 16 Sep 2013 00:26:23 +0000 (10:26 +1000)]
encoding/gob: ignore chan and func fields of structures

Previously, fields of type chan or func caused an error.
Now we just treat them like unexported fields and ignore them.
This makes it easier to guarantee long-term compatibilty since
a substructure from another package cannot break gob
encoding by adding a func or chan field.

Fixes #6071

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

11 years agoruntime: fix CPU profiling on Windows
Russ Cox [Sun, 15 Sep 2013 16:05:24 +0000 (12:05 -0400)]
runtime: fix CPU profiling on Windows

The test 'gp == m->curg' is not valid on Windows,
because the goroutine being profiled is not from the
current m.

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

11 years agogo/build: add ctxt.MatchFile
Russ Cox [Sun, 15 Sep 2013 15:29:47 +0000 (11:29 -0400)]
go/build: add ctxt.MatchFile

Fixes #6369.

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

11 years agoencoding/xml: document behavior for undefined name space prefixes
Russ Cox [Sun, 15 Sep 2013 15:29:06 +0000 (11:29 -0400)]
encoding/xml: document behavior for undefined name space prefixes

Fixes #5626.

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

11 years agofmt: %b for complex64 and complex128
Rob Pike [Sun, 15 Sep 2013 00:45:36 +0000 (10:45 +1000)]
fmt: %b for complex64 and complex128
Just an oversight they were missing.
Fixes #6387

R=golang-dev, dominik.honnef, rsc
CC=golang-dev
https://golang.org/cl/13715043

11 years agocmd/gc: don't generate algs for internal map types.
Rémy Oudompheng [Sat, 14 Sep 2013 07:30:36 +0000 (09:30 +0200)]
cmd/gc: don't generate algs for internal map types.

Fake types describing the internal structure of hashmaps are
generated for use by precise GC.

Generating hash and eq functions for these fake types slows down
the build and wastes space: the go tool binary size is 13MB
instead of 12MB, and the package size on amd64 is 48.7MB instead
of 45.3MB.

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

11 years agoos/exec: add more caveats to StdoutPipe, StderrPipe
Russ Cox [Fri, 13 Sep 2013 19:43:54 +0000 (15:43 -0400)]
os/exec: add more caveats to StdoutPipe, StderrPipe

(StdinPipe was taken care of by CL 13329043.)

Fixes #6008.

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

11 years agoruntime: avoid inconsistent goroutine state in profiler
Russ Cox [Fri, 13 Sep 2013 18:19:23 +0000 (14:19 -0400)]
runtime: avoid inconsistent goroutine state in profiler

Because profiling signals can arrive at any time, we must
handle the case where a profiling signal arrives halfway
through a goroutine switch. Luckily, although there is much
to think through, very little needs to change.

Fixes #6000.
Fixes #6015.

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

11 years agoreflect: document FieldByName shortcoming
Russ Cox [Fri, 13 Sep 2013 17:56:39 +0000 (13:56 -0400)]
reflect: document FieldByName shortcoming

Fixes #4876.

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

11 years agosyscall: add TCIOFLUSH family of constants
Dave Cheney [Fri, 13 Sep 2013 05:01:22 +0000 (15:01 +1000)]
syscall: add TCIOFLUSH family of constants

Fixes #6355.

zerrors_linux_{386,amd64,arm}.go were regenerated using mkerrors.sh but I opted to add the three TC.*FLUSH lines by hand to keep the diff smaller and avoid problems with the API checker.

I'll check freebsd and darwin, could I ask for help with net/open bsd.

R=mikioh.mikioh, jsing, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/13660043

11 years agocmd/5l: fix handling of RET.EQ in wrapper function
Russ Cox [Fri, 13 Sep 2013 03:50:50 +0000 (03:50 +0000)]
cmd/5l: fix handling of RET.EQ in wrapper function

Keith is too clever for me.

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

11 years agogoyacc: Fix debug printing of the lexed token's ID and name, and add whitespace in...
Jamie Wilkinson [Fri, 13 Sep 2013 03:18:02 +0000 (13:18 +1000)]
goyacc: Fix debug printing of the lexed token's ID and name, and add whitespace in the 'stateX saw' message.

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

11 years agoC: Jamie Wilkinson (Googler CLA)
Rob Pike [Fri, 13 Sep 2013 03:17:47 +0000 (13:17 +1000)]
C: Jamie Wilkinson (Googler CLA)

R=golang-dev, dave, adg, dsymonds
CC=golang-dev
https://golang.org/cl/13692043

11 years agotext/template/parse: mostly roll back the error detection for unmatched right delimiters
Rob Pike [Fri, 13 Sep 2013 02:44:45 +0000 (12:44 +1000)]
text/template/parse: mostly roll back the error detection for unmatched right delimiters
It's too late to change this behavior: it breaks templates with minimized JavaScript.

Makes me sad because this common error can never be caught: "{foo}}".
Three cheers for compatibility.

(Leave in a fix to a broken test.)

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

11 years agocmd/go: do not support code.google.com/r/zzz projects
Russ Cox [Fri, 13 Sep 2013 01:47:56 +0000 (21:47 -0400)]
cmd/go: do not support code.google.com/r/zzz projects

This reverts CL 13261048. I have just learned that these are
no longer supported on code.google.com (that is, it is impossible
to create them), so there is little reason to add support in
Go 1.2.

Update #5408

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

11 years agomisc/dist: include cover and vet, add -tool flag to specify go.tools tag
Andrew Gerrand [Fri, 13 Sep 2013 00:28:30 +0000 (10:28 +1000)]
misc/dist: include cover and vet, add -tool flag to specify go.tools tag

Fixes #6356.

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

11 years agoencoding/xml: add Encoder.Flush
Russ Cox [Thu, 12 Sep 2013 20:54:01 +0000 (16:54 -0400)]
encoding/xml: add Encoder.Flush

Fixes #6365.

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

11 years agoruntime, cmd/gc, cmd/ld: ignore method wrappers in recover
Russ Cox [Thu, 12 Sep 2013 18:00:16 +0000 (14:00 -0400)]
runtime, cmd/gc, cmd/ld: ignore method wrappers in recover

Bug #1:

Issue 5406 identified an interesting case:
        defer iface.M()
may end up calling a wrapper that copies an indirect receiver
from the iface value and then calls the real M method. That's
two calls down, not just one, and so recover() == nil always
in the real M method, even during a panic.

[For the purposes of this entire discussion, a wrapper's
implementation is a function containing an ordinary call, not
the optimized tail call form that is somtimes possible. The
tail call does not create a second frame, so it is already
handled correctly.]

Fix this bug by introducing g->panicwrap, which counts the
number of bytes on current stack segment that are due to
wrapper calls that should not count against the recover
check. All wrapper functions must now adjust g->panicwrap up
on entry and back down on exit. This adds slightly to their
expense; on the x86 it is a single instruction at entry and
exit; on the ARM it is three. However, the alternative is to
make a call to recover depend on being able to walk the stack,
which I very much want to avoid. We have enough problems
walking the stack for garbage collection and profiling.
Also, if performance is critical in a specific case, it is already
faster to use a pointer receiver and avoid this kind of wrapper
entirely.

Bug #2:

The old code, which did not consider the possibility of two
calls, already contained a check to see if the call had split
its stack and so the panic-created segment was one behind the
current segment. In the wrapper case, both of the two calls
might split their stacks, so the panic-created segment can be
two behind the current segment.

Fix this by propagating the Stktop.panic flag forward during
stack splits instead of looking backward during recover.

Fixes #5406.

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

11 years agogo/token: rename RemoveLine to MergeLine, improve documentation
Josh Bleecher Snyder [Thu, 12 Sep 2013 16:31:07 +0000 (09:31 -0700)]
go/token: rename RemoveLine to MergeLine, improve documentation

This is a follow-up to feedback from gri in
https://golang.org/cl/12837044/. Most of the wording
and naming improvements are lifted shamelessly from him.

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

11 years agocrypto/x509: allow ECDSA public keys to be marshaled.
Nicholas Sullivan [Thu, 12 Sep 2013 16:23:34 +0000 (12:23 -0400)]
crypto/x509: allow ECDSA public keys to be marshaled.

The public key serialization from CreateCertificate is factored out to be
used in MarshalPKIXPublicKey.
Testcode with one P224 ECDSA keypair has been added.

R=golang-dev, agl
CC=agl, golang-dev
https://golang.org/cl/13427044

11 years agoA+C: Nicholas Sullivan
Adam Langley [Thu, 12 Sep 2013 15:17:37 +0000 (11:17 -0400)]
A+C: Nicholas Sullivan

Generated by addca.

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