1
0
mirror of https://github.com/golang/go synced 2024-11-14 20:50:30 -07:00
Commit Graph

30806 Commits

Author SHA1 Message Date
David Crawshaw
7ee7936523 cmd/link: handle R_GOTPCREL separately on darwin
To generate the correct section offset the shared code path for
R_CALL, R_PCREL, and R_GOTPCREL on darwin when externally linking
walks up the symbol heirarchy adding the differences. This is fine,
except in the case where we are generating a GOT lookup, because
the topmost symbol is left in r.Xsym instead of the symbol we are
looking up. So all funcsym GOT lookups were looking up the outer
"go.func.*" symbol.

Fix this by separating out the R_GOTPCREL code path.

For #17828 (and may fix it).

Change-Id: I2c9f4d135e77c17270aa064d8c876dc6d485d659
Reviewed-on: https://go-review.googlesource.com/33211
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 18:37:03 +00:00
Ian Lance Taylor
b75b9e1d65 database/sql: clarify when statement in transaction is closed
Fixes #16346.

Change-Id: Ie75a4ae7011036dd2c1f121a7a5e38d10177721e
Reviewed-on: https://go-review.googlesource.com/33296
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 16:04:18 +00:00
Daniel Martí
26069e1981 cmd/compile: remove some unused code
The use of these has been removed in recent commits.

Change-Id: Iff36a3ee4dcdfe39c40e93e2601f44d3c59f7024
Reviewed-on: https://go-review.googlesource.com/33274
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 16:00:35 +00:00
Mikio Hara
d338f2e147 net: don't run TestTCPBig unconditionally
The test requires tons of memory and results various failures, mainly
runtime errors and process termination by SIGKILL, caused by resource
exhaustion when the node under test doesn't have much resources.

This change makes use of -tcpbig flag to enable the test.

Change-Id: Id53fa5d88543e2e60ca9bb4f55a1914ccca844e1
Reviewed-on: https://go-review.googlesource.com/33254
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 05:51:18 +00:00
Bryan C. Mills
1f605175b0 runtime/cgo: use libc for sigaction syscalls when possible
This ensures that runtime's signal handlers pass through the TSAN and
MSAN libc interceptors and subsequent calls to the intercepted
sigaction function from C will correctly see them.

Fixes #17753.

Change-Id: I9798bb50291a4b8fa20caa39c02a4465ec40bb8d
Reviewed-on: https://go-review.googlesource.com/33142
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 05:38:38 +00:00
Mikio Hara
c69233be84 net/http: fix a typo in test
Change-Id: I897237667ffe9e9b2a5f92251a6f665d29479fd2
Reviewed-on: https://go-review.googlesource.com/33255
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 05:35:16 +00:00
Ian Lance Taylor
b906df653b os/exec: add closeOnce.WriteString method
Add an explicit WriteString method to closeOnce that acquires the
writers lock.  This overrides the one promoted from the
embedded *os.File field.  The promoted one naturally does not acquire
the lock, and can therefore race with the Close method.

Fixes #17647.

Change-Id: I3460f2a0d503449481cfb2fd4628b4855ab0ecdf
Reviewed-on: https://go-review.googlesource.com/33298
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 02:24:30 +00:00
Brad Fitzpatrick
1b66b38e25 api, doc: update go1.8.txt and next.txt
Both automated updates with a few tweaks.

Change-Id: I24579a8dcc32a84a4fff5c2212681ef30dda61d1
Reviewed-on: https://go-review.googlesource.com/33297
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 01:19:56 +00:00
Vladimir Stefanovic
272032d0b2 runtime: add support files for linux/mips{,le} port
Only exe buildmode without cgo supported.

Change-Id: Id104a79a99d3285c04db00fd98b8affa94ea3c37
Reviewed-on: https://go-review.googlesource.com/31487
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-11-15 21:49:01 +00:00
Ian Lance Taylor
4d1fdd8b5e test: add test case that failed when built with gccgo
Change-Id: Ie7512cc27436cde53b58686b32a0389849a365e4
Reviewed-on: https://go-review.googlesource.com/33249
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 21:25:44 +00:00
David du Colombier
816aa99b9a syscall: define bind flags on Plan 9
These bind flags were removed by mistake in CL 2167.

Fixes #17921.

Change-Id: I1e8089dade30a212b8db0b216c8299946d924d4b
Reviewed-on: https://go-review.googlesource.com/33271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 18:19:10 +00:00
Ian Lance Taylor
59dc9d7a89 cmd/cgo: add missing period in comment
Change-Id: I05f31938f3736100bd8b20a150c9fe3a6ffcdeae
Reviewed-on: https://go-review.googlesource.com/33245
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 17:42:30 +00:00
Ian Lance Taylor
27b68474ca cmd/cgo: run cgo pointer checks for pointer to union
If a C union type (or a C++ class type) can contain a pointer field,
then run the cgo checks on pointers to that type. This will test the
pointer as though it were an unsafe.Pointer, and will crash if it points
to Go memory that contains a pointer.

Fixes #15942.

Change-Id: Ic2d07ed9648d4b27078ae7683e26196bcbc59fc9
Reviewed-on: https://go-review.googlesource.com/33237
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 17:10:52 +00:00
David Crawshaw
fab3fcaf75 cmd/go: use build ID as plugin symbol prefix
Updates #17821

Change-Id: Iebd2e88b2d4f3d757ffad72456f4bfc0607d8110
Reviewed-on: https://go-review.googlesource.com/33162
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 16:17:07 +00:00
David Crawshaw
03da2690c9 cmd/link, runtime, plugin: versioning
In plugins and every program that opens a plugin, include a hash of
every imported package.

There are two versions of each hash: one local and one exported.
As the program starts and plugins are loaded, the first exported
symbol for each package becomes the canonical version.

Any subsequent plugin's local package hash symbol has to match the
canonical version.

Fixes #17832

Change-Id: I4e62c8e1729d322e14b1673bada40fa7a74ea8bc
Reviewed-on: https://go-review.googlesource.com/33161
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 16:14:27 +00:00
Ian Lance Taylor
a145890059 all: don't call t.Fatal from a goroutine
Fixes #17900.

Change-Id: I42cda6ac9cf48ed739d3a015a90b3cb15edf8ddf
Reviewed-on: https://go-review.googlesource.com/33243
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 15:13:48 +00:00
Brad Fitzpatrick
9be14c4058 net: add test that TCP Close unblocks blocked Reads
I guess this was fixed at some point. Remove a skipped test in
net/http and add an explicit test in net.

Fixes #17695

Change-Id: Idb9f3e236b726bb45098474b830c95c1fce57529
Reviewed-on: https://go-review.googlesource.com/33242
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 14:22:31 +00:00
Ian Lance Taylor
b687d6a788 misc/cgo/testcarchive, misc/cgo/testcshared: sleep instead of sched_yield
Apparently when GOMAXPROCS == 1 a simple sched_yield in a tight loop is
not necessarily sufficient to permit a signal handler to run. Instead,
sleep for 1/1000 of a second.

Fixes #16649.

Change-Id: I83910144228556e742b7a92a441732ef61aa49d9
Reviewed-on: https://go-review.googlesource.com/33239
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 05:35:54 +00:00
Caleb Spare
1e91731251 html/template: fix multiple Clones of redefined template
This change redoes the fix for #16101 (CL 31092) in a different way by
making t.Clone return the template associated with the t.Name() while
allowing for the case that a template of the same name is define-d.

Fixes #17735.

Change-Id: I1e69672390a4c81aa611046a209008ae4a3bb723
Reviewed-on: https://go-review.googlesource.com/33210
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-11-15 04:30:20 +00:00
Mikio Hara
91461002f3 os: gofmt -w -s
Change-Id: I9a42cb55544185ade20b2a4a9de5d39a6cfc6fc6
Reviewed-on: https://go-review.googlesource.com/33172
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 03:55:56 +00:00
Brad Fitzpatrick
90d536f3ca net/http: update bundled http2 for write scheduling order fix
Updates x/net/http2 to x/net git rev 00ed5e9 for:

    http2: schedule RSTStream writes onto its stream's queue
    https://golang.org/cl/33238

Fixes #17243

Change-Id: I79cc5d15bf69ead28d549d4f798c12f4ee2a2201
Reviewed-on: https://go-review.googlesource.com/33241
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 01:52:44 +00:00
Rob Pike
24a088d20a text/template: efficient reporting of line numbers
Instead of scanning the text to count newlines, which is n², keep track as we go
and store the line number in the token.

benchmark                 old ns/op      new ns/op     delta
BenchmarkParseLarge-4     1589721293     38783310      -97.56%

Fixes #17851

Change-Id: I231225c61e667535e2ce55cd2facea6d279cc59d
Reviewed-on: https://go-review.googlesource.com/33234
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 00:42:33 +00:00
Brad Fitzpatrick
bb00a8d97f net/http: update bundled http2, add TestServerKeepAlivesEnabled h1/h2 tests
Updates x/net/http2 to x/net git rev 6dfeb344 for:

   http2: make Server respect http1 Server's SetKeepAlivesEnabled
   https://golang.org/cl/33153

And adds a test in std.

Fixes #17717

Change-Id: I3ba000abb6f3f682261e105d8a4bb93bde6609fe
Reviewed-on: https://go-review.googlesource.com/33231
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2016-11-14 22:39:50 +00:00
Brad Fitzpatrick
b83350a2e0 Revert "text/template: efficient reporting of line numbers"
This reverts commit 794fb71d9c.

Reason for revert: submitted without TryBots and it broke all three race builders.

Change-Id: I80a1e566616f0ee8fa3529d4eeee04268f8a713b
Reviewed-on: https://go-review.googlesource.com/33232
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 22:23:24 +00:00
Marcel Edmund Franke
2442b49c47 html/template: typo fix
comment on unexported function starts with wrong functionname

Change-Id: Ib16c2fe42b5a8d4606ed719f620923c17839d091
Reviewed-on: https://go-review.googlesource.com/33203
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 21:28:31 +00:00
Rob Pike
794fb71d9c text/template: efficient reporting of line numbers
Instead of scanning the text to count newlines, which is n², keep track as we go
and store the line number in the token.

benchmark                 old ns/op      new ns/op     delta
BenchmarkParseLarge-4     1589721293     38783310      -97.56%

Fixes #17851

Change-Id: Ieaf89a35e371b405ad92e38baa1e3fa98d18cfb4
Reviewed-on: https://go-review.googlesource.com/32923
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-14 18:42:48 +00:00
Josh Bleecher Snyder
2f76c1985f cmd/go/testdata/src: gofmt
These are functionality tests, not formatter tests.

I also tested manually that 'go test cmd/go'
without -short still passes.


Change-Id: Id146e1dc3b65e19ea531869725cd0b97f4801b8b
Reviewed-on: https://go-review.googlesource.com/33169
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 00:24:27 +00:00
Jesse Szwedko
5f74ce394f syscall: Clearenv now unsets env vars on Windows
Previously, `os.Clearenv()` (by way of `syscall.Clearenv`) would simply
set all environment variables' values to `""` rather than actually
unsetting them causing subsequent `os.LookupEnv` calls to return that
they were still set.

Fixes #17902

Change-Id: I54081b4b98665e9a39f55ea7582c8d40bb8a2a22
Reviewed-on: https://go-review.googlesource.com/33168
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2016-11-14 00:04:03 +00:00
David du Colombier
4a381e3ee3 net/http: enable timeout tests on Plan 9
Deadlines have been implemented on Plan 9 in CL 31521.

Enable the following tests:

 - TestServerTimeouts
 - TestOnlyWriteTimeout
 - TestTLSHandshakeTimeout
 - TestIssue4191_InfiniteGetTimeout
 - TestIssue4191_InfiniteGetToPutTimeout

Updates #7237.

Change-Id: If5e75cfaa9133dcf9ce6aac9fc2badafc1612b64
Reviewed-on: https://go-review.googlesource.com/33197
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 21:29:23 +00:00
David du Colombier
8d3d23a124 net/http: fix error message in TestClientWriteShutdown
Change-Id: I3c664201baef6d7dbed94dab63db0ac974bf6817
Reviewed-on: https://go-review.googlesource.com/33198
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 21:28:52 +00:00
Josh Bleecher Snyder
f8dc4f20f8 Revert "cmd/vet: ignore printf failures in cmd"
This reverts commit f15915af4e.

CL 32851 fixed cmd/vet's handling of fmt.Formatter.

Updates #17057.

Change-Id: I3409100d16037645946fe7fe78fbb173e1648494
Reviewed-on: https://go-review.googlesource.com/33166
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 21:28:13 +00:00
Josh Bleecher Snyder
7c9f910607 all: fix vet nits
Fixes these vet complaints:

net/error_test.go:254: unrecognized printf flag for verb 'T': '#'
os/os_test.go:1067: arg mt for printf verb %d of wrong type: time.Time
runtime/debug/garbage_test.go:83: arg dt for printf verb %d of wrong type: time.Time

Change-Id: I0e986712a4b083b75fb111e687e424d06a85a47b
Reviewed-on: https://go-review.googlesource.com/33167
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 21:27:49 +00:00
Thordur Bjornsson
afa68b36cc encoding/hex: Document DecodedLen.
Mention that it specifically returns x / 2, and do the same for
EncodedLen.

Change-Id: Ie334f5abecbc487caf4965abbcd14442591bef2a
Change-Id: Idfa413faad487e534489428451bf736b009293d6
Reviewed-on: https://go-review.googlesource.com/33191
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 17:53:22 +00:00
David du Colombier
582a421a8c net: enable timeout tests on Plan 9
Deadlines have been implemented on Plan 9 in CL 31521.

Enable the following tests:

 - TestReadTimeout
 - TestReadFromTimeout
 - TestWriteTimeout
 - TestWriteToTimeout
 - TestReadTimeoutFluctuation
 - TestVariousDeadlines
 - TestVariousDeadlines1Proc
 - TestVariousDeadlines4Proc
 - TestReadWriteDeadlineRace

Change-Id: I221ed61d55f7f1e4345b37af6748c04e1e91e062
Reviewed-on: https://go-review.googlesource.com/33196
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-13 17:46:27 +00:00
Dhananjay Nakrani
662d253515 cmd/vet: ignore unrecognized verbs for fmt.Formatter
Updates #17057.

Change-Id: I54c838d3a44007d4023754e42971e91bfb5e8612
Reviewed-on: https://go-review.googlesource.com/32851
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-11-13 15:03:26 +00:00
Martin Möhrmann
524cd4855e time: simplify stringification of Month
Simplifies https://golang.org/cl/33145
which fixed #17720.

Change-Id: Ib922d493cdc5920832dc95b55094796baca7243e
Reviewed-on: https://go-review.googlesource.com/33194
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-12 21:24:06 +00:00
David du Colombier
4bee9012b3 net/http/httptest: remove workaround on Plan 9
This issue has been fixed in CL 31390.

Change-Id: I0c2425fd33be878037d10d612a50116a7b693431
Reviewed-on: https://go-review.googlesource.com/33195
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-12 21:23:04 +00:00
Joe Tsai
091ba60bd8 compress/flate: add examples
Updates #16360

Change-Id: I66ff23e0501363f58fe891d5e95806422071f93b
Reviewed-on: https://go-review.googlesource.com/30162
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-12 18:42:35 +00:00
Patrick Lee
2f497263e4 cmd/pprof: add options to skip tls verification
Don't verify tls host when profiling https+insecure://host/port/...,
as per discussion in https://go-review.googlesource.com/#/c/20885/.

Fixes: #11468

Change-Id: Ibfc236e5442a00339334602a4014e017c62d9e7a
Reviewed-on: https://go-review.googlesource.com/33157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-12 18:30:15 +00:00
David du Colombier
4966150af0 net: enable TestReadTimeoutUnblocksRead on Plan 9
Deadlines have been implemented on Plan 9 in CL 31521.

Fixes #17477.

Change-Id: Icb742ac30933b6d2f9350fc4e6acbcd433c66c21
Reviewed-on: https://go-review.googlesource.com/33190
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-12 17:24:21 +00:00
Brad Fitzpatrick
37020dd510 runtime/internal/atomic: add TestUnaligned64
Add a variant of sync/atomic's TestUnaligned64 to
runtime/internal/atomic.

Skips the test on arm for now where it's currently failing.

Updates #17786

Change-Id: If63f9c1243e9db7b243a95205b2d27f7d1dc1e6e
Reviewed-on: https://go-review.googlesource.com/33159
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-12 06:38:40 +00:00
Brad Fitzpatrick
c921d8f39d context: document appropriate WithValue key type more
Fixes #17826
Updates #17302

Change-Id: I7c1ebd965e679e7169a97e62d27ae3ede2473aa1
Reviewed-on: https://go-review.googlesource.com/33152
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-12 06:25:11 +00:00
David du Colombier
adb384ad2c net: implement asynchonous cancelable I/O on Plan 9
This change is an experimental implementation of asynchronous
cancelable I/O operations on Plan 9, which are required to
implement deadlines.

There are no asynchronous syscalls on Plan 9. I/O operations
are performed with blocking pread and pwrite syscalls.

Implementing deadlines in Go requires a way to interrupt
I/O operations.

It is possible to interrupt reads and writes on a TCP connection
by forcing the closure of the TCP connection. This approach
has been used successfully in CL 31390.

However, we can't implement deadlines with this method, since
we require to be able to reuse the connection after the timeout.

On Plan 9, I/O operations are interrupted when the process
receives a note. We can rely on this behavior to implement
a more generic approach.

When doing an I/O operation (read or write), we start the I/O in
its own process, then wait for the result asynchronously. The
process is able to handle the "hangup" note. When receiving the
"hangup" note, the currently running I/O operation is canceled
and the process returns.

This way, deadlines can be implemented by sending an "hangup"
note to the process running the blocking I/O operation, after
the expiration of a timer.

Fixes #11932.
Fixes #17498.

Change-Id: I414f72c7a9a4f9b8f9c09ed3b6c269f899d9b430
Reviewed-on: https://go-review.googlesource.com/31521
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-12 05:44:36 +00:00
Ian Lance Taylor
456f2f5cb8 time: use 1e9 rather than 1e-9 in Duration calculations
1e-9 has a 1 in the last place, causing some Duration calculations to
have unnecessary rounding errors.  1e9 does not, so use that instead.

Change-Id: I96334a2c47e7a014b532eb4b8a3ef9550e7ed057
Reviewed-on: https://go-review.googlesource.com/33116
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-12 01:18:26 +00:00
Vladimir Stefanovic
5b147122d6 cmd/dist: add support for GOARCH=mips{,le}
Change-Id: I6e24d22eada190e9aa2adc161be7a753c8e5054b
Reviewed-on: https://go-review.googlesource.com/31514
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-11-12 00:34:21 +00:00
Daniel Martí
241dccc4fd cmd/internal/browser: add chromium to the list of browsers
Many linux distros distribute Chromium instead of Chrome.

Change-Id: I5474d94da28a7c79bdd7181f77472d4ce73bb225
Reviewed-on: https://go-review.googlesource.com/29293
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-12 00:29:12 +00:00
Dmitri Shuralyov
d8264de868 all: spell "marshal" and "unmarshal" consistently
The tree is inconsistent about single l vs double l in those
words in documentation, test messages, and one error value text.

	$ git grep -E '[Mm]arshall(|s|er|ers|ed|ing)' | wc -l
	      42
	$ git grep -E '[Mm]arshal(|s|er|ers|ed|ing)' | wc -l
	    1694

Make it consistently a single l, per earlier decisions. This means
contributors won't be confused by misleading precedence, and it helps
consistency.

Change the spelling in one error value text in newRawAttributes of
crypto/x509 package to be consistent.

This change was generated with:

	perl -i -npe 's,([Mm]arshal)l(|s|er|ers|ed|ing),$1$2,' $(git grep -l -E '[Mm]arshall' | grep -v AUTHORS | grep -v CONTRIBUTORS)

Updates #12431.
Follows https://golang.org/cl/14150.

Change-Id: I85d28a2d7692862ccb02d6a09f5d18538b6049a2
Reviewed-on: https://go-review.googlesource.com/33017
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-12 00:13:35 +00:00
Brad Fitzpatrick
9a78eadeb6 net: deflake TestTCPSupriousConnSetupCompletion [sic]
And rename it.

Fixes #17703

Change-Id: I73c82a9b3f96180699c6d33c069a666018eb30f9
Reviewed-on: https://go-review.googlesource.com/33149
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-11 22:21:33 +00:00
Quentin Smith
02d79e9558 cmd/go: skip TestCgoPkgConfig if pkg-config is too old
pkg-config 0.24 adds support for quoting and escaping whitespace;
distros like CentOS 6 are still shipping pkg-config 0.23. Skip the test
there since there's no way to get whitespace into the pkg-config output.

Fixes #17846.

Change-Id: Ie4ea17e9b709372a20178b539498929754bcd51f
Reviewed-on: https://go-review.googlesource.com/33027
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-11-11 22:16:47 +00:00
Brad Fitzpatrick
a18b4b3fb9 time: don't panic stringifying the zero Month
Fixes #17720

Change-Id: Ib95c230deef3934db729856c17908f8e5a1e2b7f
Reviewed-on: https://go-review.googlesource.com/33145
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-11-11 21:31:52 +00:00