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

16613 Commits

Author SHA1 Message Date
Austin Clements
bbd2127909 cmd/9g: don't use R13
R13 is the C TLS pointer.  Once we're calling to and from C code, if
we clobber R13 in our code, sigtramp won't know whether to get the
current g from REGG or from C TLS.  The simplest solution is for Go
code to preserve the C TLS pointer.  This is equivalent to what other
platforms do, except that on other platforms the TLS pointer is in a
special register.

Change-Id: I076e9cb83fd78843eb68cb07c748c4705c9a4c82
Reviewed-on: https://go-review.googlesource.com/2007
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:36:08 +00:00
Austin Clements
db923390a0 cmd/9l: support internal linking
This implements the ELF relocations and dynamic linking tables
necessary to support internal linking on ppc64.  It also marks ppc64le
ELF files as ABI v2; failing to do this doesn't seem to confuse the
loader, but it does confuse libbfd (and hence gdb, objdump, etc).

Change-Id: I559dddf89b39052e1b6288a4dd5e72693b5355e4
Reviewed-on: https://go-review.googlesource.com/2006
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:35:54 +00:00
Austin Clements
ac5a1ac318 cmd/ld: support for relocation variants
Most ppc64 relocations come in six or more variants where the basic
relocation formula is the same, but which bits of the computed value
are installed where changes.  Introduce the concept of "variants" for
internal relocations to support this.  Since this applies to
architecture-independent relocation types like R_PCREL, we do this in
relocsym.

Currently there is only an identity variant.  A later CL that adds
support for ppc64 ELF relocations will introduce more.

Change-Id: I0c5f0e7dbe5beece79cd24fe36267d37c52f1a0c
Reviewed-on: https://go-review.googlesource.com/2005
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:35:37 +00:00
Austin Clements
fcdffb3f33 cmd/ld: support 2 byte relocations
ppc64 has a bunch of these.

Change-Id: I3b93ed2bae378322a8dec036b1681e520b56ff53
Reviewed-on: https://go-review.googlesource.com/2003
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-07 20:35:13 +00:00
Austin Clements
e32fe2049d cmd/ld: decode local entry offset from ppc64 symbols
ppc64 function symbols have both a global entry point and a local
entry point, where the difference is stashed in sym.other.  We'll need
this information to generate calls to ELF ABI functions.

Change-Id: Ibe343923f56801de7ebec29946c79690a9ffde57
Reviewed-on: https://go-review.googlesource.com/2002
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-07 20:34:55 +00:00
Keith Randall
ec767c10b3 runtime: add comment about channels already handling zero-sized objects correctly.
update #9401

Change-Id: I634a772814e7cd066f631a68342e7c3dc9d27e72
Reviewed-on: https://go-review.googlesource.com/2370
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:25:06 +00:00
Keith Randall
5aae246f1e runtime: increase number of stack orders to 4
Cache 2KB, 4KB, 8KB, and 16KB stacks.  Larger stacks
will be allocated directly.  There is no point in cacheing
32KB+ stacks as we ask for and return 32KB at a time
from the allocator.

Note that the minimum stack is 8K on windows/64bit and 4K on
windows/32bit and plan9.  For these os/arch combinations,
the number of stack orders is less so that we have the same
maximum cached size.

Fixes #9045

Change-Id: Ia4195dd1858fb79fc0e6a91ae29c374d28839e44
Reviewed-on: https://go-review.googlesource.com/2098
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:13:06 +00:00
Keith Randall
1dd0163ce3 runtime: remove trailing empty arrays in structs
The ones at the end of M and G are just used to compute
their size for use in assembly.  Generate the size explicitly.
The one at the end of itab is variable-sized, and at least one.
The ones at the end of interfacetype and uncommontype are not
needed, as the preceding slice references them (the slice was
originally added for use by reflect?).
The one at the end of stackmap is already accessed correctly,
and the runtime never allocates one.

Update #9401

Change-Id: Ia75e3aaee38425f038c506868a17105bd64c712f
Reviewed-on: https://go-review.googlesource.com/2420
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 16:05:16 +00:00
Keith Randall
ce5cb037d1 runtime: use some startup randomness in the fallback hashes
Fold in some startup randomness to make the hash vary across
different runs.  This helps prevent attackers from choosing
keys that all map to the same bucket.

Also, reorganize the hash a bit.  Move the *m1 multiply to after
the xor of the current hash and the message.  For hash quality
it doesn't really matter, but for DDOS resistance it helps a lot
(any processing done to the message before it is merged with the
random seed is useless, as it is easily inverted by an attacker).

Update #9365

Change-Id: Ib19968168e1bbc541d1d28be2701bb83e53f1e24
Reviewed-on: https://go-review.googlesource.com/2344
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-07 16:02:05 +00:00
Matthew Dempsky
31775c5a95 cmd/cgo: update code and docs to reflect post-6c world
The gc toolchain no longer includes a C compiler, so mentions of "6c"
can be removed or replaced by 6g as appropriate.  Similarly, some cgo
functions that previously generated C source output no longer need to.

Change-Id: I1ae6b02630cff9eaadeae6f3176c0c7824e8fbe5
Reviewed-on: https://go-review.googlesource.com/2391
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-07 15:14:07 +00:00
Brad Fitzpatrick
ee2ecc4552 bufio: add Reader.Discard
Reader.Discard is the complement to Peek. It discards the next n bytes
of input.

We already have Reader.Buffered to see how many bytes of data are
sitting available in memory, and Reader.Peek to get that that buffer
directly. But once you're done with the Peek'd data, you can't get rid
of it, other than Reading it.
Both Read and io.CopyN(ioutil.Discard, bufReader, N) are relatively
slow. People instead resort to multiple blind ReadByte calls, just to
advance the internal b.r variable.

I've wanted this previously, several people have asked for it in the
past on golang-nuts/dev, and somebody just asked me for it again in a
private email. There are a few places in the standard library we'd use
it too.

Change-Id: I85dfad47704a58bd42f6867adbc9e4e1792bc3b0
Reviewed-on: https://go-review.googlesource.com/2260
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 06:37:57 +00:00
Shenghou Ma
5f179c7cef runtime: fix build for race detector
This CL only fixes the build, there are two failing tests:
RaceMapBigValAccess1 and RaceMapBigValAccess2
in runtime/race tests. I haven't investigated why yet.

Updates #9516.

Change-Id: If5bd2f0bee1ee45b1977990ab71e2917aada505f
Reviewed-on: https://go-review.googlesource.com/2401
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-07 03:20:42 +00:00
Martin Möhrmann
e5864cd939 sort: optimize symMerge performance for blocks with one element
Use direct binary insertion instead of recursive calls to symMerge
when one of the blocks has only one element.

benchmark                   old ns/op      new ns/op      delta
BenchmarkStableString1K     421999         397629         -5.77%
BenchmarkStableInt1K        123422         120592         -2.29%
BenchmarkStableInt64K       9629094        9620200        -0.09%
BenchmarkStable1e2          123089         120209         -2.34%
BenchmarkStable1e4          39505228       36870029       -6.67%
BenchmarkStable1e6          8196612367     7630840157     -6.90%

Change-Id: I49905a909e8595cfa05920ccf9aa00a8f3036110
Reviewed-on: https://go-review.googlesource.com/2219
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-06 23:30:46 +00:00
Russ Cox
bc2601a1df runtime: allocate wbshadow at high address
sysReserve doesn't actually reserve the full amount requested on
64-bit systems, because of problems with ulimit. Instead it checks
that it can get the first 64 kB and assumes it can grab the rest as
needed. This doesn't work well with the "let the kernel pick an address"
mode, so don't do that. Pick a high address instead.

Change-Id: I4de143a0e6fdeb467fa6ecf63dcd0c1c1618a31c
Reviewed-on: https://go-review.googlesource.com/2345
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 22:28:52 +00:00
Russ Cox
9b638bf1bf runtime: adjust dropm for write barriers
The line 'mp.schedlink = mnext' has an implicit write barrier call,
which needs a valid g. Move it above the setg(nil).

Change-Id: If3e86c948e856e10032ad89f038bf569659300e0
Reviewed-on: https://go-review.googlesource.com/2347
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 22:23:14 +00:00
Brad Fitzpatrick
f5f69bba3b cmd/go: buffer output for go usage
It did tons of write syscalls before:
    https://www.youtube.com/watch?v=t60fhjAqBdw

This is the worst offender. It's not worth fixing all the cases of two
consecutive prints.

Change-Id: I95860ef6a844d89b149528195182b191aad8731b
Reviewed-on: https://go-review.googlesource.com/2371
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 20:31:35 +00:00
Adam Langley
ea64e5785d crypto/tls: fix renegotiation extension.
There are two methods by which TLS clients signal the renegotiation
extension: either a special cipher suite value or a TLS extension.

It appears that I left debugging code in when I landed support for the
extension because there's a "+ 1" in the switch statement that shouldn't
be there.

The effect of this is very small, but it will break Firefox if
security.ssl.require_safe_negotiation is enabled in about:config.
(Although almost nobody does this.)

This change fixes the original bug and adds a test. Sadly the test is a
little complex because there's no OpenSSL s_client option that mirrors
that behaviour of require_safe_negotiation.

Change-Id: Ia6925c7d9bbc0713e7104228a57d2d61d537c07a
Reviewed-on: https://go-review.googlesource.com/1900
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-06 19:50:07 +00:00
Adam Langley
b1370742ee crypto/rsa: rsa.SignPSS with opts=nil shouldn't crash.
SignPSS is documented as allowing opts to be nil, but actually
crashes in that case. This change fixes that.

Change-Id: Ic48ff5f698c010a336e2bf720e0f44be1aecafa0
Reviewed-on: https://go-review.googlesource.com/2330
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-06 19:18:28 +00:00
Russ Cox
02f89331c2 runtime: fix two garbage collector bugs
First, call clearcheckmarks immediately after changing checkmark,
so that there is less time when the checkmark flag and the bitmap
are inconsistent. The tiny gap between the two lines is fine, because
the world is stopped. Before, the gap was much larger and included
such code as "go bgsweep()", which allocated.

Second, modify gcphase only when the world is stopped.
As written, gcscan_m was changing gcphase from 0 to GCscan
and back to 0 while other goroutines were running.
Another goroutine running at the same time might decide to
sleep, see GCscan, call gcphasework, and start "helping" by
scanning its stack. That's fine, except that if gcphase flips back
to 0 as the goroutine calls scanblock, it will start draining the
work buffers prematurely.

Both of these were found wbshadow=2 (and a lot of hard work).
Eventually that will run automatically, but right now it still
doesn't quite work for all.bash, due to mmap conflicts with
pthread-created threads.

Change-Id: I99aa8210cff9c6e7d0a1b62c75be32a23321897b
Reviewed-on: https://go-review.googlesource.com/2340
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 15:10:13 +00:00
Russ Cox
ff979626fc cmd/gc: add write barrier for append(slice, slice...)
Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: I5624b509a36650bce6834cf394b9da163abbf8c0
Reviewed-on: https://go-review.googlesource.com/2310
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 14:41:45 +00:00
Alex Brainman
03d6637dbb runtime: do not display Windows Error Reporting dialogue
Fixes #9121

Change-Id: Id6ca9f259260310c4c6cbdabbc8f2fead8414e6a
Reviewed-on: https://go-review.googlesource.com/2202
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-06 05:31:40 +00:00
Shenghou Ma
a6a30fefd9 runtime: fix build for ARM
Change-Id: Ia18b8411bebc47ea71ac1acd9ff9dc570ec15dea
Reviewed-on: https://go-review.googlesource.com/2341
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-01-06 01:29:42 +00:00
Russ Cox
df027aceb9 reflect: add write barriers
Use typedmemmove, typedslicecopy, and adjust reflect.call
to execute the necessary write barriers.

Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: Iec5b5b0c1be5589295e28e5228e37f1a92e07742
Reviewed-on: https://go-review.googlesource.com/2312
Reviewed-by: Keith Randall <khr@golang.org>
2015-01-06 00:28:31 +00:00
Russ Cox
813386f200 sync/atomic: remove atomic pointer hammer tests
These depend on storing arbitrary integer values using
pointer atomics, and we can't support that anymore.

Change-Id: I8cadd6d462c3eebdbe7078f43fe7c779fa8f52b3
Reviewed-on: https://go-review.googlesource.com/2311
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 00:28:22 +00:00
Russ Cox
ccdb50931f cmd/gc, runtime: make assertI2T and variants not variadic
A side effect of this change is that when assertI2T writes to the
memory for the T being extracted, it can use typedmemmove
for write barriers.

There are other ways we could have done this, but this one
finishes a TODO in package runtime.

Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: Icbc8aabfd8a9b1f00be2e421af0e3b29fa54d01e
Reviewed-on: https://go-review.googlesource.com/2279
Reviewed-by: Keith Randall <khr@golang.org>
2015-01-06 00:28:03 +00:00
Russ Cox
e5ef657264 cmd/gc: add write barrier in copy of function parameters to heap
Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: I1320d5340a9e421c779f24f3b170e33974e56e4f
Reviewed-on: https://go-review.googlesource.com/2278
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 00:27:49 +00:00
Russ Cox
54bb4dc390 runtime: use typed memmove (write barriers) for chan, map, interface content
Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: Iea83d693480c2f3008b4e80d55821acff65970a6
Reviewed-on: https://go-review.googlesource.com/2277
Reviewed-by: Keith Randall <khr@golang.org>
2015-01-06 00:27:29 +00:00
Russ Cox
bcadab9349 cmd/gc, runtime: rename writebarrierfat to typedmemmove
Preparation for replacing many memmove calls in runtime
with typedmemmove, which is a clearer description of what
the routine is doing.

For the same reason, rename writebarriercopy to typedslicecopy.

Change-Id: I6f23bef2c2215509fefba175b16908f76dc7538c
Reviewed-on: https://go-review.googlesource.com/2276
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-01-06 00:27:20 +00:00
Russ Cox
7b4df8f018 runtime, sync/atomic: add write barrier for atomic write of pointer
Add write barrier to atomic operations manipulating pointers.

In general an atomic write of a pointer word may indicate racy accesses,
so there is no strictly safe way to attempt to keep the shadow copy
in sync with the real one. Instead, mark the shadow copy as not used.

Redirect sync/atomic pointer routines back to the runtime ones,
so that there is only one copy of the write barrier and shadow logic.
In time we might consider doing this for most of the sync/atomic
functions, but for now only the pointer routines need that treatment.

Found with GODEBUG=wbshadow=1 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: I852936b9a111a6cb9079cfaf6bd78b43016c0242
Reviewed-on: https://go-review.googlesource.com/2066
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2015-01-06 00:27:06 +00:00
Russ Cox
eafc482d4f runtime: change Gobuf.g to uintptr, not pointer
The Gobuf.g goroutine pointer is almost always updated by assembly code.
In one of the few places it is updated by Go code - func save - it must be
treated as a uintptr to avoid a write barrier being emitted at a bad time.
Instead of figuring out how to emit the write barriers missing in the
assembly manipulation, change the type of the field to uintptr, so that
it does not require write barriers at all.

Goroutine structs are published in the allg list and never freed.
That will keep the goroutine structs from being collected.
There is never a time that Gobuf.g's contain the only references
to a goroutine: the publishing of the goroutine in allg comes first.

Goroutine pointers are also kept in non-GC-visible places like TLS,
so I can't see them ever moving. If we did want to start moving data
in the GC, we'd need to allocate the goroutine structs from an
alternate arena. This CL doesn't make that problem any worse.

Found with GODEBUG=wbshadow=1 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: I85f91312ec3e0ef69ead0fff1a560b0cfb095e1a
Reviewed-on: https://go-review.googlesource.com/2065
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2015-01-06 00:26:54 +00:00
Russ Cox
a73c1cef07 runtime: add missing write barriers in append's copy of slice data
Found with GODEBUG=wbshadow=1 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.

Change-Id: Ic8624401d7c8225a935f719f96f2675c6f5c0d7c
Reviewed-on: https://go-review.googlesource.com/2064
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2015-01-06 00:26:45 +00:00
Russ Cox
dcec123a49 runtime: add GODEBUG wbshadow for finding missing write barriers
This is the detection code. It works well enough that I know of
a handful of missing write barriers. However, those are subtle
enough that I'll address them in separate followup CLs.

GODEBUG=wbshadow=1 checks for a write that bypassed the
write barrier at the next write barrier of the same word.
If a bug can be detected in this mode it is typically easy to
understand, since the crash says quite clearly what kind of
word has missed a write barrier.

GODEBUG=wbshadow=2 adds a check of the write barrier
shadow copy during garbage collection. Bugs detected at
garbage collection can be difficult to understand, because
there is no context for what the found word means.
Typically you have to reproduce the problem with allocfreetrace=1
in order to understand the type of the badly updated word.

Change-Id: If863837308e7c50d96b5bdc7d65af4969bf53a6e
Reviewed-on: https://go-review.googlesource.com/2061
Reviewed-by: Austin Clements <austin@google.com>
2015-01-06 00:26:35 +00:00
Josh Bleecher Snyder
3191a23515 go/doc: propagate types from unexported constants
When constants were declared using unexported constants,
the type information was lost when those constants were filtered out.
This CL propagates the type information of unexported constants
so that it is available for display.

This is a follow-up to CL 144110044, which fixed this problem
specifically for _ constants.

Updates #5397.

Change-Id: I3f0c767a4007d88169a5634ab2870deea4e6a740
Reviewed-on: https://go-review.googlesource.com/2091
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-06 00:24:13 +00:00
Shenghou Ma
43178697db math/big: panic if n <= 0 for ProbablyPrime
Fixes #9509

Change-Id: I3b86745d38e09093fe2f4b918d774bd6608727d7
Reviewed-on: https://go-review.googlesource.com/2313
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-05 23:11:35 +00:00
Brad Fitzpatrick
b70ddc0b51 runtime: only check whether the runtime is stale once during tests
Noticed while investigating the speed of the runtime tests, as part
of debugging while Plan 9's runtime tests are timing out on GCE.

Change-Id: I95f5a3d967a0b45ec1ebf10067e193f51db84e26
Reviewed-on: https://go-review.googlesource.com/2283
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-05 21:33:27 +00:00
Fazlul Shahriar
e6f76aac32 math: be consistent in how we document special cases
Change-Id: Ic6bc4af7bcc89b2881b2b9e7290aeb6fd54804e2
Reviewed-on: https://go-review.googlesource.com/2239
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-05 21:01:46 +00:00
Russ Cox
e6d3511264 Revert "liblink, cmd/ld, runtime: remove stackguard1"
This reverts commit ab0535ae3f.

I think it will remain useful to distinguish code that must
run on a system stack from code that can run on either stack,
even if that distinction is no
longer based on the implementation language.

That is, I expect to add a //go:systemstack comment that,
in terms of the old implementation, tells the compiler,
to pretend this function was written in C.

Change-Id: I33d2ebb2f99ae12496484c6ec8ed07233d693275
Reviewed-on: https://go-review.googlesource.com/2275
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-05 16:29:56 +00:00
Shenghou Ma
a1c9e10371 reflect: document that Values can't be compared directly
Fixes #9504.

Change-Id: I148f407ace3d1b4db3f19fbb8561d1ee6c4c13b3
Reviewed-on: https://go-review.googlesource.com/2273
Reviewed-by: Rob Pike <r@golang.org>
2015-01-05 09:11:44 +00:00
Mikio Hara
a1053ed610 crypto/x509: add missing copyright
Change-Id: Ida3b431a06527f6cd604ab4af5ce517959c8619b
Reviewed-on: https://go-review.googlesource.com/2306
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-01-05 07:32:02 +00:00
Mikio Hara
35132a6be8 crypto/x509: fix nacl build
Change-Id: Ie47c6460c1749aef3cf6d7c6ba44d43305d7ca7b
Reviewed-on: https://go-review.googlesource.com/2305
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-05 06:31:49 +00:00
Dave Cheney
682922908f crypto/x509: split certFiles definition by GOOS
This CL splits the (ever growing) list of ca cert locations by major unix
platforms (darwin, windows and plan9 are already handled seperately).
Although it is clear the unix variants cannot manage to agree on some standard
locations, we can avoid to some extent an artificial ranking of priority
amongst the supported GOOSs.

* Split certFiles definition by GOOS
* Include NetBSD ca cert location

Fixes #9285

Change-Id: I6df2a3fddf3866e71033e01fce43c31e51b48a9e
Reviewed-on: https://go-review.googlesource.com/2208
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 05:41:27 +00:00
Nigel Tao
0b52392ef7 image: use three-index slice for NewYCbCr.
This ensures that changing an image.YCbCr's Y values can't change its
chroma values, even after re-slicing up to capacity.

Change-Id: Icb626561522e336a3220e10f456c95330ae7db9e
Reviewed-on: https://go-review.googlesource.com/2209
Reviewed-by: Rob Pike <r@golang.org>
2015-01-05 03:32:15 +00:00
Andrew Gerrand
43ce5c0306 log: update doc comment
Fixes #9448.

Change-Id: I8e1d676688d9e9b2fa3519ebc530905f574a1b3e
Reviewed-on: https://go-review.googlesource.com/2088
Reviewed-by: Rob Pike <r@golang.org>
2015-01-05 01:21:52 +00:00
Shenghou Ma
9a5789d499 fmt: fix two typos
Change-Id: I7b65cf3b67bef8950115066d6d12b25cd0a5edfc
Reviewed-on: https://go-review.googlesource.com/2272
Reviewed-by: Rob Pike <r@golang.org>
2015-01-04 23:07:43 +00:00
Michael Hudson-Doyle
19f2bd8c2e cmd/go: be more careful when linking a test exe with gccgo
Previously, we ended up passing two compiled objects for the package
being tested when linking the test executable.  Somewhat by luck, this
worked most of the time but occasionally it did not.  This changes the
linking code to not pass two objects for the same ImportPath and to
always pass the object for the test version of the package and removes
some unecessary nil checks.

Change-Id: I7bbd3fc708f14672ee2cc6aed3397421fceb8a38
Reviewed-on: https://go-review.googlesource.com/1840
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-04 21:01:15 +00:00
Shenghou Ma
281ae92881 liblink: fix encoding of SETcc for amd64
liblink used to encode both SETEQ BP and SETEQ CH as 0f 94 c5,
however, SETEQ BP should have used a REX prefix.

Fixes #8545.

Change-Id: Ie59c990cdd0ec506cffe4318e9ad1b48db5e57dd
Reviewed-on: https://go-review.googlesource.com/2270
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-01-04 20:38:12 +00:00
Michael Fraenkel
48d63035ce reflect: set dir when creating a channel via ChanOf
Fixes #9135

Change-Id: I4d0e4eb52a3d64262f107eb7eae4096a6e47ac08
Reviewed-on: https://go-review.googlesource.com/2238
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-04 19:42:14 +00:00
Ian Lance Taylor
1ebfb082a7 runtime: remove unnecessary GOOS switch
Change-Id: I8f518e273c02110042b08f7c50c3d38a648c8b6e
Reviewed-on: https://go-review.googlesource.com/2281
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-04 19:41:05 +00:00
Mikio Hara
2958860ee8 net: add test cases for parsing ipv4-mapped ipv6 address
This CL adds missing ipv4-mapped ipv6 address test cases to TestParseIP.

Change-Id: I3144d2a88d409bd515cf52f8711d407bfa81ed68
Reviewed-on: https://go-review.googlesource.com/2205
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-04 10:28:00 +00:00
Matthew Dempsky
537ddc9456 runtime: fix slicecopy return value for zero-width elements
Fixes #8620

Change-Id: Idb49e586919d21d07e94a39ed9ebb0562f403460
Reviewed-on: https://go-review.googlesource.com/2221
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-04 01:59:59 +00:00
Shenghou Ma
865e5e98b6 runtime: fix TestCgoExternalThreadSIGPROF again
Shell out to `uname -r` this time, so that the test will compile
even if the platform doesn't have syscall.Sysctl.

Change-Id: I3a19ab5d820bdb94586a97f4507b3837d7040525
Reviewed-on: https://go-review.googlesource.com/2271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-03 05:49:22 +00:00
Shenghou Ma
2cbe27a272 runtime: skip TestCgoExternalThreadSIGPROF on OS X 10.6
The test program requires static constructor, which in turn needs
external linking to work, but external linking never works on 10.6.

This should fix the darwin-{386,amd64} builders.

Change-Id: I714fdd3e35f9a7e5f5659cf26367feec9412444f
Reviewed-on: https://go-review.googlesource.com/2235
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-03 03:18:46 +00:00
Josh Bleecher Snyder
17577e48c9 runtime: use SETEQ instead of JZ for cas
Change-Id: Ibabbca3988d39bdce584924173a912d45f50f0dd
Reviewed-on: https://go-review.googlesource.com/2243
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-02 19:06:36 +00:00
Josh Bleecher Snyder
8bbd80063b cmd/go: put user ldflags at the end of the linker invocation
If the user provided a key but no value via -ldflag -X,
another linker flag was used as the value.

Placing the user's flags at the end avoids this problem.
It also provides the user the opportunity to
override existing linker flags.

Fixes #8810.

Change-Id: I96f4190713dc9a9c29142e56658446fba7fb6bc8
Reviewed-on: https://go-review.googlesource.com/2242
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-02 18:36:44 +00:00
Martin Möhrmann
79c4fad8c2 os: replace itod on posix with general itoa and fix possible infinite recursion
Remove use of itod on posix systems and replace with call to itoa.
Build and use same itoa function on all systems.
Fix infinite recursion in iota function for the case -1<<63.

Change-Id: I89d7e742383c5c4aeef8780501c78a3e1af87a6f
Reviewed-on: https://go-review.googlesource.com/2213
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-02 16:21:18 +00:00
Alberto Donizetti
307e2706cb cmd/gc: update issue tracker link
Updated the issue tracker link the compiler prints out
when asking for a bug report after an internal error.

Change-Id: I092b118130f131c6344d9d058bea4ad6379032b8
Reviewed-on: https://go-review.googlesource.com/2218
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-02 15:45:17 +00:00
Shenghou Ma
cb1897a58c cmd/gc: give an error if only one argument is given to complex()
Fixes #8501

Change-Id: I0dbbdded7f7924351c3d1841d60cb5c934b295b7
Reviewed-on: https://go-review.googlesource.com/2143
Reviewed-by: Chris Manghane <cmang@golang.org>
2015-01-02 02:52:56 +00:00
David Crawshaw
8fa0cf1db2 runtime: remove unused export_test declarations
Change-Id: Iac28c4bbe949af5628cef8ecafdd59ab5d71e6cc
Reviewed-on: https://go-review.googlesource.com/2240
Reviewed-by: Keith Randall <khr@golang.org>
2015-01-01 18:44:36 +00:00
Mikio Hara
a877e81caa net: don't return io.EOF on reading data from datagram, raw sockets on windows
Preventing returning io.EOF on non-connection oriented sockets is
already applied to Unix variants. This CL applies it to Windows.

Update #4856.

Change-Id: I82071d40f617e2962d0540b9d1d6a10ea4cdb2ec
Reviewed-on: https://go-review.googlesource.com/2203
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-01-01 05:21:32 +00:00
Mikio Hara
a456801615 net: remove redundant test case for lookupIP with threadLimit
There is no reason to have the redundant test case TestDNSThreadLimt
because TestLookupIPDeadline does cover what we need to test with
-dnsflood flag and more.

Also this CL moves TestLookupIPDeadline into lookup_test.go to avoid
abusing to control the order of test case execution by using file name.

Change-Id: Ib417d7d3411c59d9352c03c996704d584368dc62
Reviewed-on: https://go-review.googlesource.com/2204
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-01 05:20:16 +00:00
Shenghou Ma
1f28238557 runtime: provide a dummy value of _SIGPROF on plan9 and windows
Fixes build on plan9 and windows.

Change-Id: Ic9b02c641ab84e4f6d8149de71b9eb495e3343b2
Reviewed-on: https://go-review.googlesource.com/2233
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-01-01 04:41:43 +00:00
Shenghou Ma
0b2a74e89c runtime/cgo: remove unused variable
I missed this one in golang.org/cl/2232 and only tested the patch
on openbsd/amd64.

Change-Id: I4ff437ae0bfc61c989896c01904b6d33f9bdf0ec
Reviewed-on: https://go-review.googlesource.com/2234
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-01 03:14:56 +00:00
Shenghou Ma
77cd6197d7 runtime/cgo: initialize our pthread_create wrapper earlier on openbsd
This is a genuine bug exposed by our test for issue 9456: our wrapper
for pthread_create is not initialized until we initialize cgo itself,
but it is possible that a static constructor could call pthread_create,
and in that case, it will be calling a nil function pointer.

Fix that by also initializing the sys_pthread_create function pointer
inside our pthread_create wrapper function, and use a pthread_once to
make sure it is only initialized once.

Fix build for openbsd.

Change-Id: Ica4da2c21fcaec186fdd3379128ef46f0e767ed7
Reviewed-on: https://go-review.googlesource.com/2232
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-01-01 02:52:34 +00:00
Shenghou Ma
76b2f06ee5 cmd/gc: fix filename output format verb for -s
%lL will prepend the current directory to the filename, which is not
what we want here (as the file name is already absolute).

Fixes #9150.

Change-Id: I4c9386be6baf421393b92d9401a264b4692986d0
Reviewed-on: https://go-review.googlesource.com/2231
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-31 23:11:07 +00:00
Shenghou Ma
5da9c8cd0a runtime: ignore SIGPROF to foreign threads before cgocallback is fully initialized
Some libraries, for example, OpenBLAS, create work threads in a global constructor.
If we're doing cpu profiling, it's possible that SIGPROF might come to some of the
worker threads before we make our first cgo call. Cgocallback used to terminate the
process when that happens, but it's better to miss a couple profiling signals than
to abort in this case.

Fixes #9456.

Change-Id: I112b8e1a6e10e6cc8ac695a4b518c0f577309b6b
Reviewed-on: https://go-review.googlesource.com/2141
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-31 23:10:44 +00:00
Martin Möhrmann
241583a432 strconv: optimize decimal to string conversion
Avoid the decimal lookup in digits array and compute the decimal character value directly.
Reduce calls to 64bit division on 32bit plattforms by splitting conversion into smaller blocks.
Convert value to uintptr type when it can be represented by uintptr.

on darwin/386

benchmark               old ns/op     new ns/op     delta
BenchmarkFormatInt      8352          7466          -10.61%
BenchmarkAppendInt      4281          3401          -20.56%
BenchmarkFormatUint     2785          2251          -19.17%
BenchmarkAppendUint     1770          1223          -30.90%

on darwin/amd64

benchmark               old ns/op     new ns/op     delta
BenchmarkFormatInt      5531          5492          -0.71%
BenchmarkAppendInt      2435          2295          -5.75%
BenchmarkFormatUint     1628          1569          -3.62%
BenchmarkAppendUint     726           750           +3.31%

Change-Id: Ifca281cbdd62ab7d7bd4b077a96da99eb12cf209
Reviewed-on: https://go-review.googlesource.com/2105
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-30 23:28:02 +00:00
Alan Donovan
fcd61eb07e go/parser: add {map,chan,interface} to expression lookahead tokens
+ tests that these parse:
  map[int]int{}[0]++
  interface{f()}(x).f()
  chan int(x) <- 0

Fixes #9474

Change-Id: If9fa57b3ab415ae7e93aa9935ec63edda8fe9d4f
Reviewed-on: https://go-review.googlesource.com/2178
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-30 21:49:25 +00:00
Brad Fitzpatrick
f005d6e34a archive/tar: document Reader.Next's behavior at the end
Change-Id: I72f6d0fc66dbee3f832d2d960b99a166a5bb10c3
Reviewed-on: https://go-review.googlesource.com/2191
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-30 21:38:37 +00:00
Anthony Martin
3d032d7653 runtime: consolidate arch-specific signal handlers on Plan 9
Change-Id: I4379418853c523fc9aaeb5d6f37bc96117841418
Reviewed-on: https://go-review.googlesource.com/1786
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2014-12-30 14:36:15 +00:00
Brad Fitzpatrick
4b96409aac net/http: support for setting trailers from a server Handler
We already had client support for trailers, but no way for a server to
set them short of hijacking the connection.

Fixes #7759

Change-Id: Ic83976437739ec6c1acad5f209ed45e501dbb93a
Reviewed-on: https://go-review.googlesource.com/2157
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-30 04:27:17 +00:00
Chris Manghane
5cc29ab95e cmd/gc: logical operators should produce untyped bool for untyped
operands

Fixes #6671 for cmd/gc.

Change-Id: I4907655b6e243960f2ceb544c63ea16513c7bd68
Reviewed-on: https://go-review.googlesource.com/1251
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-29 23:36:30 +00:00
Robert Griesemer
c85a2bf9c2 testing/iotest: fix copy/paste error in comment
Reported via unsupported GitHub pull request:
https://github.com/golang/go/pull/9436/

Change-Id: I12b00e8ccac700bb36b200196e2867fcc863fdf1
Reviewed-on: https://go-review.googlesource.com/2139
Reviewed-by: Alan Donovan <adonovan@google.com>
2014-12-29 19:05:37 +00:00
David du Colombier
29b4e34cf2 runtime: rename atoi to _atoi on Plan 9
Following change 2154, the goatoi function
was renamed atoi.

However, this definition conflicts with the
atoi function defined in the Plan 9 runtime,
which takes a []byte instead of a string.

This change fixes the build on Plan 9.

Change-Id: Ia0f7ca2f965bd5e3cce3177bba9c806f64db05eb
Reviewed-on: https://go-review.googlesource.com/2165
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-29 17:04:24 +00:00
Keith Randall
0bb8fc6614 runtime: remove go prefix from a few routines
They are no longer needed now that C is gone.

goatoi -> atoi
gofuncname/funcname -> funcname/cfuncname
goroundupsize -> already existing roundupsize

Change-Id: I278bc33d279e1fdc5e8a2a04e961c4c1573b28c7
Reviewed-on: https://go-review.googlesource.com/2154
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-29 15:18:29 +00:00
Shenghou Ma
ab0535ae3f liblink, cmd/ld, runtime: remove stackguard1
Now that we've removed all the C code in runtime and the C compilers,
there is no need to have a separate stackguard field to check for C
code on Go stack.

Remove field g.stackguard1 and rename g.stackguard0 to g.stackguard.
Adjust liblink and cmd/ld as necessary.

Change-Id: I54e75db5a93d783e86af5ff1a6cd497d669d8d33
Reviewed-on: https://go-review.googlesource.com/2144
Reviewed-by: Keith Randall <khr@golang.org>
2014-12-29 07:36:07 +00:00
Brad Fitzpatrick
26d5573949 net/smtp: add TLSConnectionState accessor
Fixes #9451

Change-Id: I0540e398b30c10779ac9d5a67a01d44bb6054a92
Reviewed-on: https://go-review.googlesource.com/2151
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-28 21:35:58 +00:00
Emil Hessman
d4e48eeca1 encoding/gob: address go vet report
Use Fatalf for formatting directive rather than plain Fatal.

Change-Id: Iebd30cd6326890e9501746113a6d97480949e3d2
Reviewed-on: https://go-review.googlesource.com/2161
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-28 19:30:31 +00:00
Keith Randall
b1f29b2d44 runtime: get rid of goalg, no longer needed
The goalg function was a holdover from when we had algorithm
tables in both C and Go.  It is no longer needed.

Change-Id: Ia0c1af35bef3497a899f22084a1a7b42daae72a0
Reviewed-on: https://go-review.googlesource.com/2099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-28 18:42:39 +00:00
Emil Hessman
2c987e1693 encoding/json: address go vet reports
The error message for decoding a unquoted value into a struct field with
the ,string option specified has two arguments when one is needed.
Make the error message take one argument and add a test in order to cover
the case when a unquoted value is specified.

Also add error value as the missing argument for Fatalf call in test.

Fixes the following go vet reports:

decode.go:602: wrong number of args for format in Errorf call: 1 needed but 2 args
decode_test.go:1088: missing argument for Fatalf("%v"): format reads arg 1, have only 0 args

Change-Id: Id036e10c54c4a7c1ee9952f6910858ecc2b84134
Reviewed-on: https://go-review.googlesource.com/2109
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2014-12-28 10:43:37 +00:00
Emil Hessman
b6e913806e cmd/pack: address go vet reports
Use log.Fatalf for formatting directives instead of log.Fatal

Change-Id: Ia207b320f5795c63cdfa71f92c19ca6d05cc833f
Reviewed-on: https://go-review.googlesource.com/2160
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-28 07:08:02 +00:00
Keith Randall
b2a950bb73 runtime: rename gothrow to throw
Rename "gothrow" to "throw" now that the C version of "throw"
is no longer needed.

This change is purely mechanical except in panic.go where the
old version of "throw" has been deleted.

sed -i "" 's/[[:<:]]gothrow[[:>:]]/throw/g' runtime/*.go

Change-Id: Icf0752299c35958b92870a97111c67bcd9159dc3
Reviewed-on: https://go-review.googlesource.com/2150
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2014-12-28 06:16:16 +00:00
Guobiao Mei
ddef2d27fe net/http: use t.Fatalf rather than t.Fatal in cookie_test.go
Change-Id: I60bbb7deb7462d1ca884677b4f86bd54b20b3f35
Reviewed-on: https://go-review.googlesource.com/2140
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-27 23:52:37 +00:00
Martin Möhrmann
0668b595b6 strconv/itoa: add test to generate the longest output string possible by formatBits
The new test case produces the longest string representation possible and thereby uses
all of the 65 bytes in the buffer array used by the formatBits function.

Change-Id: I11320c4de56ced5ff098b7e37f1be08e456573e2
Reviewed-on: https://go-review.googlesource.com/2108
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-27 22:35:08 +00:00
Shenghou Ma
354467ffbb crypto/cipher: update docs for the Stream interface
Specify what will happen if len(dst) != len(src).

Change-Id: I66afa3730f637753b825189687418f14ddec3629
Reviewed-on: https://go-review.googlesource.com/1754
Reviewed-by: Adam Langley <agl@golang.org>
2014-12-26 20:57:43 +00:00
mattn
e26e3fa25a reflect, runtime: gofmt
Change-Id: I5437b3a36181373d8ff33225d7520ab321459de9
Reviewed-on: https://go-review.googlesource.com/2084
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-26 04:43:33 +00:00
Shenghou Ma
1c0c611fc2 cmd/ld: put .bss from external objects into real .bss section
Fixes #9359.

Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/1889
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-26 01:05:02 +00:00
Dmitry Vyukov
ce9a4afa6f runtime: simplify procresize
Currently we do very a complex rebalancing of runnable goroutines
between queues, which tries to preserve scheduling fairness.
Besides being complex and error-prone, it also destroys all locality
of scheduling.

This change uses simpler scheme: leave runnable goroutines where
they are, during starttheworld start all Ps with local work,
plus start one additional P in case we have excessive runnable
goroutines in local queues or in the global queue.

The schedler must be able to operate efficiently w/o the rebalancing,
because garbage collections do not have to happen frequently.

The immediate need is execution tracing support: handling of
garabage collection which does stoptheworld/starttheworld several
times becomes exceedingly complex if the current execution can
jump between Ps during starttheworld.

Change-Id: I4fdb7a6d80ca4bd08900d0c6a0a252a95b1a2c90
Reviewed-on: https://go-review.googlesource.com/1951
Reviewed-by: Rick Hudson <rlh@golang.org>
2014-12-25 10:52:55 +00:00
Michael Matloob
c7eb9663aa regexp: fix typo in comment: s/onpass/onepass/
Change-Id: Idff57050a34d09e7fa9b77e9b53d61bb5ea2a71c
Reviewed-on: https://go-review.googlesource.com/2095
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-24 07:30:28 +00:00
Keith Randall
31f8310c45 reflect: fix func layout test for nacl build
This test code is ugly.  There must be a better way.
But for now, fix the build.

Change-Id: I33064145ea37f11abf040ec97caa87669be1a9fa
Reviewed-on: https://go-review.googlesource.com/2114
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-24 02:42:47 +00:00
Marko Tiikkaja
9371babdd8 database/sql: Remove unnecessary call to maybeOpenNewConnections
numCanOpen will never be larger than 0 in maybeOpenNewConnections() when this
code path is taken, so no new connections can ever be opened.

Change-Id: Id1302e8d9afb3a67be61b5e738fe07ef81d20fe0
Reviewed-on: https://go-review.googlesource.com/1550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-24 02:39:12 +00:00
Martin Möhrmann
76cc881ef0 sort: simplify rotate and reduce calls to it
Move the checks for empty rotate changes
from the beginning of rotate to the callers.

Remove additional variable p used instead of existing m with same value.

Remove special casing of equal ranges (i==j) to exit early as no
work is saved vs checking (i!=j) and  making a single
swapRange call if this is false.

benchmark                   old ns/op      new ns/op      delta
BenchmarkStableString1K     417195         425218         +1.92%
BenchmarkStableInt1K        126661         124498         -1.71%
BenchmarkStableInt64K       10365014       10417438       +0.51%
BenchmarkStable1e2          132151         130648         -1.14%
BenchmarkStable1e4          42027428       40812649       -2.89%
BenchmarkStable1e6          8524772364     8430192391     -1.11%

Change-Id: Ia7642e9d31408496970c700f5843d53cc3ebe817
Reviewed-on: https://go-review.googlesource.com/2100
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-23 23:21:04 +00:00
Carlos Castillo
131758183f go/build: add variable expansion to cgo lines
When go parses #cgo lines, expand ${SRCDIR} into the path to the
source directory. This allows options to be passed to the
compiler and linker that involve file paths relative to the
source code directory. Without the expansion the paths would be
invalid when the current working directory changes.

Fixes #7891
Fixes #5428

Change-Id: I343a145a9771a5ccbaa958e4a1ecd1716fcae52d
Reviewed-on: https://go-review.googlesource.com/1756
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-23 20:35:49 +00:00
Keith Randall
108dbd0dc7 reflect: more function layout tests
Test more stuff:
1) flagNoPointers, an incorrect value was the cause of #9425
2) Total function layout size
3) gc program

Change-Id: I73f65fe740215938fa930d2f096febd9db0a0021
Reviewed-on: https://go-review.googlesource.com/2090
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-23 19:57:56 +00:00
Alexandre Cesaro
0d4ea0c70d mime/multipart: moved some code to mime/internal/quotedprintable
The code concerning quoted-printable encoding (RFC 2045) and its
variant for MIME headers (RFC 2047) is currently spread in
mime/multipart and net/mail. It is also not exported.

This commit is the first step to fix that issue. It moves the
quoted-printable decoding code from mime/multipart to
mime/internal/quotedprintable. The exposed API is unchanged.

Concerns #4943.

Change-Id: I11352afbb2edb4d6ef62870b9bc5c87c639eff12
Reviewed-on: https://go-review.googlesource.com/1810
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-23 19:30:02 +00:00
David du Colombier
10be797578 runtime: fix exit on Plan 9
Add a nil byte at the end of the itoa buffer,
before calling gostringnocopy. This prevents
gostringnocopy to read past the buffer size.

Change-Id: I87494a8dd6ea45263882536bf6c0f294eda6866d
Reviewed-on: https://go-review.googlesource.com/2033
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2014-12-23 18:54:39 +00:00
Guobiao Mei
59cb2d9ca6 math/rand: fix example_test to show with the correct method
Originally it used r.Int63() to show "Uint32", and now we use the correct r.Uint32() method.

Fixes #9429

Change-Id: I8a1228f1ca1af93b0e3104676fc99000257c456f
Reviewed-on: https://go-review.googlesource.com/2069
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-23 17:24:24 +00:00
David du Colombier
a51b6ccfea cmd/dist: fatal shouldn't print errstr on Plan 9
During change 1864 discussion, Russ Cox pointed out
the fatal function shouldn't print errstr.

Change-Id: Icd71ec04be9c944bc235b8b198158465172e4fde
Reviewed-on: https://go-review.googlesource.com/2030
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-23 10:28:17 +00:00
Alex Brainman
20dce04742 runtime: remove thunk_windows.s
Change-Id: I171298e7942093e9cc82e3a0c4fcbb5b10298816
Reviewed-on: https://go-review.googlesource.com/1998
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-23 05:12:52 +00:00
Shenghou Ma
1050c4197a runtime: add comments for blank import of "unsafe"
Change-Id: Iaad548ea90d3b70341a723450d5e4d4c2b88856f
Reviewed-on: https://go-review.googlesource.com/2063
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-23 05:09:07 +00:00
Brad Fitzpatrick
1e4b642f8d cmd/api: work around Windows rename issue on the builders
More cmd/api/run.go hell.

Fixes #9407

Change-Id: If8fb446a2471d6372beb0534c9ab6824029b404c
Reviewed-on: https://go-review.googlesource.com/2054
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-23 04:55:44 +00:00