Dmitriy Vyukov [Fri, 8 Feb 2013 15:24:50 +0000 (19:24 +0400)]
runtime/race: deflake tests
With the new scheduler races in the tests are reported during execution of other tests.
The change joins goroutines started during the tests.
Russ Cox [Fri, 8 Feb 2013 03:45:12 +0000 (22:45 -0500)]
net: do not use RLock around Accept
It might be non-blocking, but it also might be blocking.
Cannot take the chance, as Accept might block indefinitely
and make it impossible to acquire ForkLock exclusively
(during fork+exec).
Ian Lance Taylor [Thu, 7 Feb 2013 01:18:53 +0000 (17:18 -0800)]
net: permit pollster DelFD to return whether to call Wakeup
This is necessary for systems that use select as the pollster,
such as Solaris (supported by gccgo). It corresponds to the
bool returned by AddFD. In general it's not clearly defined
what happens when a descriptor used in a select is closed, and
different systems behave differently. Waking up the select
will cause the right thing to happen: the closed descriptor
will be dropped from the next iteration.
Gaal Yahas [Wed, 6 Feb 2013 16:39:52 +0000 (00:39 +0800)]
sync: improve WaitGroup example by putting the call to Done in a
deferred block. This makes hangs in the waiting code less likely
if a goroutine exits abnormally.
Volker Dobler [Wed, 6 Feb 2013 11:37:34 +0000 (22:37 +1100)]
exp/cookiejar: infrastructure for upcoming implementation
This CL is the first of a handful of CLs which will provide
the implementation of cookiejar. It contains several helper
functions and the skeleton of Cookies and SetCookies.
Proper host name handling requires the ToASCII transformation
from package idna which currently lives in the go.net
subrepo. This CL thus contains just a TODO for this issue.
Dmitriy Vyukov [Wed, 6 Feb 2013 07:40:54 +0000 (11:40 +0400)]
runtime/race: switch to explicit race context instead of goroutine id's
Removes limit on maximum number of goroutines ever existed.
code.google.com/p/goexecutor tests now pass successfully.
Also slightly improves performance.
Before: $ time ./flate.test -test.short
real 0m9.314s
After: $ time ./flate.test -test.short
real 0m8.958s
Fixes #4286.
The runtime is built from llvm rev 174312.
Ian Lance Taylor [Tue, 5 Feb 2013 14:11:10 +0000 (06:11 -0800)]
exp/inotify: close event channel before file descriptor
Closing the inotify file descriptor can take over a second
when running on Ubuntu Precise in an NFS directory, leading to
the test error in issue 3132. Closing the event channel first
lets a client that does not care about the error channel move
on.
Shenghou Ma [Tue, 5 Feb 2013 13:43:04 +0000 (21:43 +0800)]
cmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors
Plan 9 compilers insist this but as we don't have Plan 9
builders, we'd better let gcc check the prototypes.
Russ Cox [Tue, 5 Feb 2013 12:00:38 +0000 (07:00 -0500)]
cmd/gc: add way to specify 'noescape' for extern funcs
A new comment directive //go:noescape instructs the compiler
that the following external (no body) func declaration should be
treated as if none of its arguments escape to the heap.
Dave Cheney [Tue, 5 Feb 2013 09:50:20 +0000 (20:50 +1100)]
misc/dashboard/app: trim old builds from the history
The dashboard is currently failing to store results of new builds for some keys, notable the go.codereview sub repository. This is causing the builders to mark the entire triggering commit as failed. With the help of David Symonds we think it is because the results value has breached the 1mb datastore limit on AppEngine.
Brad Fitzpatrick [Tue, 5 Feb 2013 04:26:25 +0000 (20:26 -0800)]
net/http: fix Server blocking after a Handler's Write fails
If a Handle's Write to a ResponseWriter fails (e.g. via a
net.Conn WriteDeadline via WriteTimeout on the Server), the
Server was blocking forever waiting for reads on that
net.Conn, even after a Write failed.
Instead, once we see a Write fail, close the connection,
since it's then dead to us anyway.
Russ Cox [Tue, 5 Feb 2013 03:48:31 +0000 (22:48 -0500)]
cmd/gc: fix escape analysis
If the analysis reached a node twice, then the analysis was cut off.
However, if the second arrival is at a lower depth (closer to escaping)
then it is important to repeat the traversal.
The repeating must be cut off at some point to avoid the occasional
infinite recursion. This CL cuts it off as soon as possible while still
passing all tests.
Mikio Hara [Mon, 4 Feb 2013 21:53:58 +0000 (06:53 +0900)]
syscall: regenerate ztype files for linux
This CL adds TCPInfo struct to linux/386,arm.
It's already added to linux/amd64.
Note that not sure the reason but cgo godefs w/ latest gcc
translates a flexible array member in structures correctly,
handles it as a non-incomplete, non-opaque type, on Go 1.
This CL reverts such changes by hand for the Go 1 contract.
Russ Cox [Mon, 4 Feb 2013 05:21:44 +0000 (00:21 -0500)]
cmd/gc: fix &^ code generation bug
Was not re-walking the new AND node, so that its ullman
count was wrong, so that the code generator attempted to
store values in registers across the call.
Russ Cox [Mon, 4 Feb 2013 04:47:03 +0000 (23:47 -0500)]
cmd/go, testing: revise docs for test flags
In cmd/go's 'go help testflag':
* Rewrite list of flags to drop test. prefix on every name.
* Sort list of flags.
* Add example of using -bench to match all benchmarks.
In testing:
* Remove mention of undefined 'CPU group' concept.
Russ Cox [Mon, 4 Feb 2013 04:02:12 +0000 (23:02 -0500)]
time: deal a bit better with time zones in Parse
* Document Parse's zone interpretation.
* Add ParseInLocation (API change).
* Recognize "wrong" time zone names, like daylight savings time in winter.
* Disambiguate time zone names using offset (like winter EST vs summer EST in Sydney).
The final two are backwards-incompatible changes, but I believe
they are both buggy behavior in the Go 1.0 versions; the old results
were more wrong than the new ones.
Russ Cox [Sun, 3 Feb 2013 19:51:21 +0000 (14:51 -0500)]
cmd/gc: slightly better code generation
* Avoid treating CALL fn(SB) as justification for introducing
and tracking a registerized variable for fn(SB).
* Remove USED(n) after declaration and zeroing of n.
It was left over from when the compiler emitted more
aggressive set and not used errors, and it was keeping
the optimizer from removing a redundant zeroing of n
when n was a pointer or integer variable.
Elias Naur [Fri, 1 Feb 2013 19:24:49 +0000 (11:24 -0800)]
runtime, cmd/ld: make code more position-independent
Change the stack unwinding code to compensate for the dynamic
relocation of symbols.
Change the gc instruction GC_CALL to use a relative offset instead of
an absolute address.
Elias Naur [Fri, 1 Feb 2013 16:35:33 +0000 (08:35 -0800)]
cmd/6c, cmd/6g: add flag to support large-model code generation
Added the -pic flag to 6c and 6g to avoid assembler instructions that
cannot use RIP-relative adressing. This is needed to support the -shared mode
in 6l.
See also:
https://golang.org/cl/6926049
https://golang.org/cl/6822078