1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:31:21 -06:00
Commit Graph

18644 Commits

Author SHA1 Message Date
Brad Fitzpatrick
fd4b4b56c4 net/http: add Transport.TLSHandshakeTimeout; set it by default
Update #3362

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/68150045
2014-02-25 08:08:15 -08:00
Adam Langley
abe53f8766 doc/go1.3: note a couple more crypto changes.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68600043
2014-02-25 10:54:09 -05:00
Russ Cox
280d46b03b cmd/go: document new -exec flag on run/test
The new flag was added by CL 68150047 (part of the NaCl replay),
but the change, like the original, omitted documentation of the
new behavior.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/68580043
2014-02-25 10:22:27 -05:00
Dave Cheney
7c8280c9ef all: merge NaCl branch (part 1)
See golang.org/s/go13nacl for design overview.

This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come.

CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately.

The exact change lists included are

15050047: syscall: support for Native Client
15360044: syscall: unzip implementation for Native Client
15370044: syscall: Native Client SRPC implementation
15400047: cmd/dist, cmd/go, go/build, test: support for Native Client
15410048: runtime: support for Native Client
15410049: syscall: file descriptor table for Native Client
15410050: syscall: in-memory file system for Native Client
15440048: all: update +build lines for Native Client port
15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client
15570045: os: support for Native Client
15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32
15690044: net: support for Native Client
15690048: runtime: support for fake time like on Go Playground
15690051: build: disable various tests on Native Client

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68150047
2014-02-25 09:47:42 -05:00
Mikio Hara
7206f50f71 runtime: use monotonic clock for timers on linux/arm
Update #6007

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://golang.org/cl/67730048
2014-02-25 23:03:01 +09:00
Mikio Hara
b05f3de56f syscall: add mmap test
This CL adds a test that calls Mmap and Munmap through Syscall9
as the canary that detects assembly fragment breakage. For now
there is no package test that uses Syscall9 in the standard
library across all Unix-like systems.

Note that the package runtime owns its assembly fragments, so
this canary never works for runtime breakage.

LGTM=iant, bradfitz
R=iant, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/61520049
2014-02-25 23:02:19 +09:00
Dmitriy Vyukov
ec0c9f270e sync: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68050043
2014-02-25 14:39:12 +04:00
Aram Hăvărneanu
1c9861918b syscall: add support for GOOS=solaris
These are only the new files, autogenerated files are in a
different CL to keep the size down.

LGTM=dave, minux.ma, jsing
R=golang-codereviews, dave, jsing, gobot, minux.ma, rsc, iant, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/36000043
2014-02-25 21:12:10 +11:00
Aram Hăvărneanu
e5b5f9b39d syscall: generate zfiles for GOOS=solaris
LGTM=minux.ma, mikioh.mikioh
R=golang-codereviews, minux.ma, gobot, jsing, mikioh.mikioh, dave
CC=golang-codereviews
https://golang.org/cl/36010043
2014-02-25 17:12:19 +09:00
Aram Hăvărneanu
50df136483 runtime, net: add support for GOOS=solaris
LGTM=dave, rsc
R=golang-codereviews, minux.ma, mikioh.mikioh, dave, iant, rsc
CC=golang-codereviews
https://golang.org/cl/36030043
2014-02-24 22:31:01 -05:00
Robert Griesemer
c738591e7e go/printer: fix alignment of comments in labeled statements
Does not change src, misc formatting.

Fixes #5623.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/68400043
2014-02-24 19:18:16 -08:00
Brad Fitzpatrick
49beb23ba7 net/http: use TCP Keep-Alives on DefaultTransport's connections
Update #3362

Also set a 30 second timeout, instead of relying on the
operating system's timeout, which if often but not always 3
minutes.

LGTM=crawshaw
R=rsc, crawshaw
CC=golang-codereviews
https://golang.org/cl/68330046
2014-02-24 15:20:45 -08:00
Adam Langley
c7612f3426 crypto/tls: report TLS version in ConnectionState.
Fixes #7231.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68250043
2014-02-24 18:01:28 -05:00
Adam Langley
db99a8faa8 crypto/tls: pick ECDHE curves based on server preference.
Currently an ECDHE handshake uses the client's curve preference. This
generally means that we use P-521. However, P-521's strength is
mismatched with the rest of the cipher suite in most cases and we have
a fast, constant-time implementation of P-256.

With this change, Go servers will use P-256 where the client supports
it although that can be overridden in the Config.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/66060043
2014-02-24 17:57:51 -05:00
Russ Cox
e6e8945001 build: comment possible ulimit failure in run.bash
Record what's going on in case someone is debugging a failure there.
It's not Go's fault.

Fixes #7381.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68200043
2014-02-24 16:44:35 -05:00
Brad Fitzpatrick
fdfbb406d1 net: add Dialer.KeepAlive option
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68380043
2014-02-24 13:14:48 -08:00
Shenghou Ma
e2fe968d5f cmd/ld: fix build for ARMv5.
Credit goes to Dave Cheney for debugging the issue.

LGTM=dave, rsc
R=dave, rsc
CC=golang-codereviews
https://golang.org/cl/67820043
2014-02-25 06:53:17 +11:00
Rémy Oudompheng
14b0af4272 cmd/gc: fix walkcompare bugs.
Revision c0e0467635ec (cmd/gc: return canonical Node* from temp)
exposed original nodes of temporaries, allowing callers to mutate
their types.

In walkcompare a temporary could be typed as ideal because of
this. Additionnally, assignment of a comparison result to
a custom boolean type was broken.

Fixes #7366.

LGTM=rsc
R=rsc, iant, khr
CC=golang-codereviews
https://golang.org/cl/66930044
2014-02-24 19:51:59 +01:00
Lucio De Re
ff15e5c00f cmd/go: Plan 9 compatible "env" output
Fixes the output of go env so that variables can be set
more accurately when using Plan 9's rc shell. Specifically,
GOPATH may have multiple components and the current
representation is plain wrong. In practice, we probably
ought to change os. Getenv to produce the right result, but
that requires considerably more thought.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/66600043
2014-02-24 19:48:06 +01:00
Rob Pike
c687be423c crypto/md5,sha1: add examples for Sum
LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/66900044
2014-02-24 10:40:55 -08:00
Dmitriy Vyukov
cd13a57b0a testing: fix bogus benchmark
Fatal must not be called from secondary goroutines.
Fixes #7401.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/67820047
2014-02-24 21:12:44 +04:00
Dmitriy Vyukov
5b6aaba1ce testing: improve diagnosis of a potential misuse of RunParallel
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68230045
2014-02-24 21:08:37 +04:00
Dmitriy Vyukov
ea87501750 runtime: fix heap memory corruption
With concurrent sweeping finc if modified by runfinq and queuefinalizer concurrently.
Fixes crashes like this one:
http://build.golang.org/log/6ad7b59ef2e93e3c9347eabfb4c4bd66df58fd5a
Fixes #7324.
Update #7396

LGTM=rsc
R=golang-codereviews, minux.ma, rsc
CC=golang-codereviews, khr
https://golang.org/cl/67980043
2014-02-24 20:53:50 +04:00
Dmitriy Vyukov
6e612ae0f5 runtime: fix potential memory corruption
Reinforce the guarantee that MSpan_EnsureSwept actually ensures that the span is swept.
I have not observed crashes related to this, but I do not see why it can't crash as well.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, khr, rsc
https://golang.org/cl/67990043
2014-02-24 20:53:20 +04:00
Dmitriy Vyukov
69257d17fe runtime: use RunParallel in more benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68020043
2014-02-24 20:50:12 +04:00
Dmitriy Vyukov
bb9531e11b time: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68060043
2014-02-24 20:47:17 +04:00
Dmitriy Vyukov
51b9879a90 math/big: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/67830044
2014-02-24 20:46:56 +04:00
Dmitriy Vyukov
44cc8e5cc9 fmt: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/67910046
2014-02-24 20:46:25 +04:00
Mikio Hara
2ff431189e syscall: regenerate Flock_t to make it compliant with EABI
Note that current z-files for linux/amd64,386,arm are based on 3.2 kernel.

LGTM=iant
R=golang-codereviews, dave, bradfitz, gobot, iant
CC=golang-codereviews
https://golang.org/cl/59160044
2014-02-24 08:36:56 -08:00
Dmitriy Vyukov
1163127def testing: diagnose a potential misuse of RunParallel
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68030043
2014-02-24 20:32:28 +04:00
Dmitriy Vyukov
96d5229818 net/http: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68070043
2014-02-24 20:28:14 +04:00
Dmitriy Vyukov
b5705ed9ab net/rpc: use RunParallel in benchmarks
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68040044
2014-02-24 20:23:35 +04:00
Dmitriy Vyukov
0ef0d6cd7b runtime: fix double symbol definition
runfinqv is already defined the same way on line 271.
There may also be something to fix in compiler/linker wrt diagnostics.
Fixes #7375.

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/67850044
2014-02-24 20:23:03 +04:00
Dave Cheney
dd740343e0 runtime: stack allocate Panic structure during runtime.panic
Update #7347

When runtime.panic is called the *Panic is malloced from the heap. This can lead to a gc cycle while panicing which can make a bad situation worse.

It appears to be possible to stack allocate the Panic and avoid malloc'ing during a panic.

Ref: https://groups.google.com/d/topic/golang-dev/OfxqpklGkh0/discussion

LGTM=minux.ma, dvyukov, rsc
R=r, minux.ma, gobot, rsc, dvyukov
CC=golang-codereviews
https://golang.org/cl/66830043
2014-02-24 11:09:19 -05:00
Jay Weisskopf
86c976ffd0 runtime: use monotonic clock for timers (linux/386, linux/amd64)
This lays the groundwork for making Go robust when the system's
calendar time jumps around. All input values to the runtimeTimer
struct now use the runtime clock as a common reference point.
This affects net.Conn.Set[Read|Write]Deadline(), time.Sleep(),
time.Timer, etc. Under normal conditions, behavior is unchanged.

Each platform and architecture's implementation of runtime·nanotime()
should be modified to use a monotonic system clock when possible.

Platforms/architectures modified and tested with monotonic clock:
  linux/x86     - clock_gettime(CLOCK_MONOTONIC)

Update #6007

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, alex.brainman, stephen.gutekanst, dave, rsc, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/53010043
2014-02-24 10:57:46 -05:00
Patrick Mézard
7403071ada time: explicitely mention Tickers have to be stopped
LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/64770043
2014-02-24 10:18:40 -05:00
Shane Hansen
f12a167ba2 gdb: Add partial python3 + go1.2 support to runtime-gdb.py
Update #6963 Fixes pretty printing maps and updates
functions for interacting with $len(). goroutine $n bt
remains not working. Tested on gdb using python 2 and 3.
Fixes #7052
Update #6963
Fixes #6698

LGTM=rsc
R=golang-codereviews, josharian, rsc
CC=golang-codereviews
https://golang.org/cl/53590043
2014-02-24 10:13:27 -05:00
Patrick Mézard
dd449a1cfa codereview: remove unused upload_options.revision
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/60640052
2014-02-24 10:11:37 -05:00
Robert Daniel Kortschak
b1c5bafda3 net/http: don't pile up defers in b.N loop
One defer was not removed in CL61150043.

LGTM=dvyukov
R=bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/64600044
2014-02-24 18:17:07 +04:00
Dmitriy Vyukov
f6d18c5ee9 runtime/race: fix finalizer tests
After "runtime: combine small NoScan allocations" finalizers
for small objects run more non deterministically.
TestRaceFin episodically fails on my darwin/amd64.

LGTM=khr
R=golang-codereviews, khr, dave
CC=golang-codereviews
https://golang.org/cl/56970043
2014-02-24 18:12:46 +04:00
Mikio Hara
699aa37d03 syscall: add fcntl test
Also updates documentation.

LGTM=minux.ma
R=iant, bradfitz, nightlyone, minux.ma
CC=golang-codereviews
https://golang.org/cl/58660044
2014-02-24 20:35:01 +09:00
Mikio Hara
fe330cf5bb syscall: make mkerrors.sh work with clang
LGTM=iant
R=golang-codereviews, minux.ma, gobot, iant
CC=golang-codereviews
https://golang.org/cl/67170043
2014-02-24 16:34:51 +09:00
Mikio Hara
2dcf8593ac syscall: consolidate test cases for Unix-like systems
As per request from minux in CL 61520049, this CL consolidates
existing test cases for Unix-like systems into one file except
Linux-specific credential test.

LGTM=bradfitz
R=iant, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/67800044
2014-02-24 14:41:10 +09:00
Anfernee Yongkun Gui
4228092b2c net/http: fix comment in connectMethod's key format
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/66990045
2014-02-23 21:18:41 -08:00
Shenghou Ma
bcf3d55ed9 misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD.
Fix build for 10.6 Darwin builders and OpenBSD builers.

LGTM=jsing
R=golang-codereviews, dave, jsing
CC=golang-codereviews
https://golang.org/cl/67710043
2014-02-23 20:37:43 -05:00
Shenghou Ma
e33e47e844 cmd/gc: diagnose "make([]T, non-integer)" correctly.
Fixes #7223.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/63040043
2014-02-23 16:31:48 -05:00
Shenghou Ma
d4a9bbef51 cmd/ld: don't emit unreachable dynimport symbols in ELF symtab.
Fix build for Dragonfly BSD.
Fixes #7318.
Fixes #7367.

LGTM=jsing, iant
R=jsing, iant, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/64340043
2014-02-23 16:20:40 -05:00
Patrick Mézard
d4b6a198b3 os/exec: explicitly mention Cmd.Wait() has to be called eventually
LGTM=minux.ma, r
R=golang-codereviews, minux.ma, r
CC=golang-codereviews
https://golang.org/cl/67280043
2014-02-23 12:53:02 -08:00
Rob Pike
66f8ef868c A+C: Patrick Mézard (individual CLA)
Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/64100047
2014-02-23 12:52:23 -08:00
Rob Pike
f1e4184db6 testing: improve introduction to package comment
Fixes #7361.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/66910045
2014-02-21 14:35:54 -08:00