]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agoos: add explicit tests for fchown(2) and lchown(2) on unix platforms
Dave Cheney [Wed, 29 Jul 2015 10:06:45 +0000 (20:06 +1000)]
os: add explicit tests for fchown(2) and lchown(2) on unix platforms

Fixes #11919

Issue #11918 suggested that os.File.Chown and os.Lchown were under tested.

Change-Id: Ib41f7cb2d2fe0066d2ccb4d1bdabe1795efe80fc
Reviewed-on: https://go-review.googlesource.com/12834
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go: fix go get x/... matching internal directories
Russ Cox [Fri, 31 Jul 2015 16:10:22 +0000 (12:10 -0400)]
cmd/go: fix go get x/... matching internal directories

Fixes #11960.

Change-Id: I9361a9f17f4eaf8e4f54b4ba380fd50a4b9cf003
Reviewed-on: https://go-review.googlesource.com/13023
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix disallow of p/vendor/x during vendor experiment
Russ Cox [Fri, 31 Jul 2015 15:54:42 +0000 (11:54 -0400)]
cmd/go: fix disallow of p/vendor/x during vendor experiment

The percolation of errors upward in the load process could
drop errors, meaning that a build tree could, depending on the
processing order, import the same directory as both "p/vendor/x"
and as "x". That's not supposed to be allowed. But then, worse,
the build would generate two jobs for building that directory,
which would use the same work space and overwrite each other's files,
leading to very strange failures.

Two fixes:

1. Fix the propagation of errors upward (prefer errors over success).
2. Check explicitly for duplicated packages before starting a build.

New test for #1.
Since #2 can't happen, tested #2 by hand after reverting fix for #1.

Fixes #11913.

Change-Id: I6d2fc65f93b8fb5f3b263ace8d5f68d803a2ae5c
Reviewed-on: https://go-review.googlesource.com/13022
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile, runtime: fix placement of map bucket overflow pointer on nacl
Russ Cox [Fri, 31 Jul 2015 02:05:51 +0000 (22:05 -0400)]
cmd/compile, runtime: fix placement of map bucket overflow pointer on nacl

On most systems, a pointer is the worst case alignment, so adding
a pointer field at the end of a struct guarantees there will be no
padding added after that field (to satisfy overall struct alignment
due to some more-aligned field also present).

In the runtime, the map implementation needs a quick way to
get to the overflow pointer, which is last in the bucket struct,
so it uses size - sizeof(pointer) as the offset.

NaCl/amd64p32 is the exception, as always.
The worst case alignment is 64 bits but pointers are 32 bits.
There's a long history that is not worth going into, but when
we moved the overflow pointer to the end of the struct,
we didn't get the padding computation right.
The compiler computed the regular struct size and then
on amd64p32 added another 32-bit field.
And the runtime assumed it could step back two 32-bit fields
(one 64-bit register size) to get to the overflow pointer.
But in fact if the struct needed 64-bit alignment, the computation
of the regular struct size would have added a 32-bit pad already,
and then the code unconditionally added a second 32-bit pad.
This placed the overflow pointer three words from the end, not two.
The last two were padding, and since the runtime was consistent
about using the second-to-last word as the overflow pointer,
no harm done in the sense of overwriting useful memory.
But writing the overflow pointer to a non-pointer word of memory
means that the GC can't see the overflow blocks, so it will
collect them prematurely. Then bad things happen.

Correct all this in a few steps:

1. Add an explicit check at the end of the bucket layout in the
compiler that the overflow field is last in the struct, never
followed by padding.

2. When padding is needed on nacl (not always, just when needed),
insert it before the overflow pointer, to preserve the "last in the struct"
property.

3. Let the compiler have the final word on the width of the struct,
by inserting an explicit padding field instead of overwriting the
results of the width computation it does.

4. For the same reason (tell the truth to the compiler), set the type
of the overflow field when we're trying to pretend its not a pointer
(in this case the runtime maintains a list of the overflow blocks
elsewhere).

5. Make the runtime use "last in the struct" as its location algorithm.

This fixes TestTraceStress on nacl/amd64p32.
The 'bad map state' and 'invalid free list' failures no longer occur.

Fixes #11838.

Change-Id: If918887f8f252d988db0a35159944d2b36512f92
Reviewed-on: https://go-review.googlesource.com/12971
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agotest/bench/shootout: fix build
Mikio Hara [Fri, 31 Jul 2015 05:57:16 +0000 (14:57 +0900)]
test/bench/shootout: fix build

Change-Id: Ic8ff6c28ec899cf5e01553b83110eb6262870995
Reviewed-on: https://go-review.googlesource.com/12918
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/mail: fixed quoted-local
MathiasB [Fri, 31 Jul 2015 10:25:06 +0000 (12:25 +0200)]
net/mail: fixed quoted-local

Fixes some minor issues regarding quoted-string when parsing
the local-part.

Those strings should return an error:
- quoted-string without any content: `""@test.com`
- quoted-string containing tab: "\"\t\"@test.com"

Fixes #11293

Change-Id: Ied93eb6831915c9b1f8e727cea14168af21f8d3b
Reviewed-on: https://go-review.googlesource.com/12905
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj/arm: fix large stack offsets on nacl/arm
Russ Cox [Fri, 31 Jul 2015 02:35:56 +0000 (22:35 -0400)]
cmd/internal/obj/arm: fix large stack offsets on nacl/arm

The code already fixed large non-stack offsets
but explicitly excluded stack references.
Perhaps you could get away with that before,
but current versions of nacl reject such stack
references. Rewrite them the same as the others.

For #11956 but probably not the last problem.

Change-Id: I0db4e3a1ed4f88ccddf0d30228982960091d9fb7
Reviewed-on: https://go-review.googlesource.com/13010
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agoruntime: fix systemstack tracebacks on nacl/arm
Russ Cox [Fri, 31 Jul 2015 02:52:45 +0000 (22:52 -0400)]
runtime: fix systemstack tracebacks on nacl/arm

For #11956.

Change-Id: Ic9b57cafa197953cc7f435941e44d42b60b3ddf0
Reviewed-on: https://go-review.googlesource.com/13011
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agotest/bench/shootout: clean up binaries after run
Andrew Gerrand [Fri, 31 Jul 2015 02:03:48 +0000 (12:03 +1000)]
test/bench/shootout: clean up binaries after run

Update #11943

Change-Id: I3e6592876bf16d2f9129995b723ecf69c069653d
Reviewed-on: https://go-review.googlesource.com/12913
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: avoid reference to stale stack after GC shrinkstack
Russ Cox [Thu, 30 Jul 2015 23:39:16 +0000 (19:39 -0400)]
runtime: avoid reference to stale stack after GC shrinkstack

Dangling pointer error. Unlikely to trigger in practice, but still.
Found by running GODEBUG=efence=1 GOGC=1 trace.test.

Change-Id: Ice474dedcf62dd33ab77526287a023ba3b166db9
Reviewed-on: https://go-review.googlesource.com/12991
Reviewed-by: Austin Clements <austin@google.com>
9 years agocmd/link: increase ELFRESERVE to a full page
Russ Cox [Thu, 30 Jul 2015 20:30:54 +0000 (16:30 -0400)]
cmd/link: increase ELFRESERVE to a full page

Etcd and kubernetes have hit this.
See  https://bugzilla.redhat.com/show_bug.cgi?id=1248071

Change-Id: I6231013efa0a19ee74f7ebacd1024adb368af83a
Reviewed-on: https://go-review.googlesource.com/12951
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: permit installing into a subdirectory of $GOPATH/bin
Ian Lance Taylor [Thu, 30 Jul 2015 22:20:12 +0000 (15:20 -0700)]
cmd/go: permit installing into a subdirectory of $GOPATH/bin

In https://golang.org/cl/12080 we forbade installing cross-compiled
binaries into a subdirectory of $GOBIN, in order to fix
https://golang.org/issue/9769.  However, that fix was too aggressive,
in that it also forbade installing into a subdirectory of $GOPATH/bin.

This patch permits installing cross-compiled binaries into a
subdirectory $GOPATH/bin while continuing to forbid installing into a
subdirectory of $GOBIN.

Fixes #11778.

Change-Id: Ibc9919554e8c275beff54ec8bf919cfaa03b11ba
Reviewed-on: https://go-review.googlesource.com/12938
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: solaris info added to go1.5.html
Rob Pike [Thu, 30 Jul 2015 23:03:58 +0000 (09:03 +1000)]
doc: solaris info added to go1.5.html

Fixes #11952.

Change-Id: I548f9d75c6223bf79bdf654ef733f1568e3d5804
Reviewed-on: https://go-review.googlesource.com/12990
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agospec: document existing expression switch restrictions
Robert Griesemer [Mon, 27 Jul 2015 20:30:16 +0000 (13:30 -0700)]
spec: document existing expression switch restrictions

The spec didn't specify several aspects of expression switches:

- The switch expression is evaluated exactly once.

- Switch expressions evaluating to an untyped value are converted
  to the respective default type before use.

- An (untyped) nil value is not permitted as expression switch
  value. (We could permit it relatively easily, but gc doesn't,
  and disallowing it is in symmetry with the rules for var decls
  without explicit type and untyped initializer expressions.)

- The comparison x == t between each case expression x and
  switch expression value t must be valid.

- (Some) duplicate constant case expressions are not permitted.

This change also clarifies the following issues:

 4524: mult. equal int const switch case values should be illegal
                                         -> spec issue fixed
 6398: switch w/ no value uses bool rather than untyped bool
                                         -> spec issue fixed
11578: allows duplicate switch cases     -> go/types bug
11667: int overflow in switch expression -> go/types bug
11668: use of untyped nil in switch      -> not a gc bug

Fixes #4524.
Fixes #6398.
Fixes #11668.

Change-Id: Iae4ab3e714575a5d11c92c9b8fbf027aa706b370
Reviewed-on: https://go-review.googlesource.com/12711
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: in go1.5.html fix claim about linking for ppc64(le)?
Rob Pike [Thu, 30 Jul 2015 05:53:10 +0000 (15:53 +1000)]
doc: in go1.5.html fix claim about linking for ppc64(le)?

Change-Id: If61c2063a8b63f0e3e498a5e86803b5ddba9fa3c
Reviewed-on: https://go-review.googlesource.com/12886
Reviewed-by: Austin Clements <austin@google.com>
9 years agoA+C: automated update
Brad Fitzpatrick [Thu, 30 Jul 2015 13:25:29 +0000 (15:25 +0200)]
A+C: automated update

Change-Id: Ie4431e74f095b85b4b5c07d087c3d29acf46d138
Reviewed-on: https://go-review.googlesource.com/12902
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoapi: update go1.5.txt
Brad Fitzpatrick [Thu, 30 Jul 2015 09:27:51 +0000 (11:27 +0200)]
api: update go1.5.txt

Fixes #11935

Change-Id: Ife00c246345f7d3f96aa95349a35e76671ca7160
Reviewed-on: https://go-review.googlesource.com/12769
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/trace: report negative frequency as a time-ordering problem
Russ Cox [Thu, 30 Jul 2015 17:39:30 +0000 (13:39 -0400)]
runtime/trace: report negative frequency as a time-ordering problem

This should fix the solaris/amd64 builder.

Change-Id: Idd6460cc9e842f7b874c9757379986aa723c974c
Reviewed-on: https://go-review.googlesource.com/12922
Reviewed-by: Austin Clements <austin@google.com>
9 years agosyscall: use fchownat(2) in place of lchown(2) for linux/arm64
Dave Cheney [Wed, 29 Jul 2015 09:36:55 +0000 (19:36 +1000)]
syscall: use fchownat(2) in place of lchown(2) for linux/arm64

Fixes #11918

Replace calls to lchown(2) with fchownat(2) for linux/arm64 as the former is not suppored.

This change has also landed on the x/sys repo as CL 12837.

Change-Id: I58d4b144e051e36dd650ec9b7f3a02610ea943e5
Reviewed-on: https://go-review.googlesource.com/12833
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc: add go1.5 note about change to zero-sized fields in cgo
Ian Lance Taylor [Thu, 30 Jul 2015 16:01:22 +0000 (09:01 -0700)]
doc: add go1.5 note about change to zero-sized fields in cgo

This documents the change made in https://golang.org/cl/12864 for
https://golang.org/issue/11925.

Update #11925.

Change-Id: Id09f2a489ea947a725ed12c9cf793e5daef07a06
Reviewed-on: https://go-review.googlesource.com/12866
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime, sync/atomic: add memory barriers in arm cas routines
Russ Cox [Thu, 30 Jul 2015 19:55:49 +0000 (15:55 -0400)]
runtime, sync/atomic: add memory barriers in arm cas routines

This only triggers on ARMv7+.
If there are important SMP ARMv6 machines we can reconsider.

Makes TestLFStress tests pass and sync/atomic tests not time out
on Apple iPad Mini 3.

Fixes #7977.
Fixes #10189.

Change-Id: Ie424dea3765176a377d39746be9aa8265d11bec4
Reviewed-on: https://go-review.googlesource.com/12950
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agogo/types: update comment to refer to package go/constant
Robert Griesemer [Thu, 30 Jul 2015 19:59:49 +0000 (12:59 -0700)]
go/types: update comment to refer to package go/constant

For #11949.

Change-Id: I4329604a24efc7f40cf5bf52fb3c9e30916b3cc2
Reviewed-on: https://go-review.googlesource.com/12931
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoencoding/json: revert "fix decoding of JSON null values"
Russ Cox [Thu, 30 Jul 2015 14:05:04 +0000 (14:05 +0000)]
encoding/json: revert "fix decoding of JSON null values"

Fixes #11912.
Fixes #11937.

This reverts commit 1a99ba55df902a2657d1ccfc52a60024c22dba98.

Change-Id: I32b76053fdabc59f28ca5bedf1b15c0baa8afae1
Reviewed-on: https://go-review.googlesource.com/12893
Reviewed-by: Didier Spezia <didier.06@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime/cgo: fix darwin/amd64 signal handling setup
Russ Cox [Thu, 30 Jul 2015 18:53:44 +0000 (14:53 -0400)]
runtime/cgo: fix darwin/amd64 signal handling setup

Was not allocating space for the frame above sigpanic,
nor was it pushing the LR into the right place.
Because traceback past sigpanic only needs the
LR for faulting leaves, this was not noticed too much.
But it did break the sync/atomic nil deref tests.

Change-Id: Icba53fffa193423aab744c37f21ee893ce2ee3ac
Reviewed-on: https://go-review.googlesource.com/12926
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd/compile: add case for ODOTTYPE to escwalk
David Chase [Thu, 30 Jul 2015 16:31:18 +0000 (12:31 -0400)]
cmd/compile: add case for ODOTTYPE to escwalk

ODOTTYPE should be treated a whole lot like ODOT,
but it was missing completely from the switch in
escwalk and thus escape status did not propagate
to fields.

Since interfaces are required to trigger this bug,
the test was added to escape_iface.go.

Fixes #11931.

Change-Id: Id0383981cc4b1a160f6ad447192a112eed084538
Reviewed-on: https://go-review.googlesource.com/12921
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agosync/atomic: reenable TestNilDeref everywhere
Russ Cox [Thu, 30 Jul 2015 16:37:05 +0000 (12:37 -0400)]
sync/atomic: reenable TestNilDeref everywhere

There is absolutely no information about how this was failing.
If we reenable the test then at least we can get a build log from
darwin/arm.

There are not even freebsd/arm or netbsd/arm builders,
so not too worried about those. (That is another problem.)

Change-Id: I0e739a4dd2897adbe110aa400d720d8fa02ae65f
Reviewed-on: https://go-review.googlesource.com/12920
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: change arm software div/mod call sequence not to modify stack
Russ Cox [Thu, 30 Jul 2015 14:45:01 +0000 (10:45 -0400)]
runtime: change arm software div/mod call sequence not to modify stack

Instead of pushing the denominator argument on the stack,
the denominator is now passed in m.

This fixes a variety of bugs related to trying to take stack traces
backwards from the middle of the software div/mod routines.
Some of those bugs have been kludged around in the past,
but others have not. Instead of trying to patch up after breaking
the stack, this CL stops breaking the stack.

This is an update of https://golang.org/cl/19810043,
which was rolled back in https://golang.org/cl/20350043.

The problem in the original CL was that there were divisions
at bad times, when m was not available. These were divisions
by constant denominators, either in C code or in assembly.
The Go compiler knows how to generate division by multiplication
for constant denominators, but the C compiler did not.
There is no longer any C code, so that's taken care of.
There was one problematic DIV in runtime.usleep (assembly)
but https://golang.org/cl/12898 took care of that one.
So now this approach is safe.

Reject DIV/MOD in NOSPLIT functions to keep them from
coming back.

Fixes #6681.
Fixes #6699.
Fixes #10486.

Change-Id: I09a13c76ad08ba75b3bd5d46a3eb78e66a84ab38
Reviewed-on: https://go-review.googlesource.com/12899
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/cgo: discard trailing zero-sized fields in a non-empty C struct
Ian Lance Taylor [Thu, 30 Jul 2015 05:04:09 +0000 (22:04 -0700)]
cmd/cgo: discard trailing zero-sized fields in a non-empty C struct

In order to fix issue #9401 the compiler was changed to add a padding
byte to any non-empty Go struct that ends in a zero-sized field.  That
causes the Go version of such a C struct to have a different size than
the C struct, which can considerable confusion.  Change cgo so that it
discards any such zero-sized fields, so that the Go and C structs are
the same size.

This is a change from previous releases, in that it used to be
possible to refer to a zero-sized trailing field (by taking its
address), and with this change it no longer is.  That is unfortunate,
but something has to change.  It seems better to visibly break
programs that do this rather than to silently break programs that rely
on the struct sizes being the same.

Update #9401.
Fixes #11925.

Change-Id: I3fba3f02f11265b3c41d68616f79dedb05b81225
Reviewed-on: https://go-review.googlesource.com/12864
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: replace divide with multiply in runtime.usleep on arm
Russ Cox [Thu, 30 Jul 2015 14:54:53 +0000 (10:54 -0400)]
runtime: replace divide with multiply in runtime.usleep on arm

We want to adjust the DIV calling convention to use m,
and usleep can be called without an m, so switch to a
multiplication by the reciprocal (and test).

Step toward a fix for #6699 and #10486.

Change-Id: Iccf76a18432d835e48ec64a2fa34a0e4d6d4b955
Reviewed-on: https://go-review.googlesource.com/12898
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/obj/arm: fix line numbers after constant pool
Russ Cox [Thu, 30 Jul 2015 14:28:44 +0000 (10:28 -0400)]
cmd/internal/obj/arm: fix line numbers after constant pool

If a function is large enough to need to flush the constant pool
mid-function, the line number assignment code was forcing the
line numbers not just for the constant pool but for all the instructions
that follow it. This made the line number information completely
wrong for all but the beginning of large functions on arm.

Same problem in code copied into arm64.

This broke runtime/trace's TestTraceSymbolize.

Fixes arm build.

Change-Id: I84d9fb2c798c4085f69b68dc766ab4800c7a6ca4
Reviewed-on: https://go-review.googlesource.com/12894
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

9 years agocrypto/x509: mark root_darwin_armx.go as cgo-only
Russ Cox [Thu, 30 Jul 2015 15:08:15 +0000 (11:08 -0400)]
crypto/x509: mark root_darwin_armx.go as cgo-only

This allows running a cross-compile like
GOOS=darwin GOARCH=arm go build std
to check that everything builds.

Otherwise there is a redefinition error because both
root_nocgo_darwin.go and root_darwin_armx.go
supply initSystemRoots.

Change-Id: Ic95976b2b698d28c629bfc93d8dac0048b023578
Reviewed-on: https://go-review.googlesource.com/12897
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet: allow longer timeout in dialClosedPort test on windows
Russ Cox [Thu, 30 Jul 2015 14:39:07 +0000 (10:39 -0400)]
net: allow longer timeout in dialClosedPort test on windows

The test expects the dial to take 1.0 seconds
on Windows and allows it to go to 1.095 seconds.
That's far too optimistic.
Recent failures are reporting roughly 1.2 seconds.
Let it have 1.5.

Change-Id: Id69811ccb65bf4b4c159301a2b4767deb6ee8d28
Reviewed-on: https://go-review.googlesource.com/12895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/rand: warn against using package for security-sensitive work
Andrey Petrov [Thu, 30 Jul 2015 09:47:01 +0000 (11:47 +0200)]
math/rand: warn against using package for security-sensitive work

Urge users of math/rand to consider using crypto/rand when doing
security-sensitive work.

Related to issue #11871. While we haven't reached consensus on how
to make the package inherently safer, everyone agrees that the docs
for math/rand can be improved.

Change-Id: I576a312e51b2a3445691da6b277c7b4717173197
Reviewed-on: https://go-review.googlesource.com/12900
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime/trace: test requires 'go tool addr2line'
David Crawshaw [Wed, 29 Jul 2015 23:56:10 +0000 (19:56 -0400)]
runtime/trace: test requires 'go tool addr2line'

For the android/arm builder.

Change-Id: Iad4881689223cd6479870da9541524a8cc458cce
Reviewed-on: https://go-review.googlesource.com/12859
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>

9 years agocmd/compile: fix uninitialized memory during type switch assertE2I2
Russ Cox [Thu, 30 Jul 2015 04:46:42 +0000 (00:46 -0400)]
cmd/compile: fix uninitialized memory during type switch assertE2I2

Fixes arm64 builder crash.

The bug is possible on all architectures; you just have to get lucky
and hit a preemption or a stack growth on entry to assertE2I2.
The test stacks the deck.

Change-Id: I8419da909b06249b1ad15830cbb64e386b6aa5f6
Reviewed-on: https://go-review.googlesource.com/12890
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: enable TestEmptySlice
Russ Cox [Wed, 29 Jul 2015 23:05:07 +0000 (19:05 -0400)]
runtime: enable TestEmptySlice

It says to disable until #7564 is fixed. It was fixed in April 2014.

Change-Id: I9bebfe96802bafdd2d1a0a47591df346d91b000c
Reviewed-on: https://go-review.googlesource.com/12858
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: set invalidptr=1 by default, as documented go1.5beta3
Russ Cox [Wed, 29 Jul 2015 23:04:35 +0000 (19:04 -0400)]
runtime: set invalidptr=1 by default, as documented

Also make invalidptr control the recently added GC pointer check,
as documented.

Change-Id: Iccfdf49480219d12be8b33b8f03d8312d8ceabed
Reviewed-on: https://go-review.googlesource.com/12857
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: remove non-answer from FAQ
Andrew Gerrand [Wed, 29 Jul 2015 22:27:56 +0000 (08:27 +1000)]
doc: remove non-answer from FAQ

Change-Id: Ie43986d016e5a9fb17ca1393263932bbb56e81ff
Reviewed-on: https://go-review.googlesource.com/12836
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/trace: remove existing Skips
Russ Cox [Tue, 28 Jul 2015 17:37:13 +0000 (13:37 -0400)]
runtime/trace: remove existing Skips

The skips added in CL 12579, based on incorrect time stamps,
should be sufficient to identify and exclude all the time-related
flakiness on these systems.

If there is other flakiness, we want to find out.

For #10512.

Change-Id: I5b588ac1585b2e9d1d18143520d2d51686b563e3
Reviewed-on: https://go-review.googlesource.com/12746
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime/trace: record event sequence numbers explicitly
Russ Cox [Thu, 23 Jul 2015 18:01:03 +0000 (14:01 -0400)]
runtime/trace: record event sequence numbers explicitly

Nearly all the flaky failures we've seen in trace tests have been
due to the use of time stamps to determine relative event ordering.
This is tricky for many reasons, including:
 - different cores might not have exactly synchronized clocks
 - VMs are worse than real hardware
 - non-x86 chips have different timer resolution than x86 chips
 - on fast systems two events can end up with the same time stamp

Stop trying to make time reliable. It's clearly not going to be for Go 1.5.
Instead, record an explicit event sequence number for ordering.
Using our own counter solves all of the above problems.

The trace still contains time stamps, of course. The sequence number
is just used for ordering.

Should alleviate #10554 somewhat. Then tickDiv can be chosen to
be a useful time unit instead of having to be exact for ordering.

Separating ordering and time stamps lets the trace parser diagnose
systems where the time stamp order and actual order do not match
for one reason or another. This CL adds that check to the end of
trace.Parse, after all other sequence order-based checking.
If that error is found, we skip the test instead of failing it.
Putting the check in trace.Parse means that cmd/trace will pick
up the same check, refusing to display a trace where the time stamps
do not match actual ordering.

Using net/http's BenchmarkClientServerParallel4 on various CPU counts,
not tracing vs tracing:

name                      old time/op    new time/op    delta
ClientServerParallel4       50.4µs Â± 4%    80.2µs Â± 4%  +59.06%        (p=0.000 n=10+10)
ClientServerParallel4-2     33.1µs Â± 7%    57.8µs Â± 5%  +74.53%        (p=0.000 n=10+10)
ClientServerParallel4-4     18.5µs Â± 4%    32.6µs Â± 3%  +75.77%        (p=0.000 n=10+10)
ClientServerParallel4-6     12.9µs Â± 5%    24.4µs Â± 2%  +89.33%        (p=0.000 n=10+10)
ClientServerParallel4-8     11.4µs Â± 6%    21.0µs Â± 3%  +83.40%        (p=0.000 n=10+10)
ClientServerParallel4-12    14.4µs Â± 4%    23.8µs Â± 4%  +65.67%        (p=0.000 n=10+10)

Fixes #10512.

Change-Id: I173eecf8191e86feefd728a5aad25bf1bc094b12
Reviewed-on: https://go-review.googlesource.com/12579
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: ignore arguments in cgocallback_gofunc frame
Russ Cox [Wed, 29 Jul 2015 20:16:13 +0000 (16:16 -0400)]
runtime: ignore arguments in cgocallback_gofunc frame

Otherwise the GC may see uninitialized memory there,
which might be old pointers that are retained, or it might
trigger the invalid pointer check.

Fixes #11907.

Change-Id: I67e306384a68468eef45da1a8eb5c9df216a77c0
Reviewed-on: https://go-review.googlesource.com/12852
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: fix darwin/amd64 assembly frame sizes
Russ Cox [Wed, 29 Jul 2015 22:25:30 +0000 (18:25 -0400)]
runtime: fix darwin/amd64 assembly frame sizes

Change-Id: I2f0ecdc02ce275feadf07e402b54f988513e9b49
Reviewed-on: https://go-review.googlesource.com/12855
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj/arm64: fix build
Russ Cox [Wed, 29 Jul 2015 21:42:58 +0000 (17:42 -0400)]
cmd/internal/obj/arm64: fix build

Change-Id: I3088e17aff72096e3ec2ced49c70564627c982a6
Reviewed-on: https://go-review.googlesource.com/12854
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: reenable bad pointer check in GC
Russ Cox [Wed, 29 Jul 2015 19:18:56 +0000 (15:18 -0400)]
runtime: reenable bad pointer check in GC

The last time we tried this, linux/arm64 broke.
The series of CLs leading to this one fixes that problem.
Let's try again.

Fixes #9880.

Change-Id: I67bc1d959175ec972d4dcbe4aa6f153790f74251
Reviewed-on: https://go-review.googlesource.com/12849
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agocmd/internal/obj/arm64: reject misaligned stack frames, except empty frames
Russ Cox [Wed, 29 Jul 2015 19:15:03 +0000 (15:15 -0400)]
cmd/internal/obj/arm64: reject misaligned stack frames, except empty frames

The layout code has to date insisted on stack frames that are 16-aligned
including the saved LR, and it ensured this by growing the frame itself.
This breaks code that refers to values near the top of the frame by positive
offset from SP, and in general it's too magical: if you see TEXT xxx, $N,
you expect that the frame size is actually N, not sometimes N and sometimes N+8.

This led to a serious bug in the compiler where ambiguously live values
were not being zeroed correctly, which in turn triggered an assertion
in the GC about finding only valid pointers. The compiler has been
fixed to always emit aligned frames, and the hand-written assembly
has also been fixed.

Now that everything is aligned, make unaligned an error instead of
something to "fix" silently.

For #9880.

Change-Id: I05f01a9df174d64b37fa19b36a6b6c5f18d5ba2d
Reviewed-on: https://go-review.googlesource.com/12848
Reviewed-by: Austin Clements <austin@google.com>
9 years agocmd/link: fix nosplit stack overflow checks
Russ Cox [Wed, 29 Jul 2015 19:07:35 +0000 (15:07 -0400)]
cmd/link: fix nosplit stack overflow checks

The nosplit stack overflow checks were confused about morestack.
The comment about not having correct SP information at the call
to morestack was true, but that was a real bug, not something to
work around. I fixed that problem in CL 12144. With that fixed,
no need to special-case morestack in the way done here.

This cleanup and simplification of the code was the first step
to fixing a bug that happened when I started working on the
arm64 frame size adjustments, but the cleanup was sufficient
to make the bug go away.

For #9880.

Change-Id: I16b69a5c16b6b8cb4090295d3029c42d606e3b9b
Reviewed-on: https://go-review.googlesource.com/12846
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime, reflect: use correctly aligned stack frame sizes on arm64
Russ Cox [Wed, 29 Jul 2015 19:04:30 +0000 (15:04 -0400)]
runtime, reflect: use correctly aligned stack frame sizes on arm64

arm64 requires either no stack frame or a frame with a size that is 8 mod 16
(adding the saved LR will make it 16-aligned).

The cmd/internal/obj/arm64 has been silently aligning frames, but it led to
a terrible bug when the compiler and obj disagreed on the frame size,
and it's just generally confusing, so we're going to make misaligned frames
an error instead of something that is silently changed.

This CL prepares by updating assembly files.
Note that the changes in this CL are already being done silently by
cmd/internal/obj/arm64, so there is no semantic effect here,
just a clarity effect.

For #9880.

Change-Id: Ibd6928dc5fdcd896c2bacd0291bf26b364591e28
Reviewed-on: https://go-review.googlesource.com/12845
Reviewed-by: Austin Clements <austin@google.com>
9 years agocmd/compile: align arm64 stack frames correctly
Russ Cox [Wed, 29 Jul 2015 19:11:42 +0000 (15:11 -0400)]
cmd/compile: align arm64 stack frames correctly

If the compiler doesn't do it, cmd/internal/obj/arm64 will,
and that will break the zeroing of ambiguously live values
done in zerorange, which in turn produces uninitialized
pointer cells that the GC trips over.

For #9880.

Change-Id: Ice97c30bc8b36d06b7b88d778d87fab8e1827fdc
Reviewed-on: https://go-review.googlesource.com/12847
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: report GC CPU utilization in MemStats
Austin Clements [Wed, 29 Jul 2015 18:02:34 +0000 (14:02 -0400)]
runtime: report GC CPU utilization in MemStats

This adds a GCCPUFraction field to MemStats that reports the
cumulative fraction of the program's execution time spent in the
garbage collector. This is equivalent to the utilization percent shown
in the gctrace output and makes this available programmatically.

This does make one small effect on the gctrace output: we now report
the duration of mark termination up to just before the final
start-the-world, rather than up to just after. However, unlike
stop-the-world, I don't believe there's any way that start-the-world
can block, so it should take negligible time.

While there are many statistics one might want to expose via MemStats,
this is one of the few that will undoubtedly remain meaningful
regardless of future changes to the memory system.

The diff for this change is larger than the actual change. Mostly it
lifts the code for computing the GC CPU utilization out of the
debug.gctrace path.

Updates #10323.

Change-Id: I0f7dc3fdcafe95e8d1233ceb79de606b48acd989
Reviewed-on: https://go-review.googlesource.com/12844
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: always capture GC phase transition times
Austin Clements [Wed, 29 Jul 2015 16:48:33 +0000 (12:48 -0400)]
runtime: always capture GC phase transition times

Currently we only capture GC phase transition times if
debug.gctrace>0, but we're about to compute GC CPU utilization
regardless of whether debug.gctrace is set, so we need these
regardless of debug.gctrace.

Change-Id: If3acf16505a43d416e9a99753206f03287180660
Reviewed-on: https://go-review.googlesource.com/12843
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agoruntime: avoid race between SIGPROF traceback and stack barriers
Austin Clements [Tue, 28 Jul 2015 18:33:39 +0000 (14:33 -0400)]
runtime: avoid race between SIGPROF traceback and stack barriers

The following sequence of events can lead to the runtime attempting an
out-of-bounds access on a stack barrier slice:

1. A SIGPROF comes in on a thread while the G on that thread is in
   _Gsyscall. The sigprof handler calls gentraceback, which saves a
   local copy of the G's stkbar slice. Currently the G has no stack
   barriers, so this slice is empty.

2. On another thread, the GC concurrently scans the stack of the
   goroutine being profiled (it considers it stopped because it's in
   _Gsyscall) and installs stack barriers.

3. Back on the sigprof thread, gentraceback comes across a stack
   barrier in the stack and attempts to look it up in its (zero
   length) copy of G's old stkbar slice, which causes an out-of-bounds
   access.

This commit fixes this by adding a simple cas spin to synchronize the
SIGPROF handler with stack barrier insertion.

In general I would prefer that this synchronization be done through
the G status, since that's how stack scans are otherwise synchronized,
but adding a new lock is a much smaller change and G statuses are full
of subtlety.

Fixes #11863.

Change-Id: Ie89614a6238bb9c6a5b1190499b0b48ec759eaf7
Reviewed-on: https://go-review.googlesource.com/12748
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: force mutator to give work buffer to GC
Rick Hudson [Wed, 29 Jul 2015 16:03:54 +0000 (12:03 -0400)]
runtime: force mutator to give work buffer to GC

The scheduler, work buffer's dispose, and write barriers
can conspire to hide the a pointer from the GC's concurent
mark phase. If this pointer is the only path to a large
amount of marking the STW mark termination phase may take
a lot of time.

Consider the following:
1) dispose places a work buffer on the partial queue
2) the GC is busy so it does not immediately remove and
   process the work buffer
3) the scheduler runs a mutator whose write barrier dequeues the
   work buffer from the partial queue so the GC won't see it
This repeats until the GC reaches the mark termination
phase where the GC finally discovers the pointer along
with a lot of work to do.

This CL fixes the problem by having the mutator
dispose of the buffer to the full queue instead of
the partial queue. Since the write buffer never asks for full
buffers the conspiracy described above is not possible.

Updates #11694.

Change-Id: I2ce832f9657a7570f800e8ce4459cd9e304ef43b
Reviewed-on: https://go-review.googlesource.com/12840
Reviewed-by: Austin Clements <austin@google.com>
9 years agodoc: add json tokenizer to go1.5.html
Rob Pike [Tue, 28 Jul 2015 23:43:32 +0000 (09:43 +1000)]
doc: add json tokenizer to go1.5.html

Change-Id: I45d92fed757fa1866d5b80e53ed1af6712fa6741
Reviewed-on: https://go-review.googlesource.com/12782
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/asm: delete
Mikio Hara [Wed, 29 Jul 2015 03:55:19 +0000 (12:55 +0900)]
cmd/internal/asm: delete

Updates #10510.

Change-Id: Ib4d39943969d18517b373292b83d87650d5df12a
Reviewed-on: https://go-review.googlesource.com/12787
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd: delete old[5689]a
Rob Pike [Wed, 29 Jul 2015 03:06:28 +0000 (13:06 +1000)]
cmd: delete old[5689]a

These are the old assemblers written in C, and now they are
not needed.

Fixes #10510.

Change-Id: Id9337ffc8eccfd93c84b2e23f427fb1a576b543d
Reviewed-on: https://go-review.googlesource.com/12784
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/dist: cleanup message about building go_bootstrap
Matthew Dempsky [Tue, 28 Jul 2015 17:58:27 +0000 (10:58 -0700)]
cmd/dist: cleanup message about building go_bootstrap

At this stage, dist is only building go_bootstrap as cmd/compile and
the rest of the Go toolchain has already been built.

Change-Id: I6f99fa00ff1d3585e215f4ce84d49344c4fcb8a5
Reviewed-on: https://go-review.googlesource.com/12779
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: fix go get -u with vendoring
Russ Cox [Tue, 28 Jul 2015 19:50:51 +0000 (15:50 -0400)]
cmd/go: fix go get -u with vendoring

Fixes #11864.

Change-Id: Ib9d5bd79f3b73ebd32f6585b354aaad556e0fc71
Reviewed-on: https://go-review.googlesource.com/12749
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: fix out-of-bounds in stack debugging
Dmitry Vyukov [Tue, 28 Jul 2015 18:50:00 +0000 (20:50 +0200)]
runtime: fix out-of-bounds in stack debugging

Currently stackDebug=4 crashes as:

panic: runtime error: index out of range
fatal error: panic on system stack
runtime stack:
runtime.throw(0x607470, 0x15)
src/runtime/panic.go:527 +0x96
runtime.gopanic(0x5ada00, 0xc82000a1d0)
src/runtime/panic.go:354 +0xb9
runtime.panicindex()
src/runtime/panic.go:12 +0x49
runtime.adjustpointers(0xc820065ac8, 0x7ffe58b56100, 0x7ffe58b56318, 0x0)
src/runtime/stack1.go:428 +0x5fb
runtime.adjustframe(0x7ffe58b56200, 0x7ffe58b56318, 0x1)
src/runtime/stack1.go:542 +0x780
runtime.gentraceback(0x487760, 0xc820065ac0, 0x0, 0xc820001080, 0x0, 0x0, 0x7fffffff, 0x6341b8, 0x7ffe58b56318, 0x0, ...)
src/runtime/traceback.go:336 +0xa7e
runtime.copystack(0xc820001080, 0x1000)
src/runtime/stack1.go:616 +0x3b1
runtime.newstack()
src/runtime/stack1.go:801 +0xdde

Change-Id: If2d60960231480a9dbe545d87385fe650d6db808
Reviewed-on: https://go-review.googlesource.com/12763
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: use 64k page rounding on arm64
Russ Cox [Tue, 28 Jul 2015 17:41:16 +0000 (13:41 -0400)]
runtime: use 64k page rounding on arm64

Fixes #11886.

Change-Id: I9392fd2ef5951173ae275b3ab42db4f8bd2e1d7a
Reviewed-on: https://go-review.googlesource.com/12747
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: fix x86 stack trace for call to heap memory on Plan 9
David du Colombier [Tue, 28 Jul 2015 18:48:10 +0000 (20:48 +0200)]
runtime: fix x86 stack trace for call to heap memory on Plan 9

Russ Cox fixed this issue for other systems
in CL 12026, but the Plan 9 part was forgotten.

Fixes #11656.

Change-Id: I91c033687987ba43d13ad8f42e3fe4c7a78e6075
Reviewed-on: https://go-review.googlesource.com/12762
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/doc: extend darwin/arm64 test TODO to arm
David Crawshaw [Tue, 28 Jul 2015 16:59:34 +0000 (12:59 -0400)]
cmd/doc: extend darwin/arm64 test TODO to arm

Change-Id: Iee0f3890d66b4117aa5d9f486e5775b1cf31996c
Reviewed-on: https://go-review.googlesource.com/12745
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: don't run fixedbugs/issue11656.go on netbsd/386
Ian Lance Taylor [Tue, 28 Jul 2015 15:33:24 +0000 (08:33 -0700)]
test: don't run fixedbugs/issue11656.go on netbsd/386

The netbsd/386 builder reports a failure at
http://build.golang.org/log/c21c45a4fc6f4845868aa3ebde0f5bb3f167f3a3

I'm assuming that this is similar to the unknown openbsd failure.

Update #11910.

Change-Id: I9cdfefa23dc7cda3849f14814b3ce531f1d39e93
Reviewed-on: https://go-review.googlesource.com/12777
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agotest: don't run issue10607.go on ppc64
Ian Lance Taylor [Tue, 28 Jul 2015 14:42:09 +0000 (07:42 -0700)]
test: don't run issue10607.go on ppc64

This is a reprise of https://golang.org/cl/12623.  In that a CL I made
a suggestion which forgot that the +build constraints in the test
directory are not the same as those supported by the go tool: in the
test directory, if a single +build line fails, the test is skipped.
(In my defense, the code I was commenting on was also wrong.)

Change-Id: I8f29392a80b1983027f9a33043c803578409d678
Reviewed-on: https://go-review.googlesource.com/12776
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/asm: fix and test CALL, JMP aliases on arm, arm64, ppc64
Russ Cox [Tue, 28 Jul 2015 03:26:26 +0000 (23:26 -0400)]
cmd/asm: fix and test CALL, JMP aliases on arm, arm64, ppc64

Fixes #11900.

Change-Id: Idfc54e1fac833c8d646266128efe46214a82dfed
Reviewed-on: https://go-review.googlesource.com/12741
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: don't define libc_getpid in os3_solaris.go
Ian Lance Taylor [Tue, 28 Jul 2015 06:29:09 +0000 (23:29 -0700)]
runtime: don't define libc_getpid in os3_solaris.go

The function is already defined between syscall_solaris.go and
syscall2_solaris.go.

Change-Id: I034baf7c8531566bebfdbc5a4061352cbcc31449
Reviewed-on: https://go-review.googlesource.com/12773
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: make spuriousENOTAVAIL to be able to parse EADDRNOTAVAIL correctly
Mikio Hara [Tue, 28 Jul 2015 03:28:09 +0000 (12:28 +0900)]
net: make spuriousENOTAVAIL to be able to parse EADDRNOTAVAIL correctly

Change-Id: I82e3aadbd18fccb98a76d1c36876510f5e1c3089
Reviewed-on: https://go-review.googlesource.com/12750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: avoid long lines in help messages
Jeff R. Allen [Thu, 23 Jul 2015 12:56:13 +0000 (14:56 +0200)]
cmd/go: avoid long lines in help messages

Reformat some help messages to stay within 80 characters.

Fixes #11840.

Change-Id: Iebafcb616f202ac44405e5897097492a79a51722
Reviewed-on: https://go-review.googlesource.com/12514
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet: don't return DNS query results including the second best records unconditionally
Mikio Hara [Tue, 9 Jun 2015 08:30:00 +0000 (17:30 +0900)]
net: don't return DNS query results including the second best records unconditionally

This change prevents DNS query results using domain search list
overtaking results not using the list unconditionally, which only
happens when using builtin DNS stub resolver.

The previous internal lookup function lookup is split into lookup and
goLookupIPOrder for iteration over a set of names: FQDN or absolute
FQDN, with domain label suffixes in search list, without domain label
suffixes, and for concurrent A and AAAA record queries.

Fixes #11081.

Change-Id: I9ff0640f69276e372d97e709b149ed5b153e8601
Reviewed-on: https://go-review.googlesource.com/10836
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/json: test style tweaks
Brad Fitzpatrick [Tue, 28 Jul 2015 05:53:37 +0000 (07:53 +0200)]
encoding/json: test style tweaks

Rename test name from Http to HTTP, and fix some style nits.

Change-Id: I00fe1cecd69ca2f50be86a76ec90031c2f921707
Reviewed-on: https://go-review.googlesource.com/12760
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: fix definitions of getpid and kill on Solaris
Ian Lance Taylor [Tue, 28 Jul 2015 06:09:16 +0000 (23:09 -0700)]
runtime: fix definitions of getpid and kill on Solaris

A further attempt to fix raiseproc on Solaris.

Change-Id: I8d8000d6ccd0cd9f029ebe1f211b76ecee230cd0
Reviewed-on: https://go-review.googlesource.com/12771
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: correct implementation of raiseproc on Solaris
Ian Lance Taylor [Mon, 27 Jul 2015 17:41:41 +0000 (10:41 -0700)]
runtime: correct implementation of raiseproc on Solaris

I forgot that the libc raise function only sends the signal to the
current thread.  We need to actually use kill and getpid here, as we
do on other systems.

Change-Id: Iac34af822c93468bf68cab8879db3ee20891caaf
Reviewed-on: https://go-review.googlesource.com/12704
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http: disable new flaky TestTransportCancelBeforeResponseHeaders test
Brad Fitzpatrick [Mon, 27 Jul 2015 22:01:16 +0000 (00:01 +0200)]
net/http: disable new flaky TestTransportCancelBeforeResponseHeaders test

I'll rewrite this later. It's apparently dependent on scheduling order.
The earlier fix in git rev 9d56c181 seems fine, though.

Update #11894

Change-Id: I7c150918af4be079c262a5f2933ef4639cc535ef
Reviewed-on: https://go-review.googlesource.com/12731
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agonet: Set finalDeadline from TestDialParallel to avoid leaked sockets.
Paul Marks [Mon, 27 Jul 2015 21:39:32 +0000 (14:39 -0700)]
net: Set finalDeadline from TestDialParallel to avoid leaked sockets.

I've also changed TestDialSerialAsyncSpuriousConnection for consistency,
although it always computes a finalDeadline of zero.

Note that #11225 is the root cause of the socket leak; this just hides
it from the unit test by restoring the shorter timeout.

Fixes #11878

Change-Id: Ie0037dd3bce6cc81d196765375489f8c61be74c2
Reviewed-on: https://go-review.googlesource.com/12712
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Paul Marks <pmarks@google.com>

9 years agocmd/go: prefer <meta> tags on launchpad.net to the hard-coded logic
Russ Cox [Tue, 14 Jul 2015 06:04:21 +0000 (02:04 -0400)]
cmd/go: prefer <meta> tags on launchpad.net to the hard-coded logic

Fixes #11436.

Change-Id: I5c4455e9b13b478838f23ac31e6343672dfc60af
Reviewed-on: https://go-review.googlesource.com/12143
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: import runtime/cgo into darwin/arm64 tests
David Crawshaw [Mon, 27 Jul 2015 22:02:45 +0000 (18:02 -0400)]
cmd/go: import runtime/cgo into darwin/arm64 tests

Until cl/12721 and cl/12574, all standard library tests included
runtime/cgo on darwin/arm64 by virtue of package os including it. Now
that is no longer true, runtime/cgo needs to be added by the go tool
just as it is for darwin/arm. (This installs the Mach exception
handler used to properly handle EXC_BAD_ACCESS.)

Fixes #11901

Change-Id: I991525f46eca5b0750b93595579ebc0ff10e47eb
Reviewed-on: https://go-review.googlesource.com/12723
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/json: take new decoder code off Decode path completely
Russ Cox [Tue, 28 Jul 2015 02:38:17 +0000 (22:38 -0400)]
encoding/json: take new decoder code off Decode path completely

The new Token API is meant to sit on the side of the Decoder,
so that you only get the new code (and any latent bugs in it)
if you are actively using the Token API.

The unconditional use of dec.peek in dec.tokenPrepareForDecode
violates that intention.

Change tokenPrepareForDecode not to call dec.peek unless needed
(because the Token API has advanced the state).
This restores the old code path behavior, no peeking allowed.

I checked by patching in the new tests from CL 12726 that
this change suffices to "fix" the error handling bug in dec.peek.
Obviously that bug should be fixed too, but the point is that
with this CL, bugs in dec.peek do not affect plain use of Decode
or Unmarshal.

I also checked by putting a panic in dec.peek that the only
tests that now invoke peek are:

TestDecodeInStream
ExampleDecoder_Token
ExampleDecoder_Decode_stream

and those tests all invoke dec.Token directly.

Change-Id: I0b242d0cb54a9c830548644670dc5ab5ccef69f2
Reviewed-on: https://go-review.googlesource.com/12740
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Peter Waldschmidt <peter@waldschmidt.com>
9 years agoencoding/json: fix EOF bug decoding HTTP stream
Peter Waldschmidt [Tue, 28 Jul 2015 01:33:53 +0000 (21:33 -0400)]
encoding/json: fix EOF bug decoding HTTP stream

Fixes bug referenced in this thread on golang-dev:
https://groups.google.com/d/topic/golang-dev/U4LSpMzL82c/discussion

Change-Id: If01a2644863f9e5625dd2f95f9d344bda772e12c
Reviewed-on: https://go-review.googlesource.com/12726
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoall: cleanup usage of dashes in package documentation
Matthew Dempsky [Fri, 24 Jul 2015 21:52:57 +0000 (14:52 -0700)]
all: cleanup usage of dashes in package documentation

Change-Id: I58453f7ed71eaca15dd3f501e4ae88d1fab19908
Reviewed-on: https://go-review.googlesource.com/12683
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet/http: pause briefly after closing Server connection when body remains
Brad Fitzpatrick [Fri, 24 Jul 2015 21:22:26 +0000 (14:22 -0700)]
net/http: pause briefly after closing Server connection when body remains

From https://github.com/golang/go/issues/11745#issuecomment-123555313
this implements option (b), having the server pause slightly after
sending the final response on a TCP connection when we're about to close
it when we know there's a request body outstanding. This biases the
client (which might not be Go) to prefer our response header over the
request body write error.

Updates #11745

Change-Id: I07cb0b74519d266c8049d9e0eb23a61304eedbf8
Reviewed-on: https://go-review.googlesource.com/12658
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoruntime/cgo: remove TMPDIR logic for iOS
David Crawshaw [Mon, 27 Jul 2015 20:40:40 +0000 (16:40 -0400)]
runtime/cgo: remove TMPDIR logic for iOS

Seems like the simplest solution for 1.5. All the parts of the test
suite I can run on my current device (for which my exception handler
fix no longer works, apparently) pass without this code. I'll move it
into x/mobile/app.

Fixes #11884

Change-Id: I2da40c8c7b48a4c6970c4d709dd7c148a22e8727
Reviewed-on: https://go-review.googlesource.com/12721
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: close window that hides GC work from concurrent mark
Austin Clements [Mon, 27 Jul 2015 18:35:38 +0000 (14:35 -0400)]
runtime: close window that hides GC work from concurrent mark

Currently we enter mark 2 by first flushing all existing gcWork caches
and then setting gcBlackenPromptly, which disables further gcWork
caching. However, if a worker or assist pulls a work buffer in to its
gcWork cache after that cache has been flushed but before caching is
disabled, that work may remain in that cache until mark termination.
If that work represents a heap bottleneck (e.g., a single pointer that
is the only way to reach a large amount of the heap), this can force
mark termination to do a large amount of work, resulting in a long
STW.

Fix this by reversing the order of these steps: first disable caching,
then flush all existing caches.

Rick Hudson <rlh> did the hard work of tracking this down. This CL
combined with CL 12672 and CL 12646 distills the critical parts of his
fix from CL 12539.

Fixes #11694.

Change-Id: Ib10d0a21e3f6170a80727d0286f9990df049fed2
Reviewed-on: https://go-review.googlesource.com/12688
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agoruntime: enable GC assists ASAP
Austin Clements [Fri, 24 Jul 2015 22:11:36 +0000 (18:11 -0400)]
runtime: enable GC assists ASAP

Currently the GC coordinator enables GC assists at the same time it
enables background mark workers, after the concurrent scan phase is
done. However, this means a rapidly allocating mutator has the entire
scan phase during which to allocate beyond the heap trigger and
potentially beyond the heap goal with no back-pressure from assists.
This prevents the feedback system that's supposed to keep the heap
size under the heap goal from doing its job.

Fix this by enabling mutator assists during the scan phase. This is
safe because the write barrier is already enabled and globally
acknowledged at this point.

There's still a very small window between when the heap size reaches
the heap trigger and when the GC coordinator is able to stop the world
during which the mutator can allocate unabated. This allows *very*
rapidly allocator mutators like TestTraceStress to still occasionally
exceed the heap goal by a small amount (~20 MB at most for
TestTraceStress). However, this seems like a corner case.

Fixes #11677.

Change-Id: I0f80d949ec82341cd31ca1604a626efb7295a819
Reviewed-on: https://go-review.googlesource.com/12674
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: allow GC drain whenever write barrier is enabled
Austin Clements [Fri, 24 Jul 2015 16:33:23 +0000 (12:33 -0400)]
runtime: allow GC drain whenever write barrier is enabled

Currently we hand-code a set of phases when draining is allowed.
However, this set of phases is conservative. The critical invariant is
simply that the write barrier must be enabled if we're draining.

Shortly we're going to enable mutator assists during the scan phase,
which means we may drain during the scan phase. In preparation, this
commit generalizes these assertions to check the fundamental condition
that the write barrier is enabled, rather than checking that we're in
any particular phase.

Change-Id: I0e1bec1ca823d4a697a0831ec4c50f5dd3f2a893
Reviewed-on: https://go-review.googlesource.com/12673
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: don't start workers between mark 1 & 2
Austin Clements [Fri, 24 Jul 2015 21:41:34 +0000 (17:41 -0400)]
runtime: don't start workers between mark 1 & 2

Currently we clear both the mark 1 and mark 2 signals at the beginning
of concurrent mark. If either if these is clear, it acts as a signal
to the scheduler that it should start background workers. However,
this means that in the interim *between* mark 1 and mark 2, the
scheduler basically loops starting up new workers only to have them
return with nothing to do. In addition to harming performance and
delaying mutator work, this approach has a race where workers started
for mark 1 can mistakenly signal mark 2, causing it to complete
prematurely. This approach also interferes with starting assists
earlier to fix #11677.

Fix this by initially setting both mark 1 and mark 2 to "signaled".
The scheduler will not start background mark workers, though assists
can still run. When we're ready to enter mark 1, we clear the mark 1
signal and wait for it. Then, when we're ready to enter mark 2, we
clear the mark 2 signal and wait for it.

This structure also lets us deal cleanly with the situation where all
work is drained *prior* to the mark 2 wait, meaning that there may be
no workers to signal completion. Currently we deal with this using a
racy (and possibly incorrect) check for work in the coordinator itself
to skip the mark 2 wait if there's no work. This change makes the
coordinator unconditionally wait for mark completion and makes the
scheduler itself signal completion by slightly extending the logic it
already has to determine that there's no work and hence no use in
starting a new worker.

This is a prerequisite to fixing the remaining component of #11677,
which will require enabling assists during the scan phase. However, we
don't want to enable background workers until the mark phase because
they will compete with the scan. This change lets us use bgMark1 and
bgMark2 to indicate when it's okay to start background workers
independent of assists.

This is also a prerequisite to fixing #11694. It significantly reduces
the occurrence of long mark termination pauses in #11694 (from 64 out
of 1000 to 2 out of 1000 in one experiment).

Coincidentally, this also reduces the final heap size (and hence run
time) of TestTraceStress from ~100 MB and ~1.9 seconds to ~14 MB and
~0.4 seconds because it significantly shortens concurrent mark
duration.

Rick Hudson <rlh> did the hard work of tracking this down.

Change-Id: I12ea9ee2db9a0ae9d3a90dde4944a75fcf408f4c
Reviewed-on: https://go-review.googlesource.com/12672
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: retry GC assist until debt is paid off
Austin Clements [Wed, 22 Jul 2015 20:55:04 +0000 (16:55 -0400)]
runtime: retry GC assist until debt is paid off

Currently, there are three ways to satisfy a GC assist: 1) the mutator
steals credit from background GC, 2) the mutator actually does GC
work, and 3) there is no more work available. 3 was never really
intended as a way to satisfy an assist, and it causes problems: there
are periods when it's expected that the GC won't have any work, such
as when transitioning from mark 1 to mark 2 and from mark 2 to mark
termination. During these periods, there's no back-pressure on rapidly
allocating mutators, which lets them race ahead of the heap goal.

For example, test/init1.go and the runtime/trace test both have small
reachable heaps and contain loops that rapidly allocate large garbage
byte slices. This bug lets these tests exceed the heap goal by several
orders of magnitude.

Fix this by forcing the assist (and hence the allocation) to block
until it can satisfy its debt via either 1 or 2, or the GC cycle
terminates.

This fixes one the causes of #11677. It's still possible to overshoot
the GC heap goal, but with this change the overshoot is almost exactly
by the amount of allocation that happens during the concurrent scan
phase, between when the heap passes the GC trigger and when the GC
enables assists.

Change-Id: I5ef4edcb0d2e13a1e432e66e8245f2bd9f8995be
Reviewed-on: https://go-review.googlesource.com/12671
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: yield to GC coordinator after assist completion
Austin Clements [Thu, 23 Jul 2015 21:55:01 +0000 (17:55 -0400)]
runtime: yield to GC coordinator after assist completion

Currently it's possible for the GC assist to signal completion of the
mark phase, which puts the GC coordinator goroutine on the current P's
run queue, and then return to mutator code that delays until the next
forced preemption before actually yielding control to the GC
coordinator, dragging out completion of the mark phase. This delay can
be further exacerbated if the mutator makes other goroutines runnable
before yielding control, since this will push the GC coordinator on
the back of the P's run queue.

To fix this, this adds a Gosched to the assist if it completed the
mark phase. This immediately and directly yields control to the GC
coordinator. This already happens implicitly in the background mark
workers because they park immediately after completing the mark.

This is one of the reasons completion of the mark phase is being
dragged out and allowing the mutator to allocate without assisting,
leading to the large heap goal overshoot in issue #11677. This is also
a prerequisite to making the assist block when it can't pay off its
debt.

Change-Id: I586adfbecb3ca042a37966752c1dc757f5c7fc78
Reviewed-on: https://go-review.googlesource.com/12670
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: disallow GC assists in non-preemptible contexts
Austin Clements [Wed, 22 Jul 2015 19:14:54 +0000 (15:14 -0400)]
runtime: disallow GC assists in non-preemptible contexts

Currently it's possible to perform GC work on a system stack or when
locks are held if there's an allocation that triggers an assist. This
is generally a bad idea because of the fragility of these contexts,
and it's incompatible with two changes we're about to make: one is to
yield after signaling mark completion (which we can't do from a
non-preemptible context) and the other is to make assists block if
there's no other way for them to pay off the assist debt.

This commit simply skips the assist if it's called from a
non-preemptible context. The allocation will still count toward the
assist debt, so it will be paid off by a later assist. There should be
little allocation from non-preemptible contexts, so this shouldn't
harm the overall assist mechanism.

Change-Id: I7bf0e6c73e659fe6b52f27437abf39d76b245c79
Reviewed-on: https://go-review.googlesource.com/12649
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: make notetsleep_internal nowritebarrier
Austin Clements [Fri, 24 Jul 2015 19:38:16 +0000 (15:38 -0400)]
runtime: make notetsleep_internal nowritebarrier

When notetsleep_internal is called from notetsleepg, notetsleepg has
just given up the P, so write barriers are not allowed in
notetsleep_internal.

Change-Id: I1b214fa388b1ea05b8ce2dcfe1c0074c0a3c8870
Reviewed-on: https://go-review.googlesource.com/12647
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix mark 2 completion in fractional/idle workers
Austin Clements [Fri, 24 Jul 2015 20:38:19 +0000 (16:38 -0400)]
runtime: fix mark 2 completion in fractional/idle workers

Currently fractional and idle mark workers dispose of their gcWork
cache during mark 2 after incrementing work.nwait and after checking
whether there are any workers or any work available. This creates a
window for two races:

1) If the only remaining work is in this worker's gcWork cache, it
   will see that there are no more workers and no more work on the
   global lists (since it has not yet flushed its own cache) and
   prematurely signal mark 2 completion.

2) After this worker has incremented work.nwait but before it has
   flushed its cache, another worker may observe that there are no
   more workers and no more work and prematurely signal mark 2
   completion.

We can fix both of these by simply moving the cache flush above the
increment of nwait and the test of the completion condition.

This is probably contributing to #11694, though this alone is not
enough to fix it.

Change-Id: Idcf9656e5c460c5ea0d23c19c6c51e951f7716c3
Reviewed-on: https://go-review.googlesource.com/12646
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: steal the correct amount of GC assist credit
Austin Clements [Wed, 22 Jul 2015 20:40:50 +0000 (16:40 -0400)]
runtime: steal the correct amount of GC assist credit

GC assists are supposed to steal at most the amount of background GC
credit available so that background GC credit doesn't go negative.
However, they are instead stealing the *total* amount of their debt
but only claiming up to the amount of credit that was available. This
results in draining the background GC credit pool too quickly, which
results in unnecessary assist work.

The fix is trivial: steal the amount of work we meant to steal (which
is already computed).

Change-Id: I837fe60ed515ba91c6baf363248069734a7895ef
Reviewed-on: https://go-review.googlesource.com/12643
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: run misc/cgo/testsovar on darwin and netbsd
Ian Lance Taylor [Mon, 27 Jul 2015 17:30:26 +0000 (10:30 -0700)]
cmd/dist: run misc/cgo/testsovar on darwin and netbsd

CL https://golang.org/cl/12470 has reportedly fixed the problems that
the misc/cgo/testsovar test encountered on darwin and netbsd.  Let's
actually run the test.

Update #10360.
Update #11654.

Change-Id: I4cdd27a8ec8713620e0135780a03f63cfcc538d0
Reviewed-on: https://go-review.googlesource.com/12702
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoencoding/xml: fix race using finfo.parents in s.trim
Russ Cox [Mon, 27 Jul 2015 17:52:04 +0000 (13:52 -0400)]
encoding/xml: fix race using finfo.parents in s.trim

This race was identified in #9796, but a sequence of fixes
proposed in golang.org/cl/4152 were rolled into
golang.org/cl/5910 which both fixed the race and
modified the name space behavior.

We rolled back the name space changes and lost the race fix.

Fix the race separate from the name space changes,
following the suggestion made by Roger Peppe in
https://go-review.googlesource.com/#/c/4152/7/src/encoding/xml/marshal.go@897

Fixes #9796.
Fixes #11885.

Change-Id: Ib2b68982da83dee9e04db8b8465a8295259bba46
Reviewed-on: https://go-review.googlesource.com/12687
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

9 years agogo/internal/gcimporter: only run compile test if go tool is available
Ian Lance Taylor [Mon, 27 Jul 2015 17:34:11 +0000 (10:34 -0700)]
go/internal/gcimporter: only run compile test if go tool is available

Fixes build dashboard failures for android and nacl.

Change-Id: Id13896570061d3d8186f7b666ca1c37bcc789b0f
Reviewed-on: https://go-review.googlesource.com/12703
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: document gctrace format
Austin Clements [Tue, 21 Jul 2015 15:45:55 +0000 (11:45 -0400)]
runtime: document gctrace format

Fixes #10348.

Change-Id: I3eea9738e3f6fdc1998d04a601dc9b556dd2db72
Reviewed-on: https://go-review.googlesource.com/12453
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: always report starting heap size in gctrace
Austin Clements [Tue, 21 Jul 2015 15:38:14 +0000 (11:38 -0400)]
runtime: always report starting heap size in gctrace

Currently the gctrace output reports the trigger heap size, rather
than the actual heap size at the beginning of GC. Often these are the
same, or at least very close. However, it's possible for the heap to
already have exceeded this trigger when we first check the trigger and
start GC; in this case, this output is very misleading. We've
encountered this confusion a few times when debugging and this
behavior is difficult to document succinctly.

Change the gctrace output to report the actual heap size when GC
starts, rather than the trigger.

Change-Id: I246b3ccae4c4c7ea44c012e70d24a46878d7601f
Reviewed-on: https://go-review.googlesource.com/12452
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: remove # from gctrace line
Austin Clements [Mon, 20 Jul 2015 19:48:53 +0000 (15:48 -0400)]
runtime: remove # from gctrace line

Whenever someone pastes gctrace output into GitHub, it helpfully turns
the GC cycle number into a link to some unrelated issue. Prevent this
by removing the pound before the cycle number. The fact that this is a
cycle number is probably more obvious at a glance than most of the
other numbers.

Change-Id: Ifa5fc7fe6c715eac50e639f25bc36c81a132ffea
Reviewed-on: https://go-review.googlesource.com/12413
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: do not panic on template I/O error
Russ Cox [Thu, 23 Jul 2015 15:41:35 +0000 (11:41 -0400)]
cmd/go: do not panic on template I/O error

Fixes #11839.

Change-Id: Ie092a3a512a2d35967364b41081a066ab3a6aab4
Reviewed-on: https://go-review.googlesource.com/12571
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: use hg repo for code.google.com shutdown check
Russ Cox [Thu, 23 Jul 2015 06:19:57 +0000 (02:19 -0400)]
cmd/go: use hg repo for code.google.com shutdown check

svn dies due to not being able to validate the googlecode.com certificate.
hg does not even attempt to validate it.

Fixes #11806.

Change-Id: I84ced5aa84bb1e4a4cdb2254f2d08a64a1ef23f6
Reviewed-on: https://go-review.googlesource.com/12558
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: fix custom import path wildcards (go get rsc.io/pdf/...)
Russ Cox [Thu, 23 Jul 2015 06:04:01 +0000 (02:04 -0400)]
cmd/go: fix custom import path wildcards (go get rsc.io/pdf/...)

Fixes TestGoGetWorksWithVanityWildcards,
but that test uses the network and is not run
on the builders.

For #11806.

Change-Id: I35c6677deaf84e2fa9bdb98b62d80d388b5248ae
Reviewed-on: https://go-review.googlesource.com/12557
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: log all thread stack traces during GODEBUG=crash on Unix
Ian Lance Taylor [Fri, 24 Jul 2015 23:16:39 +0000 (16:16 -0700)]
runtime: log all thread stack traces during GODEBUG=crash on Unix

This extends https://golang.org/cl/2811, which only applied to Darwin
and GNU/Linux, to all Unix systems.

Fixes #9591.

Change-Id: Iec3fb438564ba2924b15b447c0480f87c0bfd009
Reviewed-on: https://go-review.googlesource.com/12661
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>