]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agonet/rpc: call client.Close() when test exit
ChaiShushan [Mon, 24 Jun 2013 20:18:50 +0000 (13:18 -0700)]
net/rpc: call client.Close() when test exit

Fixes #5768.

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

11 years agomisc/{bbedit|IntelliJIDEA|kate}: add missing delete predeclared identifier
ChaiShushan [Mon, 24 Jun 2013 20:17:56 +0000 (13:17 -0700)]
misc/{bbedit|IntelliJIDEA|kate}: add missing delete predeclared identifier

In general the description should describe what is added or fixed,
not how it was done (the code does this), but in this case the cause
was delete was missing, so the fix is to add it.

Fixes  issue 5765.

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

11 years agoruntime/pprof: disable testing under race detector
Dmitriy Vyukov [Mon, 24 Jun 2013 19:51:00 +0000 (23:51 +0400)]
runtime/pprof: disable testing under race detector
until we decide what to do with issues 5659/5736.
Profiling with race detector is not very useful in general,
and now it makes race builders red.

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

11 years agotime: avoid garbage collector aliasing bug
Russ Cox [Mon, 24 Jun 2013 18:49:35 +0000 (14:49 -0400)]
time: avoid garbage collector aliasing bug

Time is a tiny struct, so the compiler copies a Time by
copying each of the three fields.

The layout of a time on amd64 is [ptr int32 gap32 ptr].
Copying a Time onto a location that formerly held a pointer in the
second word changes only the low 32 bits, creating a different
but still plausible pointer. This confuses the garbage collector
when it appears in argument or result frames.

To avoid this problem, declare nsec as uintptr, so that there is
no gap on amd64 anymore, and therefore no partial pointers.

Note that rearranging the fields to put the int32 last still leaves
a gap - [ptr ptr int32 gap32] - because Time must have a total
size that is ptr-width aligned.

Update #5749

This CL is enough to fix the problem, but we should still do
the other actions listed in the initial report. We're not too far
from completely precise collection.

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

11 years agocompress/bzip2: don't panic on invalid input.
Adam Langley [Mon, 24 Jun 2013 14:59:41 +0000 (10:59 -0400)]
compress/bzip2: don't panic on invalid input.

Fixes 5747.

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

11 years agoruntime: do not generate code during runtime in windows NewCallback
Alex Brainman [Mon, 24 Jun 2013 07:17:45 +0000 (17:17 +1000)]
runtime: do not generate code during runtime in windows NewCallback

Update #5494

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

11 years agomisc/notepadplus: add missing operator keyword
ChaiShushan [Mon, 24 Jun 2013 04:19:00 +0000 (14:19 +1000)]
misc/notepadplus: add missing operator keyword

In general the description should describe what is added or fixed,
not how it was done (the code does this), but in this
case the cause were "/ /= ;" was missing,
so the fix is to add it.

Fixes #5761.

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

11 years agomisc/notepadplus: add missing delete keyword
ChaiShushan [Mon, 24 Jun 2013 03:28:10 +0000 (13:28 +1000)]
misc/notepadplus: add missing delete keyword

In general the description should describe what is added or fixed, not how it was done (the code does this), but in this case the cause was delete was missing, so the fix is to add it.

Fixes #5759.

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

11 years agoA+C: ChaiShushan (individual CLA)
Andrew Gerrand [Mon, 24 Jun 2013 03:27:39 +0000 (13:27 +1000)]
A+C: ChaiShushan (individual CLA)

Generated by addca.

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

11 years agoos: rename error_posix.go to error_unix.go
Dave Cheney [Mon, 24 Jun 2013 01:23:37 +0000 (11:23 +1000)]
os: rename error_posix.go to error_unix.go

The tradition is to use _posix when the platform extends beyond unix variants. As windows has its own file, rename to the more usual _unix.

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

11 years agocmd/gc: fix pointer composite literals in exported if statements.
Rémy Oudompheng [Sun, 23 Jun 2013 16:39:07 +0000 (18:39 +0200)]
cmd/gc: fix pointer composite literals in exported if statements.

Fixes #4230 (again).

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

11 years agotime: handle integer overflow in Sub
Rick Arnold [Sat, 22 Jun 2013 01:07:57 +0000 (18:07 -0700)]
time: handle integer overflow in Sub

If time.Sub results in a value that won't fit in a Duration (int64),
return either the min or max int64 value as appropriate.

Fixes #5011.

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

11 years agosyscall: reduce duplication between *bsd and linux
Dave Cheney [Sat, 22 Jun 2013 01:03:40 +0000 (11:03 +1000)]
syscall: reduce duplication between *bsd and linux

See discussion: https://groups.google.com/forum/#!topic/golang-dev/zSmH0lQxKAs

Part 1 of several.

Move identical types and functions to syscall_unix.go.

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

11 years agospec: fix spec on conversions to match implementations
Robert Griesemer [Fri, 21 Jun 2013 23:11:13 +0000 (16:11 -0700)]
spec: fix spec on conversions to match implementations

The existing compilers convert empty strings to empty
but non-nil byte and rune slices. The spec required
a nil byte and rune slice in those cases. That seems
an odd additional requirement. Adjust the spec to
match the reality.

Also, removed over-specification for conversions of
nil []byte and []rune: such nil slices already act
like empty slices and thus don't need extra language.
Added extra examples instead.

Fixes #5704.

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

11 years agogo/parser: always provide a non-nil path for imports
Robert Griesemer [Fri, 21 Jun 2013 22:09:04 +0000 (15:09 -0700)]
go/parser: always provide a non-nil path for imports

The go/ast ImportSpec always requires a non-nil path.

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

11 years agotesting: include cover mode in cover profile
Rob Pike [Fri, 21 Jun 2013 21:19:08 +0000 (14:19 -0700)]
testing: include cover mode in cover profile

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

11 years agogo/*: support for slices with cap: s[:j:k] and s[i:j:k]
Robert Griesemer [Fri, 21 Jun 2013 20:14:06 +0000 (13:14 -0700)]
go/*: support for slices with cap: s[:j:k] and s[i:j:k]

Experimental, per rsc's proposal.

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

11 years agocmd/6a, cmd/6l: add PCLMULQDQ instruction.
Adam Langley [Fri, 21 Jun 2013 19:17:13 +0000 (15:17 -0400)]
cmd/6a, cmd/6l: add PCLMULQDQ instruction.

This Intel instruction implements multiplication in binary fields.

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

11 years agoall: avoid leaking fds during tests
Dave Cheney [Fri, 21 Jun 2013 01:13:14 +0000 (11:13 +1000)]
all: avoid leaking fds during tests

trivial: it is not a serious problem to leak a fd in a short lived process, but it was obscuring my investigation of issue 5593.

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

11 years agoall: excise some warts found by vet -shadow
Rob Pike [Thu, 20 Jun 2013 23:14:40 +0000 (16:14 -0700)]
all: excise some warts found by vet -shadow
These are not erroneous, just poor or confusing.

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

11 years agodoc: update gccgo docs
Ian Lance Taylor [Thu, 20 Jun 2013 21:49:15 +0000 (14:49 -0700)]
doc: update gccgo docs

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

11 years agonet/http: fix confusing shadowing in ProxyFromEnvironment
Brad Fitzpatrick [Thu, 20 Jun 2013 18:58:24 +0000 (11:58 -0700)]
net/http: fix confusing shadowing in ProxyFromEnvironment

The old code worked, somewhat on accident, but was confusing,
and had a useless assignment to the inner err. It worked
because url.Parse parses just about anything, so the outer err
was always nil, so it always fell through to the bottom return
statement, even without the "err = nil" line.

Instead, just have two return statements, and add a comment.

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

11 years agoall: fix shadowing bugs found by go tool vet -shadow
Rob Pike [Thu, 20 Jun 2013 18:50:44 +0000 (11:50 -0700)]
all: fix shadowing bugs found by go tool vet -shadow

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

11 years agocmd/go: put the coverage information on the summary line.
Rob Pike [Thu, 20 Jun 2013 17:27:44 +0000 (10:27 -0700)]
cmd/go: put the coverage information on the summary line.
Output now:
ok   crypto/aes 0.060s coverage: 89.8% of statements
ok   crypto/des 0.074s coverage: 92.2% of statements
ok   crypto/dsa 0.056s coverage: 34.5% of statements
ok   crypto/ecdsa 0.058s coverage: 86.8% of statements
ok   crypto/elliptic 0.039s coverage: 94.6% of statements
ok   crypto/hmac 0.037s coverage: 93.5% of statements
ok   crypto/md5 0.031s coverage: 96.2% of statements
ok   crypto/rand 0.074s coverage: 9.9% of statements
ok   crypto/rc4 0.090s coverage: 66.7% of statements
ok   crypto/rsa 0.253s coverage: 83.5% of statements

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

11 years agocrypto/x509: add function to marshal EC private keys.
Adam Langley [Thu, 20 Jun 2013 16:14:16 +0000 (12:14 -0400)]
crypto/x509: add function to marshal EC private keys.

This complements the parsing function that we already have.

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

11 years agotest: match gccgo error messages
Rémy Oudompheng [Thu, 20 Jun 2013 06:21:14 +0000 (08:21 +0200)]
test: match gccgo error messages

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

11 years agocmd/go: document that files beginning with . or _ are ignored
Andrew Gerrand [Thu, 20 Jun 2013 00:29:38 +0000 (10:29 +1000)]
cmd/go: document that files beginning with . or _ are ignored

Fixes #5655.

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

11 years agocrypto/tls: change advertised ciphersuite order.
Adam Langley [Wed, 19 Jun 2013 20:46:53 +0000 (16:46 -0400)]
crypto/tls: change advertised ciphersuite order.

TLS clients send ciphersuites in preference order (most prefereable
first). This change alters the order so that ECDHE comes before plain
RSA, and RC4 comes before AES (because of the Lucky13 attack).

This is unlikely to have much effect: as a server, the code uses the
client's ciphersuite order by default and, as a client, the non-Go
server probably imposes its order.

R=golang-dev, r, raggi, jsing
CC=golang-dev
https://golang.org/cl/10372045

11 years agocmd/go: another attempt at flag handling for coverage
Rob Pike [Wed, 19 Jun 2013 16:44:40 +0000 (09:44 -0700)]
cmd/go: another attempt at flag handling for coverage
The -cover flag is now just enable/disable and is implied if
either of the other flags is set.

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

11 years agocmd/go: simplify flags for coverage
Rob Pike [Wed, 19 Jun 2013 00:15:26 +0000 (17:15 -0700)]
cmd/go: simplify flags for coverage
The single flag -cover provides the default simplest behavior.
The other flags, -covermode and -coverprofile, provide more
control. The three flags interconnect to work well.

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

11 years agocmd/go: write coverage to file, add percentage statistic
Rob Pike [Tue, 18 Jun 2013 21:18:25 +0000 (14:18 -0700)]
cmd/go: write coverage to file, add percentage statistic
Move the data dumper to the testing package, where it has access
to file I/O.
Print a percentage value at the end of the run.

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

11 years agomath/big: fix Errorf verb
Robert Griesemer [Tue, 18 Jun 2013 21:16:40 +0000 (14:16 -0700)]
math/big: fix Errorf verb

Pointed out by go vet.

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

11 years agocmd/gc: fix race detector on tail-call wrappers
Russ Cox [Tue, 18 Jun 2013 18:43:37 +0000 (14:43 -0400)]
cmd/gc: fix race detector on tail-call wrappers

(By not using the tail-call wrappers when the race
detector is enabled.)

R=golang-dev, minux.ma, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/10227043

11 years agoos/exec: make exec_test.go:TestExtraFilesFDShuffle portable.
Cosmos Nicolaou [Tue, 18 Jun 2013 15:55:32 +0000 (08:55 -0700)]
os/exec: make exec_test.go:TestExtraFilesFDShuffle portable.

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

11 years agocmd/cgo: avoid leaking fds
Dave Cheney [Tue, 18 Jun 2013 13:20:17 +0000 (23:20 +1000)]
cmd/cgo: avoid leaking fds

Fixes #5714.

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

11 years agodoc: style tweaks in preparation for Google Feedback link
Andrew Gerrand [Tue, 18 Jun 2013 05:26:15 +0000 (15:26 +1000)]
doc: style tweaks in preparation for Google Feedback link

Fixes #5589.

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

11 years agomisc/vim: Added filetype settings for comments.
David Bürgin [Tue, 18 Jun 2013 04:59:50 +0000 (14:59 +1000)]
misc/vim: Added filetype settings for comments.

This basic Vim ftplugin sets the 'comments' and 'commentstring'
settings to sensible values. Future filetype settings for Go
would go in the same file.
The ftplugin was added as misc/vim/ftplugin/go/go.vim, this way
the installation instructions in readme.txt remain valid.
Fixes #5715.

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

11 years agoA+C: David Bürgin (individual CLA)
David Symonds [Tue, 18 Jun 2013 04:59:23 +0000 (14:59 +1000)]
A+C: David Bürgin (individual CLA)

Generated by addca.

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

11 years agonet/smtp: close conn in SendMail; add Client.Close method
Alex Jin [Mon, 17 Jun 2013 23:53:27 +0000 (16:53 -0700)]
net/smtp: close conn in SendMail; add Client.Close method

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

11 years agoA+C: Alex Jin (individual CLA)
Brad Fitzpatrick [Mon, 17 Jun 2013 23:42:15 +0000 (16:42 -0700)]
A+C: Alex Jin (individual CLA)

Generated by addca.

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

11 years agocrypto/x509: Added RFC 5280, section 4.2.1.14 to parseCertificate and buildExtensions
Paul van Brouwershaven [Mon, 17 Jun 2013 21:56:45 +0000 (14:56 -0700)]
crypto/x509: Added RFC 5280, section 4.2.1.14 to parseCertificate and buildExtensions
Support for CRL Distribution Points

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

11 years agoA+C: Paul van Brouwershaven (individual CLA)
Brad Fitzpatrick [Mon, 17 Jun 2013 21:55:26 +0000 (14:55 -0700)]
A+C: Paul van Brouwershaven (individual CLA)

Generated by addca.

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

11 years agonet: fix LookupNS on Plan 9
Nicolas Owens [Mon, 17 Jun 2013 18:38:07 +0000 (11:38 -0700)]
net: fix LookupNS on Plan 9

use correct field count when resolving nameservers via /net/dns on Plan 9.

we incorrectly check for 4 fields instead of 3 when parsing the result of /net/dns, and get no results

R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/10182044

11 years agoA+C: Nicolas Owens (individual CLA)
Brad Fitzpatrick [Mon, 17 Jun 2013 18:37:50 +0000 (11:37 -0700)]
A+C: Nicolas Owens (individual CLA)

Generated by addca.

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

11 years agotesting: use -bench flag and fix flags doc link
Dan Peterson [Mon, 17 Jun 2013 14:32:28 +0000 (07:32 -0700)]
testing: use -bench flag and fix flags doc link

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

11 years agoA+C: Dan Peterson (individual CLA)
Brad Fitzpatrick [Mon, 17 Jun 2013 14:31:39 +0000 (07:31 -0700)]
A+C: Dan Peterson (individual CLA)

Generated by addca.

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

11 years agocrypto/cipher: StreamWriter.Closer docs + behavior change
Brad Fitzpatrick [Mon, 17 Jun 2013 14:30:04 +0000 (07:30 -0700)]
crypto/cipher: StreamWriter.Closer docs + behavior change

Don't panic when the underlying Writer isn't a Closer. And
document what Close does and clarify that it's not a Flush.

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

11 years agoruntime/race: add tests for method thunks
Dmitriy Vyukov [Mon, 17 Jun 2013 13:59:53 +0000 (17:59 +0400)]
runtime/race: add tests for method thunks

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

11 years agoruntime: fix test for new closure representation
Dmitriy Vyukov [Mon, 17 Jun 2013 11:41:17 +0000 (15:41 +0400)]
runtime: fix test for new closure representation
I've hit it several times already.
Currently it crashes with nil deref.

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

11 years agorun.bash: raise ulimit for the number of threads.
Benny Siegert [Mon, 17 Jun 2013 09:31:58 +0000 (19:31 +1000)]
run.bash: raise ulimit for the number of threads.

This is needed on NetBSD-current. Support for
ulimit -T in bash was added in 4.2nb3.

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

11 years agoruntime: fix race condition between GC and setGCPercent
Dmitriy Vyukov [Sat, 15 Jun 2013 12:07:06 +0000 (16:07 +0400)]
runtime: fix race condition between GC and setGCPercent
If first GC runs concurrently with setGCPercent,
it can overwrite gcpercent value with default.

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

11 years agoruntime: improve scheduler fairness
Dmitriy Vyukov [Sat, 15 Jun 2013 12:06:28 +0000 (16:06 +0400)]
runtime: improve scheduler fairness
Currently global runqueue is starved if a group of goroutines
constantly respawn each other (local runqueue never becomes empty).
Fixes #5639.

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

11 years agoruntime: remove unused moreframesize_minalloc field
Dmitriy Vyukov [Sat, 15 Jun 2013 12:02:39 +0000 (16:02 +0400)]
runtime: remove unused moreframesize_minalloc field
It was used to request large stack segment for GC
when it was running not on g0.
Now GC is running on g0 with large stack,
and it is not needed anymore.

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

11 years agocmd/godoc: don't link unexported identifiers
Jonathan Rudenberg [Fri, 14 Jun 2013 19:37:23 +0000 (12:37 -0700)]
cmd/godoc: don't link unexported identifiers

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

11 years agoruntime: garbage collector runs on g0 now.
Keith Randall [Fri, 14 Jun 2013 18:42:51 +0000 (11:42 -0700)]
runtime: garbage collector runs on g0 now.
No need to change to Grunnable state.
Add some more checks for Grunning state.

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

11 years agoapi: update next.txt
Brad Fitzpatrick [Fri, 14 Jun 2013 17:00:07 +0000 (10:00 -0700)]
api: update next.txt

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

11 years agonet: coalesce duplicate in-flight DNS lookups
Brad Fitzpatrick [Fri, 14 Jun 2013 15:59:43 +0000 (08:59 -0700)]
net: coalesce duplicate in-flight DNS lookups

In Issue 5625, Russ says: "We should at least have a cache of
inflight lookups, so that 100 simultaneous dials of one host
name don't do the work 100x. That's easy and (assume we forget
the answer once they all get it) doesn't pose any consistency
problems. It just merges simultaneous work."

This brings in singleflight (unexported) from Google /
Camlistore, but without its tests. Maybe we should put it
somewhere in the standard library. But not now.

Update #5625

R=golang-dev, iant, cespare, rsc, dave, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/10079043

11 years agocmd/gc: instrument arrays properly in race detector.
Rémy Oudompheng [Fri, 14 Jun 2013 09:14:45 +0000 (11:14 +0200)]
cmd/gc: instrument arrays properly in race detector.

The previous implementation would only record access to
the address of the array but the memory access to the whole
memory range must be recorded instead.

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

11 years agostrconv: corrected several bad references to err.Error in doc comments.
Caleb Spare [Fri, 14 Jun 2013 00:04:47 +0000 (17:04 -0700)]
strconv: corrected several bad references to err.Error in doc comments.

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

11 years agocmd/go: change to use struct in go test -cover
Rob Pike [Thu, 13 Jun 2013 20:12:58 +0000 (13:12 -0700)]
cmd/go: change to use struct in go test -cover
Go tool half of https://golang.org/cl/10271044

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

11 years agogo/ast: add {L,R}paren token.Pos field to ast.TypeAssertExpr.
Alan Donovan [Thu, 13 Jun 2013 18:41:44 +0000 (14:41 -0400)]
go/ast: add {L,R}paren token.Pos field to ast.TypeAssertExpr.

These are required to correctly determine the End() of the node.

Also set these fields in go/parser and use them in go/printer.

This is a backward-compatible API change.

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

11 years agoruntime: fix bug introduced in cl/10256043
Dmitriy Vyukov [Thu, 13 Jun 2013 12:40:10 +0000 (16:40 +0400)]
runtime: fix bug introduced in cl/10256043

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

11 years agoruntime/race: remove now unused step parameter from range access functions
Dmitriy Vyukov [Thu, 13 Jun 2013 12:38:44 +0000 (16:38 +0400)]
runtime/race: remove now unused step parameter from range access functions

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

11 years agocmd/gc: properly race-instrument for loops
Dmitriy Vyukov [Thu, 13 Jun 2013 12:03:58 +0000 (16:03 +0400)]
cmd/gc: properly race-instrument for loops
Instrumentation of ntest expression should go to ntest->init.
Same for nincr.
Fixes #5340.

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

11 years agoruntime: use ROUND macro for rounding
Dmitriy Vyukov [Thu, 13 Jun 2013 12:02:50 +0000 (16:02 +0400)]
runtime: use ROUND macro for rounding

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

11 years agoruntime/race: update runtime to r183644
Dmitriy Vyukov [Thu, 13 Jun 2013 10:32:05 +0000 (14:32 +0400)]
runtime/race: update runtime to r183644
This revision properly handles memory range accesses.
Fixes #4453.
Fixes #5654.

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

11 years agomisc/vim: Adding flag-guarding for Vim commands
Josh Hoak [Thu, 13 Jun 2013 05:07:09 +0000 (15:07 +1000)]
misc/vim: Adding flag-guarding for Vim commands

Default behavior is the same as before, but now a user may selectively disable some commands.

Also: deleted the mappings for import.vim.

Tested: by trying the commands for fmt, import and godoc in succession to make sure they still work. Also, ran test.sh in ftplugin/go.

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

11 years agotag go1.1.1
Andrew Gerrand [Thu, 13 Jun 2013 02:52:02 +0000 (12:52 +1000)]
tag go1.1.1

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

11 years agodoc: add go1.1.1 to the release notes
Andrew Gerrand [Thu, 13 Jun 2013 02:43:26 +0000 (12:43 +1000)]
doc: add go1.1.1 to the release notes

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

11 years agotesting: add -outputdir flag so "go test" controls where the files are written
Rob Pike [Thu, 13 Jun 2013 01:13:34 +0000 (18:13 -0700)]
testing: add -outputdir flag so "go test" controls where the files are written
Obscure misfeature now fixed: When run from "go test", profiles were always
written in the package's source directory. This change puts them in the directory
where "go test" is run.
Also fix a couple of problems causing errors in testing.after to go unreported
unless -v was set.

R=rsc, minux.ma, iant, alex.brainman
CC=golang-dev
https://golang.org/cl/10234044

11 years agoruntime: update runtime·gogo comment in asm files
Ian Lance Taylor [Wed, 12 Jun 2013 22:05:10 +0000 (15:05 -0700)]
runtime: update runtime·gogo comment in asm files

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

11 years agoruntime: add lr, ctxt, ret to Gobuf
Russ Cox [Wed, 12 Jun 2013 19:22:26 +0000 (15:22 -0400)]
runtime: add lr, ctxt, ret to Gobuf

Add gostartcall and gostartcallfn.
The old gogocall = gostartcall + gogo.
The old gogocallfn = gostartcallfn + gogo.

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

11 years agoruntime: more flexible heap memory mapping on 64-bits
Dmitriy Vyukov [Wed, 12 Jun 2013 14:47:16 +0000 (18:47 +0400)]
runtime: more flexible heap memory mapping on 64-bits
Fixes #5641.

R=golang-dev, dave, daniel.morsing, iant
CC=golang-dev, kcc
https://golang.org/cl/10126044

11 years agoruntime: fix scheduler race condition
Dmitriy Vyukov [Wed, 12 Jun 2013 14:46:35 +0000 (18:46 +0400)]
runtime: fix scheduler race condition
In starttheworld() we assume that P's with local work
are situated in the beginning of idle P list.
However, once we start the first M, it can execute all local G's
and steal G's from other P's.
That breaks the assumption above. Thus starttheworld() will fail
to start some P's with local work.
It seems that it can not lead to very bad things, but still
it's wrong and breaks other assumtions
(e.g. we can have a spinning M with local work).
The fix is to collect all P's with local work first,
and only then start them.

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

11 years agoruntime: fix plan9, windows builds
Russ Cox [Wed, 12 Jun 2013 13:41:29 +0000 (09:41 -0400)]
runtime: fix plan9, windows builds

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

11 years agoruntime: fix build
Russ Cox [Wed, 12 Jun 2013 13:06:28 +0000 (09:06 -0400)]
runtime: fix build

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

11 years agoruntime: adjust traceback / garbage collector boundary
Russ Cox [Wed, 12 Jun 2013 12:49:38 +0000 (08:49 -0400)]
runtime: adjust traceback / garbage collector boundary

The garbage collection routine addframeroots is duplicating
logic in the traceback routine that calls it, sometimes correctly,
sometimes incorrectly, sometimes incompletely.
Pass necessary information to addframeroots instead of
deriving it anew.

Should make addframeroots significantly more robust.
It's certainly smaller.

Also try to standardize on uintptr for saved pc, sp values.

Will make CL 10036044 trivial.

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

11 years agocmd/go: diagnose invalid coverage runs
Russ Cox [Wed, 12 Jun 2013 12:42:05 +0000 (08:42 -0400)]
cmd/go: diagnose invalid coverage runs

# bufio
coverage analysis cannot handle package (bufio_test imports testing imports bufio)
# bytes
coverage analysis cannot handle package (bytes_test imports encoding/base64 imports bytes)
# crypto/cipher
coverage analysis cannot handle package (cipher_test imports crypto/aes imports crypto/cipher)
# debug/dwarf
coverage analysis cannot handle package (dwarf_test imports debug/elf imports debug/dwarf)
# errors
coverage analysis cannot handle package (errors_test imports fmt imports errors)
# flag
coverage analysis cannot handle package (flag_test imports testing imports flag)
# fmt
coverage analysis cannot handle package (fmt_test imports testing imports fmt)
# go/ast
coverage analysis cannot handle package (ast_test imports go/format imports go/ast)
# image
coverage analysis cannot handle package (image_test imports image/gif imports image)
# io
coverage analysis cannot handle package (io_test imports bytes imports io)
# math
coverage analysis cannot handle package (math_test imports fmt imports math)
# net/http
coverage analysis cannot handle package (http_test imports net/http/httptest imports net/http)
# os
coverage analysis cannot handle package (os_test imports flag imports os)
# path/filepath
coverage analysis cannot handle package (filepath_test imports io/ioutil imports path/filepath)
# reflect
coverage analysis cannot handle package (reflect_test imports flag imports reflect)
# runtime
coverage analysis cannot handle package (runtime_test imports fmt imports runtime)
# runtime/pprof
coverage analysis cannot handle package (pprof_test imports testing imports runtime/pprof)
# sort
coverage analysis cannot handle package (sort_test imports testing imports sort)
# strconv
coverage analysis cannot handle package (strconv_test imports fmt imports strconv)
# strings
coverage analysis cannot handle package (strings_test imports testing imports strings)
# sync
coverage analysis cannot handle package (sync_test imports fmt imports sync)
# sync/atomic
coverage analysis cannot handle package (atomic_test imports testing imports sync/atomic)
# syscall
coverage analysis cannot handle package (syscall_test imports flag imports syscall)
# text/tabwriter
coverage analysis cannot handle package (tabwriter_test imports testing imports text/tabwriter)
# time
coverage analysis cannot handle package (time_test imports encoding/gob imports time)
# unicode
coverage analysis cannot handle package (unicode_test imports testing imports unicode)
# unicode/utf8
coverage analysis cannot handle package (utf8_test imports bytes imports unicode/utf8)

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

11 years agocmd/go: clarify test filenames in help messages
Shenghou Ma [Wed, 12 Jun 2013 11:40:58 +0000 (19:40 +0800)]
cmd/go: clarify test filenames in help messages
Fixes #5655.

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

11 years agoC: add Josh Hoak (Google CLA).
David Symonds [Wed, 12 Jun 2013 04:05:13 +0000 (14:05 +1000)]
C: add Josh Hoak (Google CLA).

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

11 years agocmd/go: use -o option of cover tool
Rob Pike [Wed, 12 Jun 2013 03:47:35 +0000 (20:47 -0700)]
cmd/go: use -o option of cover tool
Separates correct from erroneous output so errors running the tool will appear
in the log.

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

11 years agocmd/gc: save local var list before inlining
Ian Lance Taylor [Wed, 12 Jun 2013 03:23:21 +0000 (20:23 -0700)]
cmd/gc: save local var list before inlining

This avoids problems with inlining in genwrappers, which
occurs after functions have been compiled.  Compiling a
function may cause some unused local vars to be removed from
the list.  Since a local var may be unused due to
optimization, it is possible that a removed local var winds up
beingused in the inlined version, in which case hilarity
ensues.

Fixes #5515.

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

11 years agocmd/gc: turn race detector off for tail-call method wrapper functions
Russ Cox [Wed, 12 Jun 2013 02:37:07 +0000 (22:37 -0400)]
cmd/gc: turn race detector off for tail-call method wrapper functions

It was off in the old implementation (because there was no high-level
description of the function at all). Maybe some day the race detector
should be fixed to handle the wrapper and then enabled for it, but there's
no reason that has to be today.

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

11 years agocmd/ld: supply -s to gcc if -s is passed.
Shenghou Ma [Tue, 11 Jun 2013 22:56:50 +0000 (06:56 +0800)]
cmd/ld: supply -s to gcc if -s is passed.
Fixes #5463.

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

11 years agoruntime: round spans_size up to page boundary
Shenghou Ma [Tue, 11 Jun 2013 21:22:49 +0000 (05:22 +0800)]
runtime: round spans_size up to page boundary
in case we have weird (not page aligned) memory limit.

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

11 years agoruntime: rename _rt0_$GOARCH to _rt0_go
Russ Cox [Tue, 11 Jun 2013 20:49:24 +0000 (16:49 -0400)]
runtime: rename _rt0_$GOARCH to _rt0_go

There's no reason to use a different name on each architecture,
and doing so makes it impossible for portable code to refer to
the original Go runtime entry point. Rename it _rt0_go everywhere.

This is a global search and replace only.

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

11 years agocmd/gc: compute initialization order for top-level blank vars too.
Rémy Oudompheng [Tue, 11 Jun 2013 20:21:51 +0000 (22:21 +0200)]
cmd/gc: compute initialization order for top-level blank vars too.

Fixes #5244.

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

11 years agocmd/gc: avoid creating circular lists when compiling with race detector.
Daniel Morsing [Tue, 11 Jun 2013 19:19:29 +0000 (21:19 +0200)]
cmd/gc: avoid creating circular lists when compiling with race detector.

Fixes #5431.

R=dvyukov, remyoudompheng, rsc
CC=gobot, golang-dev
https://golang.org/cl/9910043

11 years agocmd/go: add coverage analysis
Rob Pike [Tue, 11 Jun 2013 16:35:10 +0000 (09:35 -0700)]
cmd/go: add coverage analysis
This feature is not yet ready for real use. The CL marks a bite-sized
piece that is ready for review. TODOs that remain:
        provide control over output
        produce output without setting -v
        make work on reflect, sync and time packages
                (fail now due to link errors caused by inlining)
        better documentation
Almost all packages work now, though, if clumsily; try:
        go test -v -cover=count encoding/binary

R=rsc
CC=gobot, golang-dev, remyoudompheng
https://golang.org/cl/10050045

11 years agocmd/cc: emit size of locals. Will be used for stack copying.
Keith Randall [Tue, 11 Jun 2013 16:01:27 +0000 (09:01 -0700)]
cmd/cc: emit size of locals.  Will be used for stack copying.

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

11 years agocmd/gc: move genembedtramp into portable code
Russ Cox [Tue, 11 Jun 2013 13:41:49 +0000 (09:41 -0400)]
cmd/gc: move genembedtramp into portable code

Requires adding new linker instruction
        RET f(SB)
meaning return but then immediately call f.
This is what you'd use to implement a tail call after
fiddling with the arguments, but the compiler only
uses it in genwrapper.

This CL eliminates the copy-and-paste genembedtramp
functions from 5g/8g/6g and makes the code run on ARM
for the first time. It removes a small special case for function
generation, which should help Carl a bit, but at the same time
it does not bother to implement general tail call optimization,
which we do not want anyway.

Fixes #5627.

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

11 years agoos: request appropriate access rights before calling windows TerminateProcess
Alex Brainman [Tue, 11 Jun 2013 03:06:38 +0000 (13:06 +1000)]
os: request appropriate access rights before calling windows TerminateProcess

Fixes #5615.

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

11 years agoasn1: Improved encoding/decoding for OID types
Gerasimos Dimitriadis [Mon, 10 Jun 2013 22:14:47 +0000 (18:14 -0400)]
asn1: Improved encoding/decoding for OID types

The first identifier in an Object Identifer must be between 0 and 2
inclusive. The range of values that the second one can take depends
on the value of the first one.
The two first identifiers are not necessarily encoded in a single octet,
but in a varint.

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

11 years agocmd/ld: document -s flag.
Shenghou Ma [Mon, 10 Jun 2013 20:58:02 +0000 (04:58 +0800)]
cmd/ld: document -s flag.

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

11 years agocmd/cc: fix lexbody for negative chars
Russ Cox [Mon, 10 Jun 2013 20:13:25 +0000 (16:13 -0400)]
cmd/cc: fix lexbody for negative chars

The new code matches the code in cc/lex.c and the #define GETC.
This was causing problems scanning runtime·foo if the leading
· byte was returned by the buffer fill.

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

11 years agocmd/5l: use BLX for BL (Rx).
Shenghou Ma [Mon, 10 Jun 2013 19:04:24 +0000 (03:04 +0800)]
cmd/5l: use BLX for BL (Rx).
Fixes #5111.
Update #4718
This CL makes BL (Rx) to use BLX Rx instead of:
MOV LR, PC
MOV PC, Rx

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

11 years agoruntime: fix one-time memory leak on linux
Dmitriy Vyukov [Mon, 10 Jun 2013 18:59:39 +0000 (22:59 +0400)]
runtime: fix one-time memory leak on linux
Update #5641.

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

11 years agoruntime: catch races between channel close and channel send in select
Dmitriy Vyukov [Mon, 10 Jun 2013 18:58:04 +0000 (22:58 +0400)]
runtime: catch races between channel close and channel send in select

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

11 years agonet: introduce netgo build tag to build a pure Go net package.
Shenghou Ma [Mon, 10 Jun 2013 18:55:16 +0000 (02:55 +0800)]
net: introduce netgo build tag to build a pure Go net package.
Fixes #4078.

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

11 years agodoc/go_spec: more examples for unspecified cases of the evaluation order
Shenghou Ma [Mon, 10 Jun 2013 18:52:07 +0000 (02:52 +0800)]
doc/go_spec: more examples for unspecified cases of the evaluation order

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