]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agopath/filepath: add support for plan9
Andrey Mirtchovski [Sun, 3 Apr 2011 16:11:41 +0000 (09:11 -0700)]
path/filepath: add support for plan9

R=paulzhol, ality, r, fhs
CC=golang-dev
https://golang.org/cl/4316054

14 years agoos: add a few missing plan9 errors
Andrey Mirtchovski [Sun, 3 Apr 2011 15:52:43 +0000 (08:52 -0700)]
os: add a few missing plan9 errors

these were needed by packages in crypto/ and by io/ioutil

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

14 years agoMake.pkg: increase test timeout to 120 seconds.
Ian Lance Taylor [Sun, 3 Apr 2011 05:23:34 +0000 (22:23 -0700)]
Make.pkg: increase test timeout to 120 seconds.

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

14 years agoos: Plan 9 support.
Yuval Pavel Zholkover [Sat, 2 Apr 2011 21:28:58 +0000 (14:28 -0700)]
os: Plan 9 support.

R=rsc, ality, r, r2
CC=golang-dev
https://golang.org/cl/4149046

14 years agoR=rsc, brainman, ality, r2, r
Yuval Pavel Zholkover [Sat, 2 Apr 2011 21:24:03 +0000 (14:24 -0700)]
R=rsc, brainman, ality, r2, r
CC=golang-dev
https://golang.org/cl/3816043

14 years agogo/parser: package name must not be the blank identifier
Robert Griesemer [Sat, 2 Apr 2011 03:51:55 +0000 (20:51 -0700)]
go/parser: package name must not be the blank identifier

R=r, r2, rsc1
CC=golang-dev
https://golang.org/cl/4343045

14 years agosyscall: make Rawsyscall6 pass 6th arg on linux/386
Evan Shaw [Sat, 2 Apr 2011 02:26:57 +0000 (22:26 -0400)]
syscall: make Rawsyscall6 pass 6th arg on linux/386

Forgot this one in the previous CL

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

14 years agogc: avoid saying same error 3 times
Russ Cox [Sat, 2 Apr 2011 00:52:38 +0000 (20:52 -0400)]
gc: avoid saying same error 3 times

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

14 years agosyscall: make Syscall6 pass 6th arg on linux/386
Evan Shaw [Sat, 2 Apr 2011 00:46:01 +0000 (20:46 -0400)]
syscall: make Syscall6 pass 6th arg on linux/386

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

14 years agopath/filepath.Glob: don't drop known matches on error.
Rob Pike [Fri, 1 Apr 2011 16:58:05 +0000 (09:58 -0700)]
path/filepath.Glob: don't drop known matches on error.
Fixes #1610.

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

14 years agomisc/notepadplus: add syntax and completion support for notepad++
Anthony Starks [Fri, 1 Apr 2011 03:44:57 +0000 (14:44 +1100)]
misc/notepadplus: add syntax and completion support for notepad++

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

14 years agogotest: another attempt to make it run on Windows
Alex Brainman [Fri, 1 Apr 2011 02:38:33 +0000 (13:38 +1100)]
gotest: another attempt to make it run on Windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4347041

14 years agogotest: execute gomake properly on Windows
Alex Brainman [Thu, 31 Mar 2011 23:10:15 +0000 (10:10 +1100)]
gotest: execute gomake properly on Windows

R=peterGo, rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/4280087

14 years agotesting: add -test.timeout option.
Ian Lance Taylor [Thu, 31 Mar 2011 22:27:51 +0000 (15:27 -0700)]
testing: add -test.timeout option.

Since Go code can deadlock, this lets a testsuite driver set a
time limit for the test to run.  This is simple but imperfect,
in that it only catches deadlocks in Go code, not in the
runtime scheduler.

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

14 years agofmt: implement precs for %q.
Rob Pike [Thu, 31 Mar 2011 21:56:01 +0000 (14:56 -0700)]
fmt: implement precs for %q.
Also fix a bug: precision was in terms of bytes; should be runes.
Fixes #1652.

R=rsc, bradfitzgo, r2, bradfitzwork
CC=golang-dev
https://golang.org/cl/4280086

14 years agoroadmap: remove description of implementation of garbage collector.
Rob Pike [Thu, 31 Mar 2011 20:13:04 +0000 (13:13 -0700)]
roadmap: remove description of implementation of garbage collector.
It was speculation.
Also replace one silly word with an English replacement.

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4339041

14 years agohttp: add Transport.MaxIdleConnsPerHost
Brad Fitzpatrick [Thu, 31 Mar 2011 19:58:50 +0000 (12:58 -0700)]
http: add Transport.MaxIdleConnsPerHost

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

14 years agonet, syscall: fix windows build
Alexey Borzenkov [Thu, 31 Mar 2011 04:16:18 +0000 (15:16 +1100)]
net, syscall: fix windows build

Fix resolv_windows.go to support recent DNS-lookup changes

R=brainman, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4300045

14 years agogotest: another try at flags.
Rob Pike [Thu, 31 Mar 2011 04:14:49 +0000 (21:14 -0700)]
gotest: another try at flags.
doc.go contains the details. The short story:
- command line is passed to the binary
- a new flag, -file, is needed to name files
- known flags have the "test." prefix added for convenience.
- gotest-specific flags are trimmed from the command line.

The effect should be that most existing uses are unaffected,
the ability to name files is still present, and it's nicer to use.
The downside is a lot more code in gotest.

Also allow a test to be called just Test.

R=rsc, niemeyer, rog, r2
CC=golang-dev
https://golang.org/cl/4307049

14 years agogopack: comment out debugging print
Russ Cox [Thu, 31 Mar 2011 02:41:32 +0000 (22:41 -0400)]
gopack: comment out debugging print

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

14 years agogopack: add P flag to remove prefix from filename information
Russ Cox [Thu, 31 Mar 2011 02:19:02 +0000 (22:19 -0400)]
gopack: add P flag to remove prefix from filename information

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

14 years agofmt: remove uintptrGetter type checks
Russ Cox [Thu, 31 Mar 2011 02:12:30 +0000 (22:12 -0400)]
fmt: remove uintptrGetter type checks

This will make the fmt code easier to gofix
when the new reflect interface is ready.

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

14 years agogotype: support for more tests, added one new test
Robert Griesemer [Wed, 30 Mar 2011 22:27:23 +0000 (15:27 -0700)]
gotype: support for more tests, added one new test

also: minor fix to parser

Note: gotest won't run the gotype test yet until
it permits TestXXX functions where XXX is empty.

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

14 years agoscanner: treat line comments like in Go
Robert Griesemer [Wed, 30 Mar 2011 22:26:53 +0000 (15:26 -0700)]
scanner: treat line comments like in Go

- don't consume '\n' as part of line comment
(otherwise grammars where '\n' are tokens won't
see them after a line comment)

- permit line comments to end in EOF

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

14 years agotest: don't require specific GOARCH values.
Ian Lance Taylor [Wed, 30 Mar 2011 21:24:32 +0000 (14:24 -0700)]
test: don't require specific GOARCH values.

This lets the test work for gccgo on other architectures.

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

14 years agogotest: exclude . files when parsing directories (per r's suggestion)
Robert Griesemer [Wed, 30 Mar 2011 16:46:11 +0000 (09:46 -0700)]
gotest: exclude . files when parsing directories (per r's suggestion)

R=r, rsc1, iant2
CC=golang-dev
https://golang.org/cl/4329044

14 years agogo/parser: fix scoping for local type declarations
Roger Peppe [Wed, 30 Mar 2011 16:45:51 +0000 (09:45 -0700)]
go/parser: fix scoping for local type declarations

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

14 years agogodoc: remove errant space in HTML tag
Andrew Gerrand [Wed, 30 Mar 2011 05:41:41 +0000 (16:41 +1100)]
godoc: remove errant space in HTML tag

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

14 years agogo/printer/gofmt: remove special case for multi-line raw strings
Robert Griesemer [Wed, 30 Mar 2011 01:30:59 +0000 (18:30 -0700)]
go/printer/gofmt: remove special case for multi-line raw strings

As a special case, multi-line raw strings (i.e., strings in `` quotes)
were not indented if they were the only token on a line. This heuristic
was meant to improve formatting for multi-line raw strings where sub-
sequent lines are not indented at the level of the surrounding code.
Multiple people have complained about this. Removing the heuristic
again because it makes the formatting more regular, easier to under-
stand, and simplifies the implementation.

- manual changes to ebnf/ebnf_test.go for readability
- gofmt -w src misc

Fixes #1643.

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

14 years agotime: make TestAfterQueuing retry 3 times before declaring failure.
Andrew Gerrand [Wed, 30 Mar 2011 00:40:00 +0000 (11:40 +1100)]
time: make TestAfterQueuing retry 3 times before declaring failure.

I'm in two minds as to whether this should be a function of gotest.
Tests that can flake out like this should be rare enough that we
needn't add more mechanism.

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

14 years agotest: add test for interfaces with unexported methods.
Ian Lance Taylor [Tue, 29 Mar 2011 22:04:19 +0000 (15:04 -0700)]
test: add test for interfaces with unexported methods.

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

14 years agotest: adjust bug324 to expect run-time failure, not compile-time.
Ian Lance Taylor [Tue, 29 Mar 2011 22:03:09 +0000 (15:03 -0700)]
test: adjust bug324 to expect run-time failure, not compile-time.

Failing at compile time requires that for each conversion
between two interface types the compiler compare the sets of
unexported methods to see if they come from different
packages.  Since this test will fail approximately never on
real code, and since it can't catch all cases of the problem,
I don't think it's worth testing in the compiler.  This CL
changes this test to look for a run-time panic rather than a
compile-time error.

R=gri, rsc1, iant2, rsc
CC=golang-dev
https://golang.org/cl/4332041

14 years agocrypto/tls: extend NPN support to the client.
Adam Langley [Tue, 29 Mar 2011 21:53:09 +0000 (17:53 -0400)]
crypto/tls: extend NPN support to the client.

R=bradfitzgo, rsc1, bradfitzwork
CC=golang-dev
https://golang.org/cl/4277085

14 years agoprints: fix a couple of formatting errors caught by govet
Rob Pike [Tue, 29 Mar 2011 21:03:08 +0000 (14:03 -0700)]
prints: fix a couple of formatting errors caught by govet

R=rsc, agl, agl1
CC=golang-dev
https://golang.org/cl/4337041

14 years agogotest: replace the shell script with the compiled program written in go.
Rob Pike [Tue, 29 Mar 2011 20:29:20 +0000 (13:29 -0700)]
gotest: replace the shell script with the compiled program written in go.
Update the make sequence: gotest must now be installed after the packages.

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

14 years agogovet: fix bug introduced at 4313054
Rob Pike [Tue, 29 Mar 2011 20:18:52 +0000 (13:18 -0700)]
govet: fix bug introduced at 4313054

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

14 years agogotry: move into its own directory, separate from gotest.
Rob Pike [Tue, 29 Mar 2011 20:00:24 +0000 (13:00 -0700)]
gotry: move into its own directory, separate from gotest.

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

14 years agongotest: correctly handle packages with tests outside the package.
Rob Pike [Tue, 29 Mar 2011 19:50:41 +0000 (12:50 -0700)]
ngotest: correctly handle packages with tests outside the package.

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

14 years agocrypto/cipher: bad CTR IV length now triggers panic
Adam Langley [Tue, 29 Mar 2011 19:47:35 +0000 (15:47 -0400)]
crypto/cipher: bad CTR IV length now triggers panic

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

14 years agosyscall: StartProcess Chroot and Credential.
Albert Strasheim [Tue, 29 Mar 2011 18:29:22 +0000 (14:29 -0400)]
syscall: StartProcess Chroot and Credential.

R=rsc, iant, agl1
CC=golang-dev
https://golang.org/cl/4280065

14 years agonet: move bind back to sock.go
Alexey Borzenkov [Tue, 29 Mar 2011 18:23:42 +0000 (14:23 -0400)]
net: move bind back to sock.go

It was left in netFD.connect() by an oversight (as the name
implies, bind has no business being in connect). As a result
of this change and by only calling netFD.connect() when ra
isn't nil it becomes simpler with less code duplication.

Additionally, if netFD.connect() fails, set sysfd to -1 to
avoid finalizers (e.g. on windows) calling shutdown on a
closed and possibly reopened socket that just happened to
share the same descriptor.

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

14 years agoos: fix FileInfo.Name returned by Stat
David Forsythe [Tue, 29 Mar 2011 18:23:36 +0000 (14:23 -0400)]
os: fix FileInfo.Name returned by Stat

Fixes #1645.

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

14 years agoA+C: David Forsythe (individual CLA)
Russ Cox [Tue, 29 Mar 2011 18:18:45 +0000 (14:18 -0400)]
A+C: David Forsythe (individual CLA)

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4333041

14 years agodebug/gosym: remove need for gotest to run preparatory commands.
Rob Pike [Tue, 29 Mar 2011 17:41:23 +0000 (10:41 -0700)]
debug/gosym: remove need for gotest to run preparatory commands.
Put them into the Makefile instead. One dependency mechanism is enough.

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

14 years agongotest: a new gotest command, written in Go.
Rob Pike [Tue, 29 Mar 2011 17:11:33 +0000 (10:11 -0700)]
ngotest: a new gotest command, written in Go.
It runs all tests correctly and saves significant time by avoiding the shell script.
However, this is just the code for the command, for review.
A separate CL will move this into the real gotest, which will take some dancing.

R=rsc, peterGo, bsiegert, albert.strasheim, rog, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4281073

14 years agoCL 4291070: incorporating rsc's feedback
Robert Griesemer [Tue, 29 Mar 2011 16:08:23 +0000 (09:08 -0700)]
CL 4291070: incorporating rsc's feedback

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

14 years agocrypto/x509: Parse Extended Key Usage extension
Mikkel Krautz [Tue, 29 Mar 2011 14:35:34 +0000 (10:35 -0400)]
crypto/x509: Parse Extended Key Usage extension

This changeset makes it possible for crypto/x509 to parse
certificates that include the 'Extended Key Usage' extension
with the critical bit set.

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

14 years agoasn1: extensions needed for parsing Kerberos
Adam Langley [Tue, 29 Mar 2011 14:33:47 +0000 (10:33 -0400)]
asn1: extensions needed for parsing Kerberos

* Adds support for GENERAL STRING
* Adds support for APPLICATION tagged values.
* Add UnmarshalWithParams to set parameters for the top-level
  structure

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

14 years agotest: adjust bugs/bug322 to match current spec.
Ian Lance Taylor [Tue, 29 Mar 2011 13:49:21 +0000 (06:49 -0700)]
test: adjust bugs/bug322 to match current spec.

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

14 years agotest: avoid undefined error in syntax/if.go.
Ian Lance Taylor [Tue, 29 Mar 2011 13:48:20 +0000 (06:48 -0700)]
test: avoid undefined error in syntax/if.go.

Without this the gccgo version of errchk reports an unmatched
error.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4327041

14 years agotest: match gccgo error messages for syntax/chan.go.
Ian Lance Taylor [Tue, 29 Mar 2011 13:47:39 +0000 (06:47 -0700)]
test: match gccgo error messages for syntax/chan.go.

chan.go:11:1: error: unexpected ‘}’ in channel type
chan.go:13:16: error: unexpected ‘)’ in channel type
chan.go:16:16: error: unexpected comma in channel type

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4313055

14 years agobytes, strings: simplify Join
Evan Shaw [Tue, 29 Mar 2011 05:27:38 +0000 (01:27 -0400)]
bytes, strings: simplify Join

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

14 years agokate: reorganize, remove closed()
Evan Shaw [Tue, 29 Mar 2011 05:12:39 +0000 (01:12 -0400)]
kate: reorganize, remove closed()

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

14 years agonet: implement non-blocking connect
Alexey Borzenkov [Tue, 29 Mar 2011 03:40:01 +0000 (23:40 -0400)]
net: implement non-blocking connect

Refactored bind/connect from sock.go into netFD.connect(), as
a consequence newFD() doesn't accept laddr/raddr anymore, and
expects an (optional) call to netFD.connect() followed by a
call to netFD.setAddr().
Windows code is updated, but still uses blocking connect,
since otherwise it needs support for ConnectEx syscall.

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

14 years agofix build
Russ Cox [Tue, 29 Mar 2011 03:39:39 +0000 (23:39 -0400)]
fix build

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

14 years agogofix: netdial
Russ Cox [Tue, 29 Mar 2011 03:29:00 +0000 (23:29 -0400)]
gofix: netdial

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

14 years agoupdate tree for package net changes
Russ Cox [Tue, 29 Mar 2011 03:28:53 +0000 (23:28 -0400)]
update tree for package net changes

Converted with gofix.

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

14 years agonet: drop laddr from Dial, cname from LookupHost; new functions
Russ Cox [Tue, 29 Mar 2011 03:28:42 +0000 (23:28 -0400)]
net: drop laddr from Dial, cname from LookupHost; new functions

Drop laddr argument from Dial.

Drop cname return from LookupHost.

Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal.
Export SplitHostPort, JoinHostPort.
Add AAAA (IPv6) support to host lookups.

Preparations for implementing some of the
lookups using cgo.

ParseCIDR and IP.Equal are logically new in this CL
but accidentally snuck into an earlier CL about unused
labels that was in the same client.

In crypto/tls, drop laddr from Dial to match net.

R=golang-dev, dsymonds, adg, rh
CC=golang-dev
https://golang.org/cl/4244055

14 years agotag release.2011-03-28
Andrew Gerrand [Tue, 29 Mar 2011 03:19:21 +0000 (14:19 +1100)]
tag release.2011-03-28

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

14 years agoweekly.2011-03-28 weekly.2011-03-28
Andrew Gerrand [Tue, 29 Mar 2011 03:17:04 +0000 (14:17 +1100)]
weekly.2011-03-28

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

14 years agogo/printer, gofmt: rely on existing line breaks when formatting expression lists
Robert Griesemer [Tue, 29 Mar 2011 01:48:52 +0000 (18:48 -0700)]
go/printer, gofmt: rely on existing line breaks when formatting expression lists

No impact on existing sources.

Fixes #1632.

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

14 years agogo/scanner: return literal as string instead of []byte
Robert Griesemer [Mon, 28 Mar 2011 23:44:28 +0000 (16:44 -0700)]
go/scanner: return literal as string instead of []byte

Removed many string conversions in dependent code.
Runs all tests. No change to gofmt output.

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

14 years agogodoc: fix spelling error
Robert Griesemer [Mon, 28 Mar 2011 22:55:48 +0000 (15:55 -0700)]
godoc: fix spelling error

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

14 years agodoc: gccgo now supports method expressions and multiple init functions.
Ian Lance Taylor [Mon, 28 Mar 2011 21:48:35 +0000 (14:48 -0700)]
doc: gccgo now supports method expressions and multiple init functions.

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

14 years agogo/token: use array instead of map for token->string table
Robert Griesemer [Mon, 28 Mar 2011 20:38:24 +0000 (13:38 -0700)]
go/token: use array instead of map for token->string table

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

14 years agonet: let OS-specific AddFD routine wake up polling thread.
Ian Lance Taylor [Mon, 28 Mar 2011 19:39:09 +0000 (12:39 -0700)]
net: let OS-specific AddFD routine wake up polling thread.

With gccgo some operating systems require using select rather
than epoll or kevent.  Using select means that we have to wake
up the polling thread each time we add a new file descriptor.
This implements that in the generic code rather than adding
another wakeup channel, even though nothing in the current net
package uses the capability.

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

14 years agogo/ast: implemented NewPackage
Robert Griesemer [Mon, 28 Mar 2011 17:46:26 +0000 (10:46 -0700)]
go/ast: implemented NewPackage

NewPackage creates an ast.Package node from
a set of package files and resolves unresolved
identifiers.

Also:
- Changed semantics of Scope.Insert: If an
  object is inserted w/o errors, the result
  is nil (before it was obj).
- Fixed an identifier resolution bug in the
  parser: map keys must not be resolved.

gotype runs through several go/* packages
and successfully resolves all (non-field/method)
identifiers.

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

14 years agostrings: Map: avoid allocation when string is unchanged
Brad Fitzpatrick [Mon, 28 Mar 2011 16:41:57 +0000 (09:41 -0700)]
strings: Map: avoid allocation when string is unchanged

This speeds up strings.ToLower, etc.

before/after:
strings_test.BenchmarkMapNoChanges 1000000 1013 ns/op
strings_test.BenchmarkMapNoChanges 5000000  442 ns/op

R=r, rog, eh, rsc
CC=golang-dev
https://golang.org/cl/4306056

14 years agoruntime: fix gdb support for goroutines.
Luuk van Dijk [Mon, 28 Mar 2011 15:34:22 +0000 (17:34 +0200)]
runtime: fix gdb support for goroutines.

in gdb, 'info goroutines' and 'goroutine <n> <cmd> were crashing
because the 'g' and 'm' structures had changed a bit.

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

14 years agobuild: add all-qemu.bash, handful of arm fixes
Russ Cox [Mon, 28 Mar 2011 03:39:42 +0000 (23:39 -0400)]
build: add all-qemu.bash, handful of arm fixes

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

14 years agotest: match gccgo error messages for bug323.go.
Ian Lance Taylor [Mon, 28 Mar 2011 03:38:28 +0000 (20:38 -0700)]
test: match gccgo error messages for bug323.go.

bug323.go:18:3: error: reference to undefined field or method ‘Meth’
bug323.go:19:3: error: reference to undefined field or method ‘Meth2’

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4280072

14 years agohttp: avoid crash when asked for multiple file ranges
Russ Cox [Mon, 28 Mar 2011 03:35:31 +0000 (23:35 -0400)]
http: avoid crash when asked for multiple file ranges

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

14 years agoruntime: fix darwin/amd64 thread VM footprint
Alexey Borzenkov [Sun, 27 Mar 2011 21:15:48 +0000 (17:15 -0400)]
runtime: fix darwin/amd64 thread VM footprint

On darwin amd64 it was impossible to create more that ~132 threads. While
investigating I noticed that go consumes almost 1TB of virtual memory per
OS thread and the reason for such a small limit of OS thread was because
process was running out of virtual memory. While looking at bsdthread_create
I noticed that on amd64 it wasn't using PTHREAD_START_CUSTOM.
If you look at http://fxr.watson.org/fxr/source/bsd/kern/pthread_synch.c?v=xnu-1228
you will see that in that case darwin will use stack pointer as stack size,
allocating huge amounts of memory for stack. This change fixes the issue
and allows for creation of up to 2560 OS threads (which appears to be some
Mac OS X limit) with relatively small virtual memory consumption.

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

14 years agoA+C: Alexey Borzenkov (individual CLA)
Russ Cox [Sun, 27 Mar 2011 21:03:43 +0000 (17:03 -0400)]
A+C: Alexey Borzenkov (individual CLA)

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

14 years agotest: match gccgo error messages for bug325.go.
Ian Lance Taylor [Sun, 27 Mar 2011 19:10:50 +0000 (12:10 -0700)]
test: match gccgo error messages for bug325.go.

bug325.go:13:10: error: invalid indirect of ‘unsafe.Pointer’
bug325.go:14:31: error: reference to field ‘foo’ in object which has no fields or methods

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

14 years agotesting: shorten some more tests
Rob Pike [Sat, 26 Mar 2011 18:25:22 +0000 (11:25 -0700)]
testing: shorten some more tests

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

14 years agotest: match gccgo error messages for init.go
Ian Lance Taylor [Sat, 26 Mar 2011 18:24:02 +0000 (11:24 -0700)]
test: match gccgo error messages for init.go

init.go:16:10: error: invalid reference to unexported identifier ‘runtime.init’
init.go:15:2: error: reference to undefined name ‘init’
init.go:17:10: error: reference to undefined name ‘init’

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4289074

14 years agogob: trivial cleanup
Robert Hencke [Sat, 26 Mar 2011 03:45:21 +0000 (20:45 -0700)]
gob: trivial cleanup

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

14 years agogc: remove interim ... error which rejects valid code.
Ian Lance Taylor [Sat, 26 Mar 2011 01:31:55 +0000 (18:31 -0700)]
gc: remove interim ... error which rejects valid code.

It's been six months.

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

14 years agodashboard: remove old python/bash builder, update README
Andrew Gerrand [Sat, 26 Mar 2011 00:56:34 +0000 (11:56 +1100)]
dashboard: remove old python/bash builder, update README

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

14 years agotest: match gccgo error messages for cmp6.go
Ian Lance Taylor [Sat, 26 Mar 2011 00:51:02 +0000 (17:51 -0700)]
test: match gccgo error messages for cmp6.go

cmp6.go:28:9: error: incompatible types in binary expression
cmp6.go:29:9: error: incompatible types in binary expression
cmp6.go:40:9: error: incompatible types in binary expression
cmp6.go:41:9: error: incompatible types in binary expression
cmp6.go:48:9: error: expected integer, floating, complex, string, pointer, boolean, interface, slice, map, channel, or function type

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

14 years agotesting: shorten some tests.
Rob Pike [Fri, 25 Mar 2011 23:31:10 +0000 (16:31 -0700)]
testing: shorten some tests.
These are the top runners.  More to come.
Also print two digits of timing info under -test.v.

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

14 years agotest: match gccgo error messages for bug081.go.
Ian Lance Taylor [Fri, 25 Mar 2011 22:28:53 +0000 (15:28 -0700)]
test: match gccgo error messages for bug081.go.

bug081.go:9:9: error: expected type

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

14 years agobuild: handle broken awk in version.bash
Dave Cheney [Fri, 25 Mar 2011 22:00:19 +0000 (18:00 -0400)]
build: handle broken awk in version.bash

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

14 years agotesting: set up structure for faster testing using the new -test.short flag.
Rob Pike [Fri, 25 Mar 2011 21:50:44 +0000 (14:50 -0700)]
testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

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

14 years agotest: match gccgo error messages for bug016.go.
Ian Lance Taylor [Fri, 25 Mar 2011 20:31:30 +0000 (13:31 -0700)]
test: match gccgo error messages for bug016.go.

bug016.go:11:8: error: negative shift count

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

14 years agonet: fix Windows build
Peter Mundy [Fri, 25 Mar 2011 20:11:19 +0000 (16:11 -0400)]
net: fix Windows build

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

14 years agosyscall: GetsockoptInt for darwin, freebsd.
Albert Strasheim [Fri, 25 Mar 2011 18:43:59 +0000 (14:43 -0400)]
syscall: GetsockoptInt for darwin, freebsd.

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

14 years agonet: add FileConn, FilePacketConn, FileListener
Albert Strasheim [Fri, 25 Mar 2011 18:42:25 +0000 (14:42 -0400)]
net: add FileConn, FilePacketConn, FileListener

R=iant, rsc, brainman
CC=golang-dev
https://golang.org/cl/4306042

14 years agotest/run: clear $E in case it's already set in environment.
Rob Pike [Fri, 25 Mar 2011 18:33:07 +0000 (11:33 -0700)]
test/run: clear $E in case it's already set in environment.

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

14 years agotest: match gccgo error messages for bug274.go.
Ian Lance Taylor [Fri, 25 Mar 2011 18:32:32 +0000 (11:32 -0700)]
test: match gccgo error messages for bug274.go.

bug274.go:23:3: error: missing statement after label
bug274.go:25:3: error: missing statement after label
bug274.go:28:3: error: label ‘L2’ defined and not used

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

14 years agoflag: fix error in documentation example.
Rob Pike [Fri, 25 Mar 2011 18:28:31 +0000 (11:28 -0700)]
flag: fix error in documentation example.
Fixes #1615.
This time for sure.

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

14 years agoruntime/pprof: disable test on darwin
Russ Cox [Fri, 25 Mar 2011 17:47:07 +0000 (13:47 -0400)]
runtime/pprof: disable test on darwin

Fixes #1641.

Actually it side steps the real issue, which is that the
setitimer(2) implementation on OS X is not useful for
profiling of multi-threaded programs.  I filed the below
using the Apple Bug Reporter.

/*
Filed as Apple Bug Report #9177434.

This program creates a new pthread that loops, wasting cpu time.
In the main pthread, it sleeps on a condition that will never come true.
Before doing so it sets up an interval timer using ITIMER_PROF.
The handler prints a message saying which thread it is running on.

POSIX does not specify which thread should receive the signal, but
in order to be useful in a user-mode self-profiler like pprof or gprof
   http://code.google.com/p/google-perftools
   http://www.delorie.com/gnu/docs/binutils/gprof_25.html
it is important that the thread that receives the signal is the one
whose execution caused the timer to expire.

Linux and FreeBSD handle this by sending the signal to the process's
queue but delivering it to the current thread if possible:

   http://lxr.linux.no/linux+v2.6.38/kernel/signal.c#L802
     807        /*
     808         * Now find a thread we can wake up to take the signal off the queue.
     809         *
     810         * If the main thread wants the signal, it gets first crack.
     811         * Probably the least surprising to the average bear.
     812         * /

   http://fxr.watson.org/fxr/source/kern/kern_sig.c?v=FREEBSD8;im=bigexcerpts#L1907
     1914         /*
     1915          * Check if current thread can handle the signal without
     1916          * switching context to another thread.
     1917          * /

On those operating systems, this program prints:

    $ ./a.out
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    signal on cpu-chewing looper thread
    $

The OS X kernel does not have any such preference.  Its get_signalthread
does not prefer current_thread(), in contrast to the other two systems,
so the signal gets delivered to the first thread in the list that is able to
handle it, which ends up being the main thread in this experiment.
http://fxr.watson.org/fxr/source/bsd/kern/kern_sig.c?v=xnu-1456.1.26;im=excerpts#L1666

    $ ./a.out
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    signal on sleeping main thread
    $

The fix is to make get_signalthread use the same heuristic as
Linux and FreeBSD, namely to use current_thread() if possible
before scanning the process thread list.

*/

#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*);

static pthread_t pmain, ploop;

int
main(void)
{
        struct itimerval it;
        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(SIGPROF, &sa, 0);

        pmain = pthread_self();
        pthread_create(&ploop, 0, looper, 0);

        memset(&it, 0, sizeof it);
        it.it_interval.tv_usec = 10000;
        it.it_value = it.it_interval;
        setitimer(ITIMER_PROF, &it, 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)
{
        static int nsig;
        pthread_t p;

        p = pthread_self();
        if(p == pmain)
                printf("signal on sleeping main thread\n");
        else if(p == ploop)
                printf("signal on cpu-chewing looper thread\n");
        else
                printf("signal on %p\n", (void*)p);
        if(++nsig >= 10)
                exit(0);
}

static void*
looper(void *v)
{
        for(;;);
}

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

14 years agotest: match gccgo error messages for label.go and label1.go.
Ian Lance Taylor [Fri, 25 Mar 2011 17:36:46 +0000 (10:36 -0700)]
test: match gccgo error messages for label.go and label1.go.

label.go:30:1: error: label ‘L6’ already defined
label.go:28:1: note: previous definition of ‘L6’ was here
label.go:23:1: error: label ‘L4’ defined and not used
label.go:52:2: error: label ‘defalt’ defined and not used
label.go:17:1: error: label ‘L2’ defined and not used
label.go:26:1: error: label ‘L5’ defined and not used
label.go:20:1: error: label ‘L3’ defined and not used
label.go:14:1: error: label ‘L1’ defined and not used

label1.go:32:13: error: invalid continue label ‘L2’
label1.go:44:13: error: invalid continue label ‘L3’
label1.go:52:10: error: invalid break label ‘L4’
label1.go:55:13: error: invalid continue label ‘L4’
label1.go:65:9: error: invalid break label ‘L5’
label1.go:68:12: error: invalid continue label ‘L5’
label1.go:76:10: error: invalid break label ‘L1’
label1.go:79:13: error: invalid continue label ‘L1’

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

14 years agoruntime: always set *received in chanrecv.
Ian Lance Taylor [Fri, 25 Mar 2011 17:36:22 +0000 (10:36 -0700)]
runtime: always set *received in chanrecv.

Also fix comment.

The only caller of chanrecv initializes the value to false, so
this patch makes no difference at present.  But it seems like
the right thing to do.

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

14 years agoruntime/darwin: remove unused local variables.
Ian Lance Taylor [Fri, 25 Mar 2011 17:35:46 +0000 (10:35 -0700)]
runtime/darwin: remove unused local variables.

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

14 years agohttp/pprof: cpu profiling support
Russ Cox [Fri, 25 Mar 2011 16:50:12 +0000 (12:50 -0400)]
http/pprof: cpu profiling support

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

14 years agohttp: modified perl cgi test to remove newline from env variables
Roger Pau Monné [Fri, 25 Mar 2011 16:33:45 +0000 (09:33 -0700)]
http: modified perl cgi test to remove newline from env variables

Fixes #1639

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4291069

14 years agoruntime: fix arm build
Russ Cox [Fri, 25 Mar 2011 16:30:49 +0000 (12:30 -0400)]
runtime: fix arm build

R=adg, dfc, r
CC=golang-dev
https://golang.org/cl/4296042

14 years agoA+C: Roger Pau Monné (individual CLA)
Russ Cox [Fri, 25 Mar 2011 16:30:09 +0000 (12:30 -0400)]
A+C: Roger Pau Monné (individual CLA)

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