Russ Cox [Tue, 14 Feb 2012 16:17:48 +0000 (11:17 -0500)]
time: use "2006-01-02 15:04:05.999999999 -0700 MST" as String format
This change shows all the information present
in the Time value (now including fractional seconds)
and also arranges the fields so that, within a single time zone,
string comparison and time comparison agree.
R=golang-dev, rogpeppe, r
CC=golang-dev
https://golang.org/cl/5654078
Russ Cox [Tue, 14 Feb 2012 06:23:15 +0000 (01:23 -0500)]
runtime: on 386, fix FP control word on all threads, not just initial thread
It is possible that Linux and Windows copy the FP control word
from the parent thread when creating a new thread. Empirically,
Darwin does not. Reset the FP control world in all cases.
Rob Pike [Tue, 14 Feb 2012 03:53:30 +0000 (14:53 +1100)]
testing: let runtime catch the panic.
It's not as pretty, but it deletes some irrelevant information from the
printout and avoids a dependency.
It also means the test binary will stop if a test panics. That's a feature,
not a bug.
Any output printed by the test appears before the panic traceback.
before:
--- FAIL: TestPanic (0.00 seconds)
fmt_test.go:19: HI
testing.go:257: runtime error: index out of range
/Users/r/go/src/pkg/testing/testing.go:257 (0x23998)
_func_003: t.Logf("%s\n%s", err, debug.Stack())
/Users/r/go/src/pkg/runtime/proc.c:1388 (0x10d2d)
panic: reflect·call(d->fn, d->args, d->siz);
/Users/r/go/src/pkg/runtime/runtime.c:128 (0x119b0)
panicstring: runtime·panic(err);
/Users/r/go/src/pkg/runtime/runtime.c:85 (0x11857)
panicindex: runtime·panicstring("index out of range");
/Users/r/go/src/pkg/fmt/fmt_test.go:21 (0x23d72)
TestPanic: a[10]=1
/Users/r/go/src/pkg/testing/testing.go:264 (0x21b75)
tRunner: test.F(t)
/Users/r/go/src/pkg/runtime/proc.c:258 (0xee9e)
goexit: runtime·goexit(void)
FAIL
after:
--- FAIL: TestPanic (0.00 seconds)
fmt_test.go:19: HI
panic: runtime error: index out of range [recovered]
panic: (*testing.T) (0xec3b0,0xf8400001c0)
Russ Cox [Tue, 14 Feb 2012 03:31:51 +0000 (22:31 -0500)]
cmd/dist: cross-compiling fixes
This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.
As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target. pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.
Fixes #2920.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645093
Russ Cox [Tue, 14 Feb 2012 03:23:04 +0000 (22:23 -0500)]
net/http: disable buggy test
Generates an infinite stream (at least >1GB) of:
=== RUN TestTransportPersistConnLeak
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
Shenghou Ma [Tue, 14 Feb 2012 01:16:57 +0000 (20:16 -0500)]
fix build for Linux/ARM.
1, IMO, the fatal error "regfree: not a register" from 5g when
compiling runtime/debug.go is due to gcc miscompile, it doesn't
show up when compiled with -O0. But I still haven't thought of
a way to fix this, should all ARM builds be built with -O0?
2, fixed mksysnum_linux.pl, so zsysnum_linux_arm.go no longer
needs to be hand-generated.
3, regen all in pkg syscall for Linux/ARM on Debian 6.0
This CL is somewhat big, I'd like to split it if necessary.
R=rsc, dave
CC=golang-dev
https://golang.org/cl/5659044
Andrew Gerrand [Mon, 13 Feb 2012 23:47:48 +0000 (10:47 +1100)]
archive/zip: hide Write method from *Writer type
This was an implementation detail that snuck into the public interface.
*Writer.Create gives you an io.Writer, the *Writer itself was never
meant to be written to.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5654076
Russ Cox [Mon, 13 Feb 2012 21:02:13 +0000 (16:02 -0500)]
cmd/cgo: omit //line in -godefs, -cdefs output
Makes files like src/pkg/syscall/ztypes_linux_amd64.go easier to read.
(The copy that is checked in predates the //line output mode,
so this also preserves the status quo.)
Ian Lance Taylor [Mon, 13 Feb 2012 19:25:56 +0000 (11:25 -0800)]
spec: clarify implementation restrictions on untyped floats
Drop reference to "machine type." Specify that integer
overflow must be an error. Drop requirement that exponent
must be 128 bits--that's a lot. Clarify that floating point
expressions may be rounded, including intermediate values.
This is a reworking of https://golang.org/cl/5577068/ .
Russ Cox [Mon, 13 Feb 2012 18:52:37 +0000 (13:52 -0500)]
os/signal: selective signal handling
Restore package os/signal, with new API:
Notify replaces Incoming, allowing clients
to ask for certain signals only. Also, signals
go to everyone who asks, not just one client.
This could plausibly move into package os now
that there are no magic side effects as a result
of the import.
Update runtime for new API: move common Unix
signal handling code into signal_unix.c.
(It's so easy to do this now that we don't have
to edit Makefiles!)
Adam Langley [Mon, 13 Feb 2012 17:38:45 +0000 (12:38 -0500)]
crypto/...: more fixes for bug 2841
1) Remove the Reset() member in crypto/aes and crypto/des (and
document the change).
2) Turn several empty error structures into vars. Any remaining error
structures are either non-empty, or will probably become so in the
future.
3) Implement SetWriteDeadline for TLS sockets. At the moment, the TLS
status cannot be reused after a Write error, which is probably fine
for most uses.
4) Make crypto/aes and crypto/des return a cipher.Block.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5625045
Marcel van Lohuizen [Mon, 13 Feb 2012 13:54:46 +0000 (14:54 +0100)]
exp/norm: merged charinfo and decomposition tables. As a result only
one trie lookup per rune is needed. See forminfo.go for a description
of the new format. Also included leading and trailing canonical
combining class in decomposition information. This will often avoid
additional trie lookups.
R=r, r
CC=golang-dev
https://golang.org/cl/5616071
Ian Lance Taylor [Mon, 13 Feb 2012 05:53:33 +0000 (21:53 -0800)]
sync/atomic: disable hammer pointer tests on wrong size system
hammerCompareAndSwapPointer64 was only passing on
little-endian systems. hammerCompareAndSwapPointer32 was
writing 8 bytes to a uint32 value on the heap.
Russ Cox [Mon, 13 Feb 2012 04:55:33 +0000 (23:55 -0500)]
cmd/fix: warn about exp, old, deleted packages
Fixes #2776.
There was a previous attempt at CL 5592043 but that
seems to have stalled. This one is simpler, and more up to date
(correct handling of spdy, for example).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645091
Russ Cox [Mon, 13 Feb 2012 04:19:24 +0000 (23:19 -0500)]
cmd/go: respect test -timeout flag
I thought that -timeout was per-test, but it is for the
whole program execution, so cmd/go can adjust its timer
(also for whole program execution) accordingly.
Fixes #2993.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650070
Rob Pike [Mon, 13 Feb 2012 03:38:31 +0000 (14:38 +1100)]
spec: typographical adjustment for ellipsis
The paragraph describing the ellipses presents the horizontal ellipsis
in two different fonts and at least on my screen they look too different.
Switch to a consistent rendering.