]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years ago[release-branch.go1.4] syscall: fix the deprecated way of parsing routing message...
Mikio Hara [Mon, 22 Dec 2014 03:30:16 +0000 (12:30 +0900)]
[release-branch.go1.4] syscall: fix the deprecated way of parsing routing message on openbsd

OpenBSD 5.5 changed its kernel ABI and OpenBSD 5.6 enabled it.
This CL works on both 5.5 and 5.6.

Fixes #9102.

Change-Id: I4a295be9ab8acbc99e550d8cb7e8f8dacf3a03c5
Reviewed-on: https://go-review.googlesource.com/1932
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 13e16b39fc269fcba3383bd6c133da3e0e0345e9)
Reviewed-on: https://go-review.googlesource.com/2826
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years ago[release-branch.go1.4] runtime: fix nacl build, hashmap overflow field offset was...
Keith Randall [Mon, 22 Dec 2014 23:24:30 +0000 (15:24 -0800)]
[release-branch.go1.4] runtime: fix nacl build, hashmap overflow field offset was incorrect.

Change-Id: Ieb305b2a4d4ef28d70a8b8ece703f495c5af0529
Reviewed-on: https://go-review.googlesource.com/2051
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit c6669e7af58cb9406226c038b1cadef6e754dc74)
Reviewed-on: https://go-review.googlesource.com/2820
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years ago[release-branch.go1.4] cmd/go: adjust error for custom import checkout mismatch
Russ Cox [Wed, 14 Jan 2015 06:23:26 +0000 (01:23 -0500)]
[release-branch.go1.4] cmd/go: adjust error for custom import checkout mismatch

Before:

...
imports golang.org/x/net/context: /Users/rsc/g/src/golang.org/x/net is from https://code.google.com/p/go.net, should be from https://go.googlesource.com/net

After:

...
imports golang.org/x/net/context: golang.org/x/net is a custom import path for https://go.googlesource.com/net, but /Users/rsc/g/src/golang.org/x/net is checked out from https://code.google.com/p/go.net

Change-Id: I93c35b85f955c7de684f71fbd4baecc717405318
Reviewed-on: https://go-review.googlesource.com/2808
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
(cherry picked from commit b8d67596f67ea13525e752a02f45c9d9f346472d)
Reviewed-on: https://go-review.googlesource.com/2813
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years ago[release-branch.go1.4] runtime: fix deadlock in runtime.Stack
Keith Randall [Mon, 15 Dec 2014 22:39:28 +0000 (14:39 -0800)]
[release-branch.go1.4] runtime: fix deadlock in runtime.Stack

It shouldn't semacquire() inside an acquirem(), the runtime
thinks that means deadlock.  It actually isn't a deadlock, but it
looks like it because acquirem() does m.locks++.

Candidate for inclusion in 1.4.1.  runtime.Stack with all=true
is pretty unuseable in GOMAXPROCS>1 environment.

fixes #9321

Change-Id: Iac6b664217d24763b9878c20e49229a1ecffc805
Reviewed-on: https://go-review.googlesource.com/1600
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
(cherry picked from commit 50bc3d5bbc6710663c082aa72c8ba4f9ee515ab3)
Reviewed-on: https://go-review.googlesource.com/2807
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] runtime: fix SIGPROF change
Russ Cox [Wed, 14 Jan 2015 05:54:50 +0000 (00:54 -0500)]
[release-branch.go1.4] runtime: fix SIGPROF change

CL 2789 backported a change that required a barrage of followup CLs.
This CL backports all the followup CLs together.

There are manual edits to os_plan9.go and syscall_windows.go to take
the place of edits to defs_windows_{amd64,386}.go and os2_plan9.go
in the original. Those files do not exist in the release branch, but the
definition being added must go somewhere.

Original change descriptions below.

---

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>
(cherry picked from commit 77cd6197d7561ab7ccbf5d892efb6f97d929546a)

---

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>
(cherry picked from commit 1f282385579fc404f1246fd7ffa8b4e517401d19)

---

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>
(cherry picked from commit 0b2a74e89cf940e1c4cd91785ff3d744684edc49)

---

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>
(cherry picked from commit 2cbe27a27202dca5a643b75c79e25d4cccc3ae67)

---

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>
(cherry picked from commit 865e5e98b685eb3a7888f5263021049c0694d16f)

---

runtime: remove unnecessary GOOS switch

Change-Id: I8f518e273c02110042b08f7c50c3d38a648c8b6e
Reviewed-on: https://go-review.googlesource.com/2281
Reviewed-by: Minux Ma <minux@golang.org>
(cherry picked from commit 1ebfb082a7a5cc31efd572fd88549048a82a5c1c)

---

Change-Id: Ifee9667ca90eda2b074817c319b1b7c66d4f741d
Reviewed-on: https://go-review.googlesource.com/2805
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] all: copy master .gitattributes and .gitignore
Russ Cox [Wed, 14 Jan 2015 06:03:53 +0000 (01:03 -0500)]
[release-branch.go1.4] all: copy master .gitattributes and .gitignore

Change-Id: I10e60fb6bf2cf3daa2bc1184df7ded0a712a1905
Reviewed-on: https://go-review.googlesource.com/2806
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] cmd/ld: put .bss from external objects into real .bss section
Shenghou Ma [Sun, 21 Dec 2014 07:48:01 +0000 (02:48 -0500)]
[release-branch.go1.4] 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>
(cherry picked from commit 1c0c611fc2a7e1ce7eb39626ca7b120b62aac557)
Reviewed-on: https://go-review.googlesource.com/2802
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] runtime: hashmap: move overflow pointer to end of bucket
Keith Randall [Sat, 20 Dec 2014 04:44:18 +0000 (20:44 -0800)]
[release-branch.go1.4] runtime: hashmap: move overflow pointer to end of bucket

Pointers to zero-sized values may end up pointing to the next
object in memory, and possibly off the end of a span.  This
can cause memory leaks and/or confuse the garbage collector.

By putting the overflow pointer at the end of the bucket, we
make sure that pointers to any zero-sized keys or values don't
accidentally point to the next object in memory.

fixes #9384

Change-Id: I5d434df176984cb0210b4d0195dd106d6eb28f73
Reviewed-on: https://go-review.googlesource.com/1869
Reviewed-by: Russ Cox <rsc@golang.org>
(cherry picked from commit fbc56cf05015899aba236d5a68096a770de3ad0a)
Reviewed-on: https://go-review.googlesource.com/2801
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] reflect: add kindNoPointers if a function layout has no pointers.
Keith Randall [Tue, 23 Dec 2014 03:07:05 +0000 (19:07 -0800)]
[release-branch.go1.4] reflect: add kindNoPointers if a function layout has no pointers.

malloc checks kindNoPointers and if it is not set and the object
is one pointer in size, it assumes it contains a pointer.  So we
must set kindNoPointers correctly; it isn't just a hint.

Fixes #9425

Change-Id: Ia43da23cc3298d6e3d6dbdf66d32e9678f0aedcf
Reviewed-on: https://go-review.googlesource.com/2055
Reviewed-by: Russ Cox <rsc@golang.org>
(cherry picked from commit d11f41118116e0b5c2fb3b3296323d888dff2d6e)
Reviewed-on: https://go-review.googlesource.com/2800
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] runtime: ignore SIGPROF to foreign threads before cgocallback...
Shenghou Ma [Sun, 28 Dec 2014 00:15:38 +0000 (19:15 -0500)]
[release-branch.go1.4] 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>
(cherry picked from commit 5da9c8cd0a0427d1771b3a9a6d8d931430ce50dd)
Reviewed-on: https://go-review.googlesource.com/2789
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[release-branch.go1.4] doc: copy contribute.html and install-source.html from master
Russ Cox [Wed, 14 Jan 2015 04:57:27 +0000 (23:57 -0500)]
[release-branch.go1.4] doc: copy contribute.html and install-source.html from master

This incorporates the various git-related updates that have
happened since the Go 1.4 release. Since Go 1.4.1 will be issued
from Git, it is appropriate to replace the Mercurial instructions
with Git instructions.

Change-Id: Idec041002c7f325c4eee6f25c50423b088b11468
Reviewed-on: https://go-review.googlesource.com/2788
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agocmd/dist: convert dist from Hg to Git.
David Symonds [Mon, 8 Dec 2014 02:53:11 +0000 (13:53 +1100)]
cmd/dist: convert dist from Hg to Git.

Change-Id: Ic25d46df6a79c4a18ed3f0a7e900591a115e48e3
Reviewed-on: https://go-review.googlesource.com/1403
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agogo1.4 go1.4
Andrew Gerrand [Thu, 11 Dec 2014 00:27:56 +0000 (11:27 +1100)]
go1.4

LGTM=bradfitz, minux, dsymonds
R=rsc, bradfitz, iant, dsymonds, minux
CC=golang-codereviews
https://golang.org/cl/188920043

10 years agodoc: tweak Go 1.4 release notes
Andrew Gerrand [Thu, 11 Dec 2014 00:22:54 +0000 (11:22 +1100)]
doc: tweak Go 1.4 release notes

LGTM=dave, dsymonds
R=golang-codereviews, dave, dsymonds
CC=golang-codereviews
https://golang.org/cl/184350043

10 years agodoc: document go1.4
Andrew Gerrand [Wed, 10 Dec 2014 22:16:41 +0000 (09:16 +1100)]
doc: document go1.4

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/189810043

10 years agodoc: remove TODO from go1.4 release notes
Andrew Gerrand [Wed, 10 Dec 2014 22:11:08 +0000 (09:11 +1100)]
doc: remove TODO from go1.4 release notes

LGTM=bradfitz
R=iant, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/191750043

10 years agomisc/makerelease: handle git sub-repositories
Andrew Gerrand [Wed, 10 Dec 2014 02:04:06 +0000 (13:04 +1100)]
misc/makerelease: handle git sub-repositories

Also: checkout sub-repos from Mercurial manually
instead of using "go get". (for the 1.4 release)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/190720043

10 years ago[release-branch.go1.4] api: create go1.4.txt
Russ Cox [Wed, 10 Dec 2014 00:07:40 +0000 (11:07 +1100)]
[release-branch.go1.4] api: create go1.4.txt

I read through and vetted these but others should look too.

LGTM=bradfitz, adg
R=r, minux, bradfitz, adg
CC=adg, golang-codereviews, gri, iant
https://golang.org/cl/182560043

10 years ago[release-branch.go1.4] [release-branch.go1.4] doc: scrub references to code.google.com
Andrew Gerrand [Wed, 10 Dec 2014 00:01:55 +0000 (11:01 +1100)]
[release-branch.go1.4] [release-branch.go1.4] doc: scrub references to code.google.com

These are the references that affect current Go users.
I left intact references in older release notes;
we can figure out what to do with them later.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/186140043

10 years ago[release-branch.go1.4] [release-branch.go1.4] doc: update contribution guidelines
Andrew Gerrand [Tue, 9 Dec 2014 22:29:35 +0000 (09:29 +1100)]
[release-branch.go1.4] [release-branch.go1.4] doc: update contribution guidelines

LGTM=minux, adg, rsc
R=rsc, r, dsymonds, minux, bradfitz, adg, dave, iant
CC=golang-codereviews
https://golang.org/cl/185190043

10 years ago[release-branch.go1.4] [release-branch.go1.4] misc/cgo/test: skip test8694 on ARM.
Andrew Gerrand [Tue, 9 Dec 2014 22:13:58 +0000 (09:13 +1100)]
[release-branch.go1.4] [release-branch.go1.4] misc/cgo/test: skip test8694 on ARM.

««« CL 185130043 / 586738173884
misc/cgo/test: skip test8694 on ARM.

LGTM=dave, bradfitz, rsc
R=golang-codereviews, dave, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/185130043

»»»

LGTM=minux
R=golang-codereviews, minux, bradfitz
CC=golang-codereviews
https://golang.org/cl/188870043

10 years ago[release-branch.go1.4] cmd/go: document import path checking
Russ Cox [Tue, 9 Dec 2014 03:25:51 +0000 (22:25 -0500)]
[release-branch.go1.4] cmd/go: document import path checking

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/189760043

10 years ago[release-branch.go1.4] [release-branch.go1.4] encoding/xml: remove SyntaxError.Byte
Russ Cox [Sat, 6 Dec 2014 03:19:13 +0000 (22:19 -0500)]
[release-branch.go1.4] [release-branch.go1.4] encoding/xml: remove SyntaxError.Byte

««« CL 182580043 / 2d1ab17a670a
encoding/xml: remove SyntaxError.Byte

It is unused. It was introduced in the CL that added InputOffset.
I suspect it was an editing mistake.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/182580043
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/180630043

10 years ago[release-branch.go1.4] codereview: add release-branch.go1.4 prefix, like for dev...
Russ Cox [Fri, 5 Dec 2014 20:27:48 +0000 (15:27 -0500)]
[release-branch.go1.4] codereview: add release-branch.go1.4 prefix, like for dev branches

TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/178710043

10 years ago[release-branch.go1.4] cmd/api: make API check fail for undeclared API in release...
Russ Cox [Fri, 5 Dec 2014 19:04:17 +0000 (14:04 -0500)]
[release-branch.go1.4] cmd/api: make API check fail for undeclared API in release branch

We forgot to do the usual API review.
Make that not possible in the future.
I'll pull this change over to the main
branch too, but it's more important
(and only testable) here.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/185050043

10 years agocodereview: release-branch.go1.4 is now a work branch
Russ Cox [Fri, 5 Dec 2014 19:02:51 +0000 (14:02 -0500)]
codereview: release-branch.go1.4 is now a work branch

(That is, changes can originate in the branch.
The main branch has diverged enough that this
may be necessary.)

LGTM=bradfitz
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/187810043

10 years ago[release-branch.go1.4] cmd/go: fix build
Russ Cox [Fri, 5 Dec 2014 04:43:01 +0000 (23:43 -0500)]
[release-branch.go1.4] cmd/go: fix build

««« CL 182480043 / 8d42099cdc23
cmd/go: fix build
The new semantics of split require the newline be present.
The test was stale.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/182480043
»»»

TBR=r
CC=golang-codereviews
https://golang.org/cl/178690043

10 years ago[release-branch.go1.4] cmd/go: avoid use of bufio.Scanner in generate
Russ Cox [Fri, 5 Dec 2014 04:42:16 +0000 (23:42 -0500)]
[release-branch.go1.4] cmd/go: avoid use of bufio.Scanner in generate

««« CL 182970043 / 573a7b5178c4
cmd/go: avoid use of bufio.Scanner in generate

Scanner can't handle stupid long lines and there are
reports of stupid long lines in production.

Note the issue isn't long "//go:generate" lines, but
any long line in any Go source file.

To be fair, if you're going to have a stupid long line
it's not a bad bet you'll want to run it through go
generate, because it's some embeddable asset that
has been machine generated. (One could ask why
that generation process didn't add a newline or two,
but we should cope anyway.)

Rewrite the file scanner in "go generate" so it can
handle arbitrarily long lines, and only stores in memory
those lines that start "//go:generate".

Also: Adjust the documentation to make clear that it
does not parse the file.

Fixes #9143.
Fixes #9196.

LGTM=rsc, dominik.honnef
R=rsc, cespare, minux, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/182970043
»»»

TBR=r
CC=golang-codereviews
https://golang.org/cl/183060044

10 years ago[release-branch.go1.4] cmd/pprof/internal/commands: add command to open browser on...
Russ Cox [Thu, 4 Dec 2014 16:25:25 +0000 (11:25 -0500)]
[release-branch.go1.4] cmd/pprof/internal/commands: add command to open browser on windows

««« CL 180380043 / d56c648b069f
cmd/pprof/internal/commands: add command to open browser on windows

While we're at there, also add a message to prompt the user to install
Graphviz if "dot" command is not found.

Fixes #9178.

LGTM=adg, alex.brainman, cookieo9, rsc
R=rsc, adg, bradfitz, alex.brainman, cookieo9, smyrman
CC=golang-codereviews
https://golang.org/cl/180380043

»»»

TBR=minux
CC=golang-codereviews
https://golang.org/cl/186760043

10 years ago[release-branch.go1.4] lib/time: update to ICANN time zone database 2014j
Andrew Gerrand [Thu, 4 Dec 2014 04:32:30 +0000 (15:32 +1100)]
[release-branch.go1.4] lib/time: update to ICANN time zone database 2014j

««« CL 178660043 / ac865d86fc2a
lib/time: update to ICANN time zone database 2014j

Fixes #9189.

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=golang-codereviews
https://golang.org/cl/178660043
»»»

LGTM=minux, dsymonds
R=dsymonds, r, minux
CC=golang-codereviews
https://golang.org/cl/182460043

10 years ago[release-branch.go1.4] cmd/pprof: fix symbol resolution for remote profiles
Russ Cox [Wed, 3 Dec 2014 19:14:50 +0000 (14:14 -0500)]
[release-branch.go1.4] cmd/pprof: fix symbol resolution for remote profiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes #9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043

10 years ago[release-branch.go1.4] cmd/go: regenerate doc.go
Andrew Gerrand [Tue, 2 Dec 2014 23:50:28 +0000 (10:50 +1100)]
[release-branch.go1.4] cmd/go: regenerate doc.go

««« CL 183000043 / 871468f5ceaf
cmd/go: regenerate doc.go

Move change from CL 170770043 to correct file and regenerate docs
for changes from CL 164120043.

LGTM=adg
R=golang-codereviews, adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/183000043

»»»

LGTM=minux
R=bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/181490043

10 years agogo1.4rc2 go1.4rc2
Andrew Gerrand [Tue, 2 Dec 2014 02:43:43 +0000 (13:43 +1100)]
go1.4rc2

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/179700043

10 years ago[release-branch.go1.4] runtime: fix hang in GC due to shrinkstack vs netpoll race
Russ Cox [Mon, 1 Dec 2014 21:42:41 +0000 (16:42 -0500)]
[release-branch.go1.4] runtime: fix hang in GC due to shrinkstack vs netpoll race

««« CL 179680043 / 752cd9199639
runtime: fix hang in GC due to shrinkstack vs netpoll race

During garbage collection, after scanning a stack, we think about
shrinking it to reclaim some memory. The shrinking code (called
while the world is stopped) checked that the status was Gwaiting
or Grunnable and then changed the state to Gcopystack, to essentially
lock the stack so that no other GC thread is scanning it.
The same locking happens for stack growth (and is more necessary there).

        oldstatus = runtime·readgstatus(gp);
        oldstatus &= ~Gscan;
        if(oldstatus == Gwaiting || oldstatus == Grunnable)
                runtime·casgstatus(gp, oldstatus, Gcopystack); // oldstatus is Gwaiting or Grunnable
        else
                runtime·throw("copystack: bad status, not Gwaiting or Grunnable");

Unfortunately, "stop the world" doesn't stop everything. It stops all
normal goroutine execution, but the network polling thread is still
blocked in epoll and may wake up. If it does, and it chooses a goroutine
to mark runnable, and that goroutine is the one whose stack is shrinking,
then it can happen that between readgstatus and casgstatus, the status
changes from Gwaiting to Grunnable.

casgstatus assumes that if the status is not what is expected, it is a
transient change (like from Gwaiting to Gscanwaiting and back, or like
from Gwaiting to Gcopystack and back), and it loops until the status
has been restored to the expected value. In this case, the status has
changed semi-permanently from Gwaiting to Grunnable - it won't
change again until the GC is done and the world can continue, but the
GC is waiting for the status to change back. This wedges the program.

To fix, call a special variant of casgstatus that accepts either Gwaiting
or Grunnable as valid statuses.

Without the fix bug with the extra check+throw in casgstatus, the
program below dies in a few seconds (2-10) with GOMAXPROCS=8
on a 2012 Retina MacBook Pro. With the fix, it runs for minutes
and minutes.

package main

import (
        "io"
        "log"
        "net"
        "runtime"
)

func main() {
        const N = 100
        for i := 0; i < N; i++ {
                l, err := net.Listen("tcp", "127.0.0.1:0")
                if err != nil {
                        log.Fatal(err)
                }
                ch := make(chan net.Conn, 1)
                go func() {
                        var err error
                        c1, err := net.Dial("tcp", l.Addr().String())
                        if err != nil {
                                log.Fatal(err)
                        }
                        ch <- c1
                }()
                c2, err := l.Accept()
                if err != nil {
                        log.Fatal(err)
                }
                c1 := <-ch
                l.Close()
                go netguy(c1, c2)
                go netguy(c2, c1)
                c1.Write(make([]byte, 100))
        }
        for {
                runtime.GC()
        }
}

func netguy(r, w net.Conn) {
        buf := make([]byte, 100)
        for {
                bigstack(1000)
                _, err := io.ReadFull(r, buf)
                if err != nil {
                        log.Fatal(err)
                }
                w.Write(buf)
        }
}

var g int

func bigstack(n int) {
        var buf [100]byte
        if n > 0 {
                bigstack(n - 1)
        }
        g = int(buf[0]) + int(buf[99])
}

Fixes #9186.

LGTM=rlh
R=austin, rlh
CC=dvyukov, golang-codereviews, iant, khr, r
https://golang.org/cl/179680043
»»»

TBR=rlh
CC=golang-codereviews
https://golang.org/cl/184030043

10 years ago[release-branch.go1.4] reflect: Fix reflect.funcLayout. The GC bitmap has two bits per
Russ Cox [Mon, 1 Dec 2014 16:18:47 +0000 (11:18 -0500)]
[release-branch.go1.4] reflect: Fix reflect.funcLayout.  The GC bitmap has two bits per

««« CL 182160043 / 321d04dea9d6
reflect: Fix reflect.funcLayout.  The GC bitmap has two bits per
pointer, not one.

Fixes #9179

LGTM=iant, rsc
R=golang-codereviews, iant, rsc
CC=golang-codereviews
https://golang.org/cl/182160043
»»»

TBR=khr
CC=golang-codereviews
https://golang.org/cl/180440044

10 years ago[release-branch.go1.4] doc: tidy up "Projects" page; add Go 1.4
Andrew Gerrand [Tue, 25 Nov 2014 20:57:03 +0000 (07:57 +1100)]
[release-branch.go1.4] doc: tidy up "Projects" page; add Go 1.4

««« CL 182750043 / ffe33f1f1f17
doc: tidy up "Projects" page; add Go 1.4

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/182750043
»»»

TBR=r
CC=golang-codereviews
https://golang.org/cl/176350043

10 years ago[release-branch.go1.4] go/build: build $GOOS_test.go always
Russ Cox [Tue, 25 Nov 2014 03:00:01 +0000 (22:00 -0500)]
[release-branch.go1.4] go/build: build $GOOS_test.go always

««« CL 176290043 / 8025b7d1e6c9
go/build: build $GOOS_test.go always

We decided to build $GOOS.go always
but forgot to test $GOOS_test.go.

Fixes #9159.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/176290043
»»»

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/182740043

10 years ago[release-branch.go1.4] image/jpeg: handle Read returning n > 0, err != nil in d.fill
Russ Cox [Sun, 23 Nov 2014 16:15:26 +0000 (11:15 -0500)]
[release-branch.go1.4] image/jpeg: handle Read returning n > 0, err != nil in d.fill

««« CL 178120043 / 95f5614b4648
image/jpeg: handle Read returning n > 0, err != nil in d.fill

Fixes #9127.

LGTM=r
R=bradfitz, r
CC=golang-codereviews, nigeltao
https://golang.org/cl/178120043
»»»

TBR=r
CC=golang-codereviews
https://golang.org/cl/181870043

10 years ago[release-branch.go1.4] cmd/go: fix running pprof on windows.
Russ Cox [Sat, 22 Nov 2014 18:38:29 +0000 (13:38 -0500)]
[release-branch.go1.4] cmd/go: fix running pprof on windows.

««« CL 176170043 / 61bbf19823d5
cmd/go: fix running pprof on windows.

Fixes #9149.

LGTM=alex.brainman, rsc
R=rsc, dave, alex.brainman
CC=golang-codereviews
https://golang.org/cl/176170043

»»»

TBR=minux
CC=golang-codereviews
https://golang.org/cl/175550043

10 years ago[release-branch.go1.4] runtime: fix atomic operations on non-heap addresses
Russ Cox [Thu, 20 Nov 2014 15:14:49 +0000 (10:14 -0500)]
[release-branch.go1.4] runtime: fix atomic operations on non-heap addresses

««« CL 179030043 / e4ab8f908aac
runtime: fix atomic operations on non-heap addresses
Race detector runtime does not tolerate operations on addresses
that was not previously declared with __tsan_map_shadow
(namely, data, bss and heap). The corresponding address
checks for atomic operations were removed in
https://golang.org/cl/111310044
Restore these checks.
It's tricker than just not calling into race runtime,
because it is the race runtime that makes the atomic
operations themselves (if we do not call into race runtime
we skip the atomic operation itself as well). So instead we call
__tsan_go_ignore_sync_start/end around the atomic operation.
This forces race runtime to skip all other processing
except than doing the atomic operation itself.
Fixes #9136.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/179030043

»»»

TBR=dvyukov
CC=golang-codereviews
https://golang.org/cl/180030043

10 years ago[release-branch.go1.4] build: disable race external linking test on OS X 10.6 and...
Russ Cox [Thu, 20 Nov 2014 02:25:07 +0000 (21:25 -0500)]
[release-branch.go1.4] build: disable race external linking test on OS X 10.6 and earlier

««« CL 176070043 / 500cb52e08e6
build: disable race external linking test on OS X 10.6 and earlier

External linking doesn't work there at all.

LGTM=bradfitz
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/176070043
»»»

LGTM=bradfitz, adg
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/175400043

10 years ago[release-branch.go1.4] runtime: remove assumption that noptrdata data bss noptrbss...
Russ Cox [Wed, 19 Nov 2014 20:31:31 +0000 (15:31 -0500)]
[release-branch.go1.4] runtime: remove assumption that noptrdata data bss noptrbss are ordered and contiguous

««« CL 179980043 / d71cc7e8a0e0
runtime: remove assumption that noptrdata data bss noptrbss are ordered and contiguous

The assumption can be violated by external linkers reordering them or
inserting non-Go sections in between them. I looked briefly at trying
to write out the _go_.o in external linking mode in a way that forced
the ordering, but no matter what there's no way to force Go's data
and Go's bss to be next to each other. If there is any data or bss from
non-Go objects, it's very likely to get stuck in between them.

Instead, rewrite the two places we know about that make the assumption.
I grepped for noptrdata to look for more and didn't find any.

The added race test (os/exec in external linking mode) fails without
the changes in the runtime. It crashes with an invalid pointer dereference.

Fixes #9133.

LGTM=dneil
R=dneil
CC=dvyukov, golang-codereviews, iant
https://golang.org/cl/179980043
»»»

LGTM=dneil
R=dneil
CC=golang-codereviews
https://golang.org/cl/173510043

10 years ago[release-branch.go1.4] undo CL 131750044 / 2d6d44ceb80e
Russ Cox [Wed, 19 Nov 2014 19:38:22 +0000 (14:38 -0500)]
[release-branch.go1.4] undo CL 131750044 / 2d6d44ceb80e

««« CL 174450043 / 699cc091a16d
undo CL 131750044 / 2d6d44ceb80e

Breaks reading from stdin in parent after exec with SysProcAttr{Setpgid: true}.

package main

import (
        "fmt"
        "os"
        "os/exec"
        "syscall"
)

func main() {
        cmd := exec.Command("true")
        cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
        cmd.Run()

        fmt.Printf("Hit enter:")
        os.Stdin.Read(make([]byte, 100))
        fmt.Printf("Bye\n")
}

In go1.3, I type enter at the prompt and the program exits.
With the CL being rolled back, the program wedges at the
prompt.

««« original CL description
syscall: SysProcAttr job control changes

Making the child's process group the foreground process group and
placing the child in a specific process group involves co-ordination
between the parent and child that must be done post-fork but pre-exec.

LGTM=iant
R=golang-codereviews, gobot, iant, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/131750044

»»»

LGTM=minux, dneil
R=dneil, minux
CC=golang-codereviews, iant, michael.p.macinnis
https://golang.org/cl/174450043
»»»

LGTM=minux
R=dneil, minux
CC=golang-codereviews
https://golang.org/cl/179970043

10 years ago[release-branch.go1.4] doc/go1.4.html: rewrite first sentence to make it clearer
Andrew Gerrand [Tue, 18 Nov 2014 22:47:56 +0000 (09:47 +1100)]
[release-branch.go1.4] doc/go1.4.html: rewrite first sentence to make it clearer

««« CL 178910043 / 3916b070c5f3
doc/go1.4.html: rewrite first sentence to make it clearer
The grammar was atrocious, probably the victim of an editing error.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/178910043
»»»

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/175310043

10 years ago[release-branch.go1.4] remove cmd/link from nacl test zip go1.4rc1
Andrew Gerrand [Mon, 17 Nov 2014 02:55:59 +0000 (13:55 +1100)]
[release-branch.go1.4] remove cmd/link from nacl test zip

LGTM=dsymonds
R=rsc, dsymonds
CC=golang-codereviews
https://golang.org/cl/179830043

10 years ago[release-branch.go1.4] remove cmd/link
Andrew Gerrand [Mon, 17 Nov 2014 02:46:45 +0000 (13:46 +1100)]
[release-branch.go1.4] remove cmd/link

LGTM=dsymonds, minux
R=rsc, dsymonds, minux
CC=golang-codereviews
https://golang.org/cl/176910043

10 years ago[release-branch.go1.4] debug/goobj: move to cmd/internal/goobj
Andrew Gerrand [Mon, 17 Nov 2014 01:56:35 +0000 (12:56 +1100)]
[release-branch.go1.4] debug/goobj: move to cmd/internal/goobj

««« CL 174250043 / c16349455e05
debug/goobj: move to cmd/internal/goobj

debug/goobj is not ready to be published but it is
needed for the various binary-reading commands.
Move to cmd/internal/goobj.

(The Go 1.3 release branch deleted it, but that's not
an option anymore due to the command dependencies.
The API is still not vetted nor terribly well designed.)

LGTM=adg, dsymonds
R=adg, dsymonds
CC=golang-codereviews
https://golang.org/cl/174250043
»»»

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/177890043

10 years agogo1.4rc1
Andrew Gerrand [Sun, 16 Nov 2014 22:37:04 +0000 (09:37 +1100)]
go1.4rc1

10 years agoruntime: fix sudog leak
Russ Cox [Sun, 16 Nov 2014 21:44:45 +0000 (16:44 -0500)]
runtime: fix sudog leak

The SudoG used to sit on the stack, so it was cheap to allocated
and didn't need to be cleaned up when finished.

For the conversion to Go, we had to move sudog off the stack
for a few reasons, so we added a cache of recently used sudogs
to keep allocation cheap. But we didn't add any of the necessary
cleanup before adding a SudoG to the new cache, and so the cached
SudoGs had stale pointers inside them that have caused all sorts
of awful, hard to debug problems.

CL 155760043 made sure SudoG.elem is cleaned up.
CL 150520043 made sure SudoG.selectdone is cleaned up.

This CL makes sure SudoG.next, SudoG.prev, and SudoG.waitlink
are cleaned up. I should have done this when I did the other two
fields; instead I wasted a week tracking down a leak they caused.

A dangling SudoG.waitlink can point into a sudogcache list that
has been "forgotten" in order to let the GC collect it, but that
dangling .waitlink keeps the list from being collected.
And then the list holding the SudoG with the dangling waitlink
can find itself in the same situation, and so on. We end up
with lists of lists of unusable SudoGs that are still linked into
the object graph and never collected (given the right mix of
non-trivial selects and non-channel synchronization).

More details in golang.org/issue/9110.

Fixes #9110.

LGTM=r
R=r
CC=dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/177870043

10 years agoruntime: update URL for heap dump format
Russ Cox [Sun, 16 Nov 2014 19:25:33 +0000 (14:25 -0500)]
runtime: update URL for heap dump format

I just created that redirect, so we can change
it once the wiki moves.

LGTM=bradfitz, khr
R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/177780043

10 years agoC: add Nick Cooper (Google CLA).
Nigel Tao [Fri, 14 Nov 2014 06:03:17 +0000 (17:03 +1100)]
C: add Nick Cooper (Google CLA).

LGTM=dsymonds
R=dsymonds
CC=golang-codereviews, nmvc
https://golang.org/cl/169580043

10 years agodoc: fix small typo in doc
Yasuhiro Matsumoto [Fri, 14 Nov 2014 03:05:14 +0000 (14:05 +1100)]
doc: fix small typo in doc

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/170660043

10 years agonet/http: add comment to clarify whether Dir is '/' or '\'.
Nigel Tao [Fri, 14 Nov 2014 00:43:01 +0000 (11:43 +1100)]
net/http: add comment to clarify whether Dir is '/' or '\'.

LGTM=bradfitz
R=bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/168600044

10 years agonet/url: add example of using URL.Opaque with http.Request
Brad Fitzpatrick [Wed, 12 Nov 2014 22:27:27 +0000 (14:27 -0800)]
net/url: add example of using URL.Opaque with http.Request

Per private thread soliciting help. I realized part of this is
documented in several places, but we lacked a unifying
example.

LGTM=rsc
R=golang-codereviews
CC=adg, golang-codereviews, iant, rsc
https://golang.org/cl/171620043

10 years agoA+C: add another email address for Emil Hessman
Emil Hessman [Wed, 12 Nov 2014 18:01:23 +0000 (10:01 -0800)]
A+C: add another email address for Emil Hessman

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/143470043

10 years agohash/crc32: fix comment that the IEEE polynomial applies to MPEG-2.
Nigel Tao [Wed, 12 Nov 2014 07:48:00 +0000 (18:48 +1100)]
hash/crc32: fix comment that the IEEE polynomial applies to MPEG-2.

LGTM=minux
R=adg, minux
CC=golang-codereviews
https://golang.org/cl/170520043

10 years agoregexp/syntax: Clarify comment of OpAnyCharNotNL.
Robin Eklind [Wed, 12 Nov 2014 02:52:07 +0000 (18:52 -0800)]
regexp/syntax: Clarify comment of OpAnyCharNotNL.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/171560043

10 years agospec: method selectors don't auto-deref named pointer types
Robert Griesemer [Tue, 11 Nov 2014 21:19:47 +0000 (13:19 -0800)]
spec: method selectors don't auto-deref named pointer types

Language clarification.

The existing rules for selector expressions imply
automatic dereferencing of pointers to struct fields.
They also implied automatic dereferencing of selectors
denoting methods. In almost all cases, such automatic
dereferencing does indeed take place for methods but the
reason is not the selector rules but the fact that method
sets include both methods with T and *T receivers; so for
a *T actual receiver, a method expecting a formal T
receiver, also accepts a *T (and the invocation or method
value expression is the reason for the auto-derefering).

However, the rules as stated so far implied that even in
case of a variable p of named pointer type P, a selector
expression p.f would always be shorthand for (*p).f. This
is true for field selectors f, but cannot be true for
method selectors since a named pointer type always has an
empty method set.

Named pointer types may never appear as anonymous field
types (and method receivers, for that matter), so this
only applies to variables declared of a named pointer
type. This is exceedingly rare and perhaps shouldn't be
permitted in the first place (but we cannot change that).

Amended the selector rules to make auto-deref of values
of named pointer types an exception to the general rules
and added corresponding examples with explanations.

Both gc and gccgo have a bug where they do auto-deref
pointers of named types in method selectors where they
should not:

See http://play.golang.org/p/c6VhjcIVdM , line 45.

Fixes #5769.
Fixes #8989.

LGTM=r, rsc
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/168790043

10 years agodoc/gopher: add jpgs of the 5th anniversary image
Rob Pike [Tue, 11 Nov 2014 12:46:20 +0000 (23:46 +1100)]
doc/gopher: add jpgs of the 5th anniversary image

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/172980043

10 years agodoc: update go1.4.html's minor library changes.
Nigel Tao [Tue, 11 Nov 2014 05:06:47 +0000 (16:06 +1100)]
doc: update go1.4.html's minor library changes.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/173920043

10 years agocmd/cgo: tweak doc to not show example of passing Go pointer
Ian Lance Taylor [Mon, 10 Nov 2014 16:12:43 +0000 (08:12 -0800)]
cmd/cgo: tweak doc to not show example of passing Go pointer

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/171360043

10 years agocrypto/x509: add Solaris certificate file location
Ian Lance Taylor [Mon, 10 Nov 2014 04:57:44 +0000 (20:57 -0800)]
crypto/x509: add Solaris certificate file location

Fixes #9078.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/172920043

10 years agocmd/5g: fix bit mask for div/mod routines clobbering R12
Ian Lance Taylor [Mon, 10 Nov 2014 02:55:36 +0000 (18:55 -0800)]
cmd/5g: fix bit mask for div/mod routines clobbering R12

This patch is based only on reading the code.  I have not
tried to construct a test case.

Fixes #9077.

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/172110043

10 years agotest: fix nacl build
Russ Cox [Mon, 10 Nov 2014 02:10:49 +0000 (21:10 -0500)]
test: fix nacl build

Disable linkx_run.go and sinit_run.go, because they
exec subprocesses, which NaCl cannot.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171350043

10 years agocmd/internal/objfile: minor edits
Russ Cox [Mon, 10 Nov 2014 01:21:37 +0000 (20:21 -0500)]
cmd/internal/objfile: minor edits

Follow-up in response to comments on
TBR'ed CL 171260043.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/172080043

10 years agoruntime: fix sudog leak in syncsemrelease
Russ Cox [Mon, 10 Nov 2014 01:21:03 +0000 (20:21 -0500)]
runtime: fix sudog leak in syncsemrelease

Manifested as increased memory usage in a Google production system.

Not an unbounded leak, but can significantly increase the number
of sudogs allocated between garbage collections.

I checked all the other calls to acquireSudog.
This is the only one that was missing a releaseSudog.

LGTM=r, dneil
R=dneil, r
CC=golang-codereviews
https://golang.org/cl/169260043

10 years agoruntime/cgo: add +build tags to files named for $GOOS
Russ Cox [Mon, 10 Nov 2014 01:20:45 +0000 (20:20 -0500)]
runtime/cgo: add +build tags to files named for $GOOS

These are being built into the runtime/cgo for every
operating system. It doesn't seem to matter, but
restore the Go 1.3 behavior anyway.

LGTM=r
R=r, dave
CC=golang-codereviews
https://golang.org/cl/171290043

10 years agocmd/dist: remove old misc/pprof
Russ Cox [Mon, 10 Nov 2014 01:20:26 +0000 (20:20 -0500)]
cmd/dist: remove old misc/pprof

LGTM=dave, bradfitz, r, alex.brainman
R=r, dave, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/167350043

10 years agocmd/pprof: install as go tool pprof
Russ Cox [Mon, 10 Nov 2014 01:20:06 +0000 (20:20 -0500)]
cmd/pprof: install as go tool pprof

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/168320043

10 years agoundo CL 169000043 / 05b838013df9
Andrew Gerrand [Sun, 9 Nov 2014 22:46:27 +0000 (09:46 +1100)]
undo CL 169000043 / 05b838013df9

This was a mistake. The cmd/api tool
depends on an old version of go/types.

««« original CL description
cmd/api: use golang.org/x/... import paths

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/169000043
»»»

TBR=rsc, bradfitz
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/169320043

10 years agoundo CL 166380043 / 0b54a0927656
Andrew Gerrand [Sun, 9 Nov 2014 22:39:17 +0000 (09:39 +1100)]
undo CL 166380043 / 0b54a0927656

This was a mistake; the cmd/api tool
depends on an old version of go/types.

««« original CL description
cmd/api: bump go.tools golden CL hash

TBR=bradfitz
R=rsc
CC=golang-codereviews
https://golang.org/cl/166380043
»»»

TBR=bradfitz, rsc
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/167430043

10 years agocmd/api: bump go.tools golden CL hash
Andrew Gerrand [Sun, 9 Nov 2014 22:30:57 +0000 (09:30 +1100)]
cmd/api: bump go.tools golden CL hash

TBR=bradfitz
R=rsc
CC=golang-codereviews
https://golang.org/cl/166380043

10 years agocmd/go: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:27:25 +0000 (09:27 +1100)]
cmd/go: use golang.org/x/... import paths

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168170043

10 years agoall: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:15:57 +0000 (09:15 +1100)]
all: use golang.org/x/... import paths

LGTM=rsc, r
R=r, rsc
CC=golang-codereview, golang-codereviews
https://golang.org/cl/168050043

10 years agocmd/api: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:13:04 +0000 (09:13 +1100)]
cmd/api: use golang.org/x/... import paths

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/169000043

10 years agolib/codereview: fix with more recent hg revisions.
Adam Langley [Sun, 9 Nov 2014 01:12:23 +0000 (17:12 -0800)]
lib/codereview: fix with more recent hg revisions.

I've Mercurial version 3.2 and hg submit fails with:

  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3567, in get_hg_status
    ret = hg_commands.status(fui, self.repo, *[], **{'rev': [rev], 'copies': True})
  File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5714, in status
    fm = ui.formatter('status', opts)
  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3464, in formatter
    return plainformatter(self, topic, opts)
  File "/usr/lib/python2.7/site-packages/mercurial/formatter.py", line 57, in __init__
    if ui.debugflag:
  AttributeError: 'FakeMercurialUI' object has no attribute 'debugflag'

This change dumbly adds a boolean debugflag and that seems to work.

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/167410043

10 years agonet/http: fix benchmark goroutine leak
Brad Fitzpatrick [Sat, 8 Nov 2014 18:13:28 +0000 (15:13 -0300)]
net/http: fix benchmark goroutine leak

New detection because of net/http now using TestMain.

Fixes #9033

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews, rsc
https://golang.org/cl/170210043

10 years agocmd/go: disable warnings from cmd/cc when building for SWIG
Ian Lance Taylor [Fri, 7 Nov 2014 16:19:19 +0000 (08:19 -0800)]
cmd/go: disable warnings from cmd/cc when building for SWIG

Fixes #9065.

LGTM=rsc
R=rsc, misch
CC=golang-codereviews
https://golang.org/cl/171270043

10 years agocmd/internal/objfile: add Disasm
Russ Cox [Fri, 7 Nov 2014 01:08:00 +0000 (20:08 -0500)]
cmd/internal/objfile: add Disasm

This was missing from CL 167320043.
Happy to apply comments in a followup.
TBR to fix build.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171260043

10 years agocmd/objdump, cmd/pprof: factor disassembly into cmd/internal/objfile
Russ Cox [Fri, 7 Nov 2014 00:56:55 +0000 (19:56 -0500)]
cmd/objdump, cmd/pprof: factor disassembly into cmd/internal/objfile

Moving so that new Go 1.4 pprof can use it.

The old 'GNU objdump workalike' mode for 'go tool objdump'
is now gone, as are the tests for that mode. It was used only
by pre-Go 1.4 pprof. You can still specify an address range on
the command line; you just get the same output format as
you do when dumping the entire binary (without an address
limitation).

LGTM=r
R=r
CC=golang-codereviews, iant
https://golang.org/cl/167320043

10 years agodoc/go1.4.html: leave stack size at 2 kB
Russ Cox [Thu, 6 Nov 2014 20:19:16 +0000 (15:19 -0500)]
doc/go1.4.html: leave stack size at 2 kB

LGTM=r
R=khr, r
CC=golang-codereviews
https://golang.org/cl/165590043

10 years agodoc: change "/s/..." links to be on golang.org
Russ Cox [Thu, 6 Nov 2014 20:18:47 +0000 (15:18 -0500)]
doc: change "/s/..." links to be on golang.org

People viewing this locally will not have a /s/ on their local godoc.
tip.golang.org doesn't have one either.

Also change all golang.org links to https, to avoid mixed content
warnings when viewing https://golang.org/.

Fixes #9028.

LGTM=bradfitz, r
R=r, bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/168250043

10 years agotest: move linkx and sinit to run.go
Josh Bleecher Snyder [Thu, 6 Nov 2014 20:14:08 +0000 (15:14 -0500)]
test: move linkx and sinit to run.go

The remaining run-only tests will be migrated to run.go in another CL.

This CL will break the build due to issues 8746 and 8806.

Update #4139
Update #8746
Update #8806

LGTM=rsc
R=rsc, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/144630044

10 years agoruntime: don't stop bitmap dump at BitsDead
Keith Randall [Thu, 6 Nov 2014 17:30:41 +0000 (09:30 -0800)]
runtime: don't stop bitmap dump at BitsDead

Stack bitmaps need to be scanned past any BitsDead entries.

Object bitmaps will not have any BitsDead in them (bitmap extraction stops at
the first BitsDead entry in makeheapobjbv).  data/bss bitmaps also have no BitsDead entries.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168270043

10 years agoruntime: fix initial gp->sched.pc in newextram
Russ Cox [Thu, 6 Nov 2014 14:37:04 +0000 (09:37 -0500)]
runtime: fix initial gp->sched.pc in newextram

CL 170720043 missed this one when adding +PCQuantum.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/168090043

10 years agoos: document that users of Fd should keep f alive
Russ Cox [Thu, 6 Nov 2014 14:36:51 +0000 (09:36 -0500)]
os: document that users of Fd should keep f alive

Fixes #9046.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/162680043

10 years agoos/exec: tell lsof not to block
Keith Randall [Thu, 6 Nov 2014 04:25:20 +0000 (20:25 -0800)]
os/exec: tell lsof not to block

For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/166220043

10 years agobufio: remove unused 'panicked' variable from test
Andrew Gerrand [Thu, 6 Nov 2014 04:22:29 +0000 (15:22 +1100)]
bufio: remove unused 'panicked' variable from test

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044

10 years agoruntime: avoid gentraceback of self on user goroutine stack
Russ Cox [Thu, 6 Nov 2014 04:01:48 +0000 (23:01 -0500)]
runtime: avoid gentraceback of self on user goroutine stack

Gentraceback may grow the stack.
One of the gentraceback wrappers may grow the stack.
One of the gentraceback callback calls may grow the stack.
Various stack pointers are stored in various stack locations
as type uintptr during the execution of these calls.
If the stack does grow, these stack pointers will not be
updated and will start trying to decode stack memory that
is no longer valid.

It may be possible to change the type of the stack pointer
variables to be unsafe.Pointer, but that's pretty subtle and
may still have problems, even if we catch every last one.
An easier, more obviously correct fix is to require that
gentraceback of the currently running goroutine must run
on the g0 stack, not on the goroutine's own stack.

Not doing this causes faults when you set
        StackFromSystem = 1
        StackFaultOnFree = 1

The new check in gentraceback will catch future lapses.

The more general problem is calling getcallersp but then
calling a function that might relocate the stack, which would
invalidate the result of getcallersp. Add note to stubs.go
declaration of getcallersp explaining the problem, and
check all existing calls to getcallersp. Most needed fixes.

This affects Callers, Stack, and nearly all the runtime
profiling routines. It does not affect stack copying directly
nor garbage collection.

LGTM=khr
R=khr, bradfitz
CC=golang-codereviews, r
https://golang.org/cl/167060043

10 years agobufio: fix reading of many blank lines in a row
Russ Cox [Thu, 6 Nov 2014 03:50:24 +0000 (22:50 -0500)]
bufio: fix reading of many blank lines in a row

Fixes #9020.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/170030043

10 years agodoc/go1.4.html: document new subrepo import paths
Russ Cox [Thu, 6 Nov 2014 01:15:48 +0000 (20:15 -0500)]
doc/go1.4.html: document new subrepo import paths

LGTM=r, adg
R=adg, r, 0xjnml, dr.volker.dobler
CC=golang-codereviews
https://golang.org/cl/166980044

10 years agobufio: don't loop generating empty tokens
Rob Pike [Wed, 5 Nov 2014 22:57:46 +0000 (09:57 +1100)]
bufio: don't loop generating empty tokens

The new rules for split functions mean that we are exposed
to the common bug of a function that loops forever at EOF.
Pick these off by shutting down the scanner if too many
consecutive empty tokens are delivered.

Fixes #9020.

LGTM=rsc, adg
R=golang-codereviews, rsc, adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/169970043

10 years ago5g: don't generate reg variables for direct-called functions
Austin Clements [Wed, 5 Nov 2014 20:14:47 +0000 (15:14 -0500)]
5g: don't generate reg variables for direct-called functions

The test intended to skip direct calls when creating
registerization variables was testing p->to.type instead of
p->to.name, so it always failed, causing regopt to create
unnecessary variables for these names.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169110043

10 years agotest: comment out failing cases from sinit.go
Ian Lance Taylor [Tue, 4 Nov 2014 18:20:35 +0000 (10:20 -0800)]
test: comment out failing cases from sinit.go

One failing case this removes is:

var bytes = []byte("hello, world")
var copy_bytes = bytes

We could handle this in the compiler, but it requires special
case for a variable that is initialized to the value of a
variable that is initialized to a string literal converted to
[]byte.  This seems an unlikely case--it never occurs in the
standrd library--and it seems unnecessary to write the code to
handle it.

If we do want to support this case, one approach is
https://golang.org/cl/171840043.

The other failing cases are of the form

var bx bool
var copy_bx = bx

The compiler used to initialize copy_bx to false.  However,
that led to issue 7665, since bx may be initialized in non-Go
code.  The compiler no longer assumes that bx must be false,
so copy_bx can not be statically initialized.

We can fix these with https://golang.org/cl/169040043
if we also pass -complete to the compiler as part of this
test.  This is OK but it's too late in the release cycle.

Fixes #8746.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/165400043

10 years agogc: abort if given an unknown debug (-d) flag
Austin Clements [Tue, 4 Nov 2014 14:43:37 +0000 (09:43 -0500)]
gc: abort if given an unknown debug (-d) flag

The check for unknown command line debug flags in gc was
incorrect: the loop over debugtab terminates when it reaches a
nil entry, but it was only reporting an error if the parser
had passed the last entry of debugtab (which it never did).
Fix this by reporting the usage error if the loop reaches a
nil entry.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/166110043

10 years agomisc/cgo/test: fix freebsd test failure by moving test to its own package.
Alan Donovan [Mon, 3 Nov 2014 18:41:03 +0000 (13:41 -0500)]
misc/cgo/test: fix freebsd test failure by moving test to its own package.

(The assertion depends on a per-package gensym counter whose
value varies based on what else is in the package.)

LGTM=khr
R=khr, rsc
CC=golang-codereviews
https://golang.org/cl/169930043

10 years agoruntime: make Go and C mallocgc signatures match
Austin Clements [Mon, 3 Nov 2014 18:26:46 +0000 (13:26 -0500)]
runtime: make Go and C mallocgc signatures match

Previously, the flags argument to mallocgc was an int in Go,
but a uint32 in C.  Change the Go type to use uint32 so these
agree.  The largest flag value is 2 (and of course no flag
values are negative), so this won't change anything on little
endian architectures, but it matters on big endian.

LGTM=rsc
R=khr, rsc
CC=golang-codereviews
https://golang.org/cl/169920043

10 years agodoc: document go get -f flag in 1.4 release notes
Andrew Gerrand [Mon, 3 Nov 2014 06:01:17 +0000 (17:01 +1100)]
doc: document go get -f flag in 1.4 release notes

LGTM=r, rsc
R=r, rsc, adg
CC=golang-codereviews
https://golang.org/cl/168890043

10 years agomisc: Increase issue 6997's test timeout to prevent spurious failures.
Benoit Sigoure [Sat, 1 Nov 2014 15:28:09 +0000 (08:28 -0700)]
misc: Increase issue 6997's test timeout to prevent spurious failures.

On heavily loaded build servers, a 5 second timeout is too aggressive,
which causes this test to fail spuriously.

LGTM=iant
R=iant
CC=golang-codereviews, sqweek
https://golang.org/cl/170850043

10 years agoA+C: add Benoit Sigoure (individual CLA)
Ian Lance Taylor [Sat, 1 Nov 2014 15:27:55 +0000 (08:27 -0700)]
A+C: add Benoit Sigoure (individual CLA)

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/164410043