]> Cypherpunks repositories - gostls13.git/log
gostls13.git
6 years agodoc/go1.12: mention heap sampling change
Hana (Hyang-Ah) Kim [Fri, 18 Jan 2019 19:45:25 +0000 (14:45 -0500)]
doc/go1.12: mention heap sampling change

This is about a minor change but worthy of note because this
may affect the profile results users will see.

Change-Id: Ie2c4358b248f868662dbc71db587576481aa7238
Reviewed-on: https://go-review.googlesource.com/c/158577
Reviewed-by: Raul Silvera <rauls5382@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoA+C: add author, rename contributor to a real name
tkivisik [Fri, 18 Jan 2019 20:45:41 +0000 (20:45 +0000)]
A+C: add author, rename contributor to a real name

Renamed from github user to use my real name in CONTRIBUTORS, added my name
to AUTHORS.

Change-Id: I671638f1525d44bcc2b0a08d0dcff6adb1717510
GitHub-Last-Rev: b989e185de9ad2d1207085043fcdc821d851c562
GitHub-Pull-Request: golang/go#29823
Reviewed-on: https://go-review.googlesource.com/c/158540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: sample large heap allocations correctly
Raul Silvera [Fri, 18 Jan 2019 00:14:29 +0000 (00:14 +0000)]
runtime: sample large heap allocations correctly

Remove an unnecessary check on the heap sampling code that forced sampling
of all heap allocations larger than the sampling rate. This need to follow
a poisson process so that they can be correctly unsampled. Maintain a check
for MemProfileRate==1 to provide a mechanism for full sampling, as
documented in https://golang.org/pkg/runtime/#pkg-variables.

Additional testing for this change is on cl/129117.

Fixes #26618

Change-Id: I7802bde2afc655cf42cffac34af9bafeb3361957
GitHub-Last-Rev: 471f747af845395d458096bea26daa93b91120be
GitHub-Pull-Request: golang/go#29791
Reviewed-on: https://go-review.googlesource.com/c/158337
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
6 years agocmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH
Ian Lance Taylor [Mon, 17 Dec 2018 00:06:13 +0000 (16:06 -0800)]
cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH

Fixes #29263

Change-Id: I06ba135dc491fd01fc06ccaad4ef98103d4b86c4
Reviewed-on: https://go-review.googlesource.com/c/154460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/cgo: don't replace newlines with semicolons in expressions
Ian Lance Taylor [Fri, 18 Jan 2019 02:35:43 +0000 (18:35 -0800)]
cmd/cgo: don't replace newlines with semicolons in expressions

Fixes #29781

Change-Id: Id032d07a54b8c24f0c6d3f6e512932f76920ee04
Reviewed-on: https://go-review.googlesource.com/c/158457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: clarify Transport connection reuse docs a bit
Brad Fitzpatrick [Thu, 17 Jan 2019 23:22:47 +0000 (15:22 -0800)]
net/http: clarify Transport connection reuse docs a bit

Updates #26095 (or fixes it)

Change-Id: I92488dabe823b82e1ba534648fe6d63d25d0ae9f
Reviewed-on: https://go-review.googlesource.com/c/158417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agomath/big: document that Rat.SetString accepts _decimal_ float representations
Robert Griesemer [Thu, 17 Jan 2019 22:49:30 +0000 (14:49 -0800)]
math/big: document that Rat.SetString accepts _decimal_ float representations

Updates #29799.

Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c
Reviewed-on: https://go-review.googlesource.com/c/158397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: don't coalesce scavenged spans with unscavenged spans
Michael Anthony Knyszek [Wed, 16 Jan 2019 00:15:34 +0000 (00:15 +0000)]
runtime: don't coalesce scavenged spans with unscavenged spans

As a result of changes earlier in Go 1.12, the scavenger became much
more aggressive. In particular, when scavenged and unscavenged spans
coalesced, they would always become scavenged. This resulted in most
spans becoming scavenged over time. While this is good for keeping the
RSS of the program low, it also causes many more undue page faults and
many more calls to madvise.

For most applications, the impact of this was negligible. But for
applications that repeatedly grow and shrink the heap by large amounts,
the overhead can be significant. The overhead was especially obvious on
older versions of Linux where MADV_FREE isn't available and
MADV_DONTNEED must be used.

This change makes it so that scavenged spans will never coalesce with
unscavenged spans. This  results in fewer page faults overall. Aside
from this, the expected impact of this change is more heap growths on
average, as span allocations will be less likely to be fulfilled. To
mitigate this slightly, this change also coalesces spans eagerly after
scavenging, to at least ensure that all scavenged spans and all
unscavenged spans are coalesced with each other.

Also, this change adds additional logic in the case where two adjacent
spans cannot coalesce. In this case, on platforms where the physical
page size is larger than the runtime's page size, we realign the
boundary between the two adjacent spans to a physical page boundary. The
advantage of this approach is that "unscavengable" spans, that is, spans
which cannot be scavenged because they don't cover at least a single
physical page are grown to a size where they have a higher likelihood of
being discovered by the runtime's scavenging mechanisms when they border
a scavenged span. This helps prevent the runtime from accruing pockets
of "unscavengable" memory in between scavenged spans, preventing them
from coalescing.

We specifically choose to apply this logic to all spans because it
simplifies the code, even though it isn't strictly necessary. The
expectation is that this change will result in a slight loss in
performance on platforms where the physical page size is larger than the
runtime page size.

Update #14045.

Change-Id: I64fd43eac1d6de6f51d7a2ecb72670f10bb12589
Reviewed-on: https://go-review.googlesource.com/c/158078
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: de-duplicate coalescing code
Michael Anthony Knyszek [Tue, 15 Jan 2019 23:48:57 +0000 (23:48 +0000)]
runtime: de-duplicate coalescing code

Currently the code surrounding coalescing is duplicated between merging
with the span before the span considered for coalescing and merging with
the span after. This change factors out the shared portions of these
codepaths into a local closure which acts as a helper.

Change-Id: I7919fbed3f9a833eafb324a21a4beaa81f2eaa91
Reviewed-on: https://go-review.googlesource.com/c/158077
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: refactor coalescing into its own method
Michael Anthony Knyszek [Mon, 14 Jan 2019 21:27:29 +0000 (21:27 +0000)]
runtime: refactor coalescing into its own method

The coalescing process is complex and in a follow-up change we'll need
to do it in more than one place, so this change factors out the
coalescing code in freeSpanLocked into a method on mheap.

Change-Id: Ia266b6cb1157c1b8d3d8a4287b42fbcc032bbf3a
Reviewed-on: https://go-review.googlesource.com/c/157838
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agodoc/go1.12: link to ABIInternal design document
Austin Clements [Thu, 17 Jan 2019 02:42:00 +0000 (21:42 -0500)]
doc/go1.12: link to ABIInternal design document

The ABI changes should be completely transparent to Go code, but could
cause linking issues in certain situations involving assembly code
reaching across package boundaries. If users encounter linking
problems, point them to the "Compatibility" section of the ABI design
document, which gives some guidance.

Change-Id: I4156d164562e2ec0de7ae8f9a3631a32ec45b317
Reviewed-on: https://go-review.googlesource.com/c/158237
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agotesting: report the failing test in a late log panic
Ian Lance Taylor [Fri, 11 Jan 2019 22:06:45 +0000 (14:06 -0800)]
testing: report the failing test in a late log panic

Updates #29388

Change-Id: Icb0e6048d05fde7a5486b923ff62147edb5c8dac
Reviewed-on: https://go-review.googlesource.com/c/157617
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
6 years agonet: increase TestNotTemporaryRead server sleep
Clément Chigot [Wed, 16 Jan 2019 08:03:57 +0000 (09:03 +0100)]
net: increase TestNotTemporaryRead server sleep

On aix/ppc64, if the server closes before the client calls Accept,
this test will fail.

Increasing the time before the server closes should resolve this
timeout.

Updates #29685

Change-Id: Iebb849d694fc9c37cf216ce1f0b8741249b98016
Reviewed-on: https://go-review.googlesource.com/c/158038
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go/internal/clean: fix clean -testcache does not clean test cache
Baokun Lee [Wed, 16 Jan 2019 10:53:35 +0000 (18:53 +0800)]
cmd/go/internal/clean: fix clean -testcache does not clean test cache

Truncate changes the size of the file. It does not change the I/O offset.

Fixes #29757

Change-Id: I1aa9223a86d6a8ce3c0efc3ac1d7d7647b77f589
Reviewed-on: https://go-review.googlesource.com/c/158117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agoencoding/json: add comment for mashalererror struct
GuilhermeCaruso [Tue, 15 Jan 2019 23:24:52 +0000 (23:24 +0000)]
encoding/json: add comment for mashalererror struct

Change-Id: Iaabbfe5a4c1bbedd19d4087f1b79e5a38bdd3878
GitHub-Last-Rev: 55c91fc19074dacc66623aa7ff2286b11ccd5340
GitHub-Pull-Request: golang/go#29752
Reviewed-on: https://go-review.googlesource.com/c/157958
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix wording issue in comment
Daniel Martí [Tue, 15 Jan 2019 18:29:15 +0000 (18:29 +0000)]
cmd/go: fix wording issue in comment

golang.org/cl/157097 modified this comment, but left a trailing comma.
While at it, make the sentence a bit clearer.

Change-Id: I376dda4fd18ddbcae4485dd660a79b9f66ad6da4
Reviewed-on: https://go-review.googlesource.com/c/158037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/cgo: don't replace newlines with semicolons in composite literals
Ian Lance Taylor [Tue, 15 Jan 2019 15:46:39 +0000 (07:46 -0800)]
cmd/cgo: don't replace newlines with semicolons in composite literals

Fixes #29748

Change-Id: I2b19165bdb3c99df5b79574390b5d5f6d40462dc
Reviewed-on: https://go-review.googlesource.com/c/157961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: remove init() to fix precedence issue when setting debug mod info
Viacheslav Poturaev [Wed, 9 Jan 2019 12:54:50 +0000 (12:54 +0000)]
cmd/go: remove init() to fix precedence issue when setting debug mod info

Fixes #29628

Change-Id: I95dabed797ef7a1a770b6f4219840f653306af7e
GitHub-Last-Rev: 9275dd8f1c6a0cfa16ae882fcfc100991f8338f7
GitHub-Pull-Request: golang/go#29630
Reviewed-on: https://go-review.googlesource.com/c/157097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agopath/filepath: skip part of TestNTNamespaceSymlink
Alex Brainman [Tue, 15 Jan 2019 08:37:17 +0000 (19:37 +1100)]
path/filepath: skip part of TestNTNamespaceSymlink

Recent CL 156398 extended TestNTNamespaceSymlink. But new code
fails, if user running the test does not have sufficient privilege
to create file symlink. Skip part of TestNTNamespaceSymlink, if
user cannot create symlink.

Fixes #29745

Change-Id: Ie4176429ba9dd98553ce9e91fd19851cc7353f42
Reviewed-on: https://go-review.googlesource.com/c/157917
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
6 years agoruntime: keep FuncForPC from crashing for PCs between functions
Keith Randall [Mon, 14 Jan 2019 21:47:14 +0000 (13:47 -0800)]
runtime: keep FuncForPC from crashing for PCs between functions

Reuse the strict mechanism from FileLine for FuncForPC, so we don't
crash when asking the pcln table about bad pcs.

Fixes #29735

Change-Id: Iaffb32498b8586ecf4eae03823e8aecef841aa68
Reviewed-on: https://go-review.googlesource.com/c/157799
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomisc/sortac: delete sortac command
Dmitri Shuralyov [Thu, 10 Jan 2019 02:01:41 +0000 (21:01 -0500)]
misc/sortac: delete sortac command

The sortac command is no longer needed as of CL 157238, and
can be deleted. Its functionality has been directly integrated
into the new x/build/cmd/updatecontrib command. A previous version
of updatecontrib was the only user of sortac.

Updates #12042

Change-Id: If7442ebee11d05d095ff875a37eed3973c0fd9ca
Reviewed-on: https://go-review.googlesource.com/c/157257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: when merging instructions, prefer line number of faulting insn
Keith Randall [Tue, 8 Jan 2019 21:46:49 +0000 (13:46 -0800)]
cmd/compile: when merging instructions, prefer line number of faulting insn

Normally this happens when combining a sign extension and a load.  We
want the resulting combo-instruction to get the line number of the
load, not the line number of the sign extension.

For each rule, compute where we should get its line number by finding
a value on the match side that can fault.  Use that line number for
all the new values created on the right-hand side.

Fixes #27201

Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3
Reviewed-on: https://go-review.googlesource.com/c/156937
Reviewed-by: David Chase <drchase@google.com>
6 years agodatabase/sql: fix logic for pulling a Conn from DB
Daniel Theophanes [Fri, 11 Jan 2019 22:20:41 +0000 (14:20 -0800)]
database/sql: fix logic for pulling a Conn from DB

The logic for pulling a database connection from the DB pool should
proceed as follows: attempt to pull either a cached connection or
new connection N times in a loop. If each connection results
in a bad connection, then create a new connection (no cache).

Previously pulling a Conn from the pool, the last step also
looked at the cache, rather then always creating a new connection.

Fixes #29684

Change-Id: I8f436fd9b96eb35502a620ebe8da4ab89fb06a2e
Reviewed-on: https://go-review.googlesource.com/c/157637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agonet: skip TestLookupGmailTXT on Plan 9
David du Colombier [Sun, 13 Jan 2019 21:11:44 +0000 (22:11 +0100)]
net: skip TestLookupGmailTXT on Plan 9

CL 157638 updated TestLookupGmailTXT. However, this
test is failing on Plan 9, because the DNS resolver
(ndb/dns) only returns a single TXT record.

Updates #29722.

Change-Id: I01cd94e6167902361c3f5d615868f6f763a31fb1
Reviewed-on: https://go-review.googlesource.com/c/157737
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet: pass if at least one matching entry in TestLookupGmailTXT
Ian Lance Taylor [Fri, 11 Jan 2019 22:26:24 +0000 (14:26 -0800)]
net: pass if at least one matching entry in TestLookupGmailTXT

Fixes #29698

Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3
Reviewed-on: https://go-review.googlesource.com/c/157638
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: remove note about GOCACHE=off in docs
Sebastiaan van Stijn [Fri, 11 Jan 2019 15:28:04 +0000 (15:28 +0000)]
cmd/go: remove note about GOCACHE=off in docs

This patch removes mention of GOCACHE=off from the help/docs.
It is no longer supported in Go 1.12, per the release notes.

Fixes #29680

Change-Id: I53ab15a62743f2e55ae1d8aa50629b1bf1ae32ad
GitHub-Last-Rev: 31e904f51dece13645696a87b1164d86c984457f
GitHub-Pull-Request: golang/go#29681
Reviewed-on: https://go-review.googlesource.com/c/157517
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
6 years agocmd/compile: separate data and function LSyms
Austin Clements [Wed, 9 Jan 2019 03:23:52 +0000 (22:23 -0500)]
cmd/compile: separate data and function LSyms

Currently, obj.Ctxt's symbol table does not distinguish between ABI0
and ABIInternal symbols. This is *almost* okay, since a given symbol
name in the final object file is only going to belong to one ABI or
the other, but it requires that the compiler mark a Sym as being a
function symbol before it retrieves its LSym. If it retrieves the LSym
first, that LSym will be created as ABI0, and later marking the Sym as
a function symbol won't change the LSym's ABI.

Marking a Sym as a function symbol before looking up its LSym sounds
easy, except Syms have a dual purpose: they are used just as interned
strings (every function, variable, parameter, etc with the same
textual name shares a Sym), and *also* to store state for whatever
package global has that name. As a result, it's easy to slip up and
look up an LSym when a Sym is serving as the name of a local variable,
and then later mark it as a function when it's serving as the global
with the name.

In general, we were careful to avoid this, but #29610 demonstrates one
case where we messed up. Because of on-demand importing from indexed
export data, it's possible to compile a method wrapper for a type
imported from another package before importing an init function from
that package. If the argument of the method is named "init", the
"init" LSym will be created as a data symbol when compiling the
wrapper, before it gets marked as a function symbol.

To fix this, we separate obj.Ctxt's symbol tables for ABI0 and
ABIInternal symbols. This way, the compiler will simply get a
different LSym once the Sym takes on its package-global meaning as a
function.

This fixes the above ordering issue, and means we no longer need to go
out of our way to create the "init" function early and mark it as a
function symbol.

Fixes #29610.
Updates #27539.

Change-Id: Id9458b40017893d46ef9e4a3f9b47fc49e1ce8df
Reviewed-on: https://go-review.googlesource.com/c/157017
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agodoc: add Go 1.12 release note for trigonometric reductions in math
Ian Lance Taylor [Thu, 10 Jan 2019 19:12:28 +0000 (11:12 -0800)]
doc: add Go 1.12 release note for trigonometric reductions in math

Worth mentioning because the results are not bit-for-bit identical.
This causes a test failure in github.com/fogleman/gg.

Updates #6794

Change-Id: I701f34927731fb5c658a1be271c04388e5e7e3f7
Reviewed-on: https://go-review.googlesource.com/c/157417
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: make mTreap iterator bidirectional go1.12beta2
Michael Anthony Knyszek [Fri, 4 Jan 2019 20:17:15 +0000 (20:17 +0000)]
runtime: make mTreap iterator bidirectional

This change makes mTreap's iterator type, treapIter, bidirectional
instead of unidirectional. This change helps support moving the find
operation on a treap to return an iterator instead of a treapNode, in
order to hide the details of the treap when accessing elements.

For #28479.

Change-Id: I5dbea4fd4fb9bede6e81bfd089f2368886f98943
Reviewed-on: https://go-review.googlesource.com/c/156918
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agopath/filepath: return special error from EvalSymlinks
Alex Brainman [Sat, 5 Jan 2019 07:35:27 +0000 (18:35 +1100)]
path/filepath: return special error from EvalSymlinks

CL 155597 attempted to fix #29372. But it failed to make all new
test cases pass. Also CL 155597 broke some existing code
(see #29449 for details).

Make small adjustment to CL 155597 that fixes both #29372 and #29449.

Suggested by Ian.

Updates #29372
Fixes #29449

Change-Id: I9777a615514d3f152af5acb65fb1239e696607b6
Reviewed-on: https://go-review.googlesource.com/c/156398
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet: drop confusing comment
Mikio Hara [Wed, 9 Jan 2019 20:14:40 +0000 (05:14 +0900)]
net: drop confusing comment

On AIX, we don't need to be aware of any change on the protocol stack of
Linux kernel.

Change-Id: Ib8b14fa930acddb3bc720d401271e8daf567b784
Reviewed-on: https://go-review.googlesource.com/c/157298
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet: update BUG sections for go1.12
Mikio Hara [Wed, 9 Jan 2019 20:14:40 +0000 (05:14 +0900)]
net: update BUG sections for go1.12

To confirm this change with the go commaned, please run 'go doc net'
instead of 'go doc -all net'; the -all option surpresses BUG sections.

Change-Id: Iac7bc85fbef48e91d5ede16da0ce4a7ab8cae539
Reviewed-on: https://go-review.googlesource.com/c/157297
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64
Clément Chigot [Wed, 9 Jan 2019 13:05:17 +0000 (14:05 +0100)]
cmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64

This commit allows to cross-compiling aix/ppc64. The nosplit limit must
twice as large as on others platforms because of AIX syscalls.
The stack limit, especially stackGuardMultiplier, was set by cmd/dist
during the bootstrap and doesn't depend on GOOS/GOARCH target.

Fixes #29572

Change-Id: Id51e38885e1978d981aa9e14972eaec17294322e
Reviewed-on: https://go-review.googlesource.com/c/157117
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: always treat files as unpollable on FreeBSD
Ian Lance Taylor [Wed, 9 Jan 2019 18:04:58 +0000 (10:04 -0800)]
os: always treat files as unpollable on FreeBSD

Fixes #29633
Updates #27619

Change-Id: I1e38569ea2a02423b028331f2ed987d3ae47fd2e
Reviewed-on: https://go-review.googlesource.com/c/157099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: skip tests using Git on Plan 9
David du Colombier [Wed, 9 Jan 2019 20:32:11 +0000 (21:32 +0100)]
cmd/go: skip tests using Git on Plan 9

TestScript/get_unicode, TestScript/get_dotfiles and
TestScript/get_brace are failing on Plan 9 since they
expect a full-featured git command, while the git tool
has been emulated as a simple rc script on Plan 9.

This change skips tests using Git on Plan 9.

Fixes #29640.

Change-Id: Id7f6fdca552167f4631fe401f63167e5653daafa
Reviewed-on: https://go-review.googlesource.com/c/157119
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/internal/obj/wasm: increment PC by 2 at sigpanic
Cherry Zhang [Wed, 9 Jan 2019 16:21:07 +0000 (11:21 -0500)]
cmd/internal/obj/wasm: increment PC by 2 at sigpanic

On Wasm, PC is not the instruction counter but the block ID. We
advance the PC only when necessary. In the case of sigpanic (used
in nil check), the panic stack trace expects the PC at the call
of sigpanic, not the next one. However, runtime.Caller subtracts
1 from the PC. To make both PC and PC-1 work (have the same line
number), we advance the PC by 2 at sigpanic.

Fixes #29632.

Change-Id: Ieb4d0bb9dc6a8103855a194e3d289f1db4bfb1e5
Reviewed-on: https://go-review.googlesource.com/c/157157
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agogo/types: don't create new context string for each argument of each call
Robert Griesemer [Wed, 9 Jan 2019 06:39:13 +0000 (22:39 -0800)]
go/types: don't create new context string for each argument of each call

The argument context string is only used in error messages. Don't format
the function AST into a string for every single argument of every single
call that is type-checked. Instead do it once per call (still not great,
but much much better).

Performance optimization.

Change-Id: Iec87f9ad34128d7b3eee58577ad37dbaa8e6db44
Reviewed-on: https://go-review.googlesource.com/c/157037
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades
Brad Fitzpatrick [Wed, 9 Jan 2019 15:06:20 +0000 (15:06 +0000)]
net/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades

Fixes #29627

Change-Id: I08a5b45151a11b5a4f3b5a2d984c0322cf904697
Reviewed-on: https://go-review.googlesource.com/c/157098
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agonet/http/httputil: fix typo in ReverseProxy godoc
Tobias Klauser [Wed, 9 Jan 2019 13:24:44 +0000 (14:24 +0100)]
net/http/httputil: fix typo in ReverseProxy godoc

Change-Id: Iea33fe64403ca2e6f87a4e070af5e97d96506e41
Reviewed-on: https://go-review.googlesource.com/c/157118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodebug/gosym: remove outdated comment
LE Manh Cuong [Wed, 9 Jan 2019 02:27:54 +0000 (09:27 +0700)]
debug/gosym: remove outdated comment

Change-Id: I2bba13064c8d21ded41499c6ec225ef83d1a533e
Reviewed-on: https://go-review.googlesource.com/c/156997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: follow convention for generated code comment in fastlog2table
Tobias Klauser [Tue, 8 Jan 2019 13:14:27 +0000 (14:14 +0100)]
runtime: follow convention for generated code comment in fastlog2table

Follow the convertion (https://golang.org/s/generatedcode) for generated
code in fastlog2table.go

Change-Id: Ib40ae2848924d98afaf8d4fcaf180a4583edc3fe
Reviewed-on: https://go-review.googlesource.com/c/156817
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoos: disable the use of netpoll on regular files on *BSDs.
Yuval Pavel Zholkover [Mon, 7 Jan 2019 00:06:38 +0000 (02:06 +0200)]
os: disable the use of netpoll on regular files on *BSDs.

The kqueue based netpoller always registers file descriptors with EVFILT_READ and EVFILT_WRITE.
However only EVFILT_READ notification is supported for regular files.
On FreeBSD a regular file is always reported as ready for writing, resulting in a busy wait.
On Darwin, Dragonfly, NetBSD and OpenBSD, a regular file is reported as ready for both reading and writing only once.

Updates #19093

Change-Id: If284341f60c6c2332fb5499637d4cfa7a4e26b7b
Reviewed-on: https://go-review.googlesource.com/c/156379
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agobufio: document relationship between UnreadByte/UnreadRune and Peek
Brad Fitzpatrick [Wed, 2 Jan 2019 18:33:31 +0000 (18:33 +0000)]
bufio: document relationship between UnreadByte/UnreadRune and Peek

Fixes #29387

Change-Id: I2d9981f63ac16630ed39d6da6692c81396f4e9ea
Reviewed-on: https://go-review.googlesource.com/c/155930
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: go1.12: mention os.File.SyscallConn
Ian Lance Taylor [Tue, 8 Jan 2019 23:18:44 +0000 (15:18 -0800)]
doc: go1.12: mention os.File.SyscallConn

Updates #24331

Change-Id: I2d7c996bbe29d5b3922588e199a106eb722c02e6
Reviewed-on: https://go-review.googlesource.com/c/156839
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: make FuncForPC return the innermost inlined frame
Keith Randall [Sat, 5 Jan 2019 22:31:23 +0000 (14:31 -0800)]
runtime: make FuncForPC return the innermost inlined frame

Returning the innermost frame instead of the outermost
makes code that walks the results of runtime.Caller{,s}
still work correctly in the presence of mid-stack inlining.

Fixes #29582

Change-Id: I2392e3dd5636eb8c6f58620a61cef2194fe660a7
Reviewed-on: https://go-review.googlesource.com/c/156364
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: update tzdata version in 1.12 release notes
Alberto Donizetti [Tue, 8 Jan 2019 18:47:52 +0000 (19:47 +0100)]
doc: update tzdata version in 1.12 release notes

It was recently updated (again) to version 2018i. Since we're here,
wrap the paragraph at ~70 columns, like all the others.

Change-Id: I0a380385f34f1df1258a9f2af447234967422f37
Reviewed-on: https://go-review.googlesource.com/c/156857
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: make link relative in 1.12 cgo release notes
Alberto Donizetti [Tue, 8 Jan 2019 18:59:08 +0000 (19:59 +0100)]
doc: make link relative in 1.12 cgo release notes

Change a link in the cgo section of the 1.12 release notes from

  https://golang.org/cmd/cgo ...

to

  /cmd/cgo/ ...

to uniform it with other links on the page, and to ensure correct
target when the page is displayed on tip.golang.org.

Change-Id: I7653a6ea15ce111a60929c7ae7e9fb0dc9515502
Reviewed-on: https://go-review.googlesource.com/c/156858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: store incremented PC in result of runtime.Callers
Keith Randall [Mon, 7 Jan 2019 20:24:01 +0000 (12:24 -0800)]
runtime: store incremented PC in result of runtime.Callers

In 1.11 we stored "return addresses" in the result of runtime.Callers.
I changed that behavior in CL 152537 to store an address in the call
instruction itself. This CL reverts that part of 152537.

The change in 152537 was made because we now store pcs of inline marks
in the result of runtime.Callers as well. This CL will now store the
address of the inline mark + 1 in the results of runtime.Callers, so
that the subsequent -1 done in CallersFrames will pick out the correct
inline mark instruction.

This CL means that the results of runtime.Callers can be passed to
runtime.FuncForPC as they were before. There are a bunch of packages
in the wild that take the results of runtime.Callers, subtract 1, and
then call FuncForPC. This CL keeps that pattern working as it did in
1.11.

The changes to runtime/pprof in this CL are exactly a revert of the
changes to that package in 152537 (except the locForPC comment).

Update #29582

Change-Id: I04d232000fb482f0f0ff6277f8d7b9c72e97eb48
Reviewed-on: https://go-review.googlesource.com/c/156657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: fix typo in output of go help importpath
Mark Rushakoff [Tue, 8 Jan 2019 01:13:01 +0000 (01:13 +0000)]
cmd/go: fix typo in output of go help importpath

The output refers to 'go help modules-get' but the actual command is 'go
help module-get', singular.

Change-Id: Ie001f4181d80d3bf1995af2f257bf789dad5b33f
GitHub-Last-Rev: ce9b90e9a656fbab097d440458e93ab29ba014af
GitHub-Pull-Request: golang/go#29605
Reviewed-on: https://go-review.googlesource.com/c/156737
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

6 years agoruntime: disable GDB tests on freebsd on all GOARCH values
Yuval Pavel Zholkover [Mon, 7 Jan 2019 22:54:58 +0000 (00:54 +0200)]
runtime: disable GDB tests on freebsd on all GOARCH values

The in-tree GDB is too old (6.1.1) on all the builders except the
FreeBSD 12.0 one, where it was removed from the base system.

Update #29508

Change-Id: Ib6091cd86440ea005f3f903549a0223a96621a6f
Reviewed-on: https://go-review.googlesource.com/c/156717
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: improve error message for names forbidden by Windows
Ian Lance Taylor [Mon, 7 Jan 2019 21:35:53 +0000 (13:35 -0800)]
cmd/go: improve error message for names forbidden by Windows

Fixes #29589

Change-Id: I69ad461e70b236d9729a42053e35128437449e32
Reviewed-on: https://go-review.googlesource.com/c/156658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime/pprof: add a test for gccgo bug #29448
Cherry Zhang [Mon, 31 Dec 2018 04:53:27 +0000 (23:53 -0500)]
runtime/pprof: add a test for gccgo bug #29448

With gccgo, if a profiling signal arrives in certain time during
traceback, it may crash or hang. The fix is CL 156037 and
CL 156038.  This CL adds a test.

Updates #29448.

Change-Id: Idb36af176b4865b8fb31a85cad185ed4c07ade0c
Reviewed-on: https://go-review.googlesource.com/c/156018
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agolib/time: update tzdata to 2018i
Ian Lance Taylor [Mon, 7 Jan 2019 19:54:35 +0000 (11:54 -0800)]
lib/time: update tzdata to 2018i

Updates #22487

Change-Id: Iab4874ddef8e47eb99cd03e1c40af8372cce65c6
Reviewed-on: https://go-review.googlesource.com/c/156637
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomath: fix ternary correction statement in Log1p
Brian Kessler [Thu, 3 Jan 2019 17:00:49 +0000 (10:00 -0700)]
math: fix ternary correction statement in Log1p

The original port of Log1p incorrectly translated a ternary statement
so that a correction was only applied to one of the branches.

Fixes #29488

Change-Id: I035b2fc741f76fe7c0154c63da6e298b575e08a4
Reviewed-on: https://go-review.googlesource.com/c/156120
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
6 years agocrypto/md5: fix casting of d.nx in UnmarshalBinary
Jason LeBrun [Fri, 4 Jan 2019 01:41:06 +0000 (01:41 +0000)]
crypto/md5: fix casting of d.nx in UnmarshalBinary

Fixes #29545

Change-Id: Ida98c23b8fc5c676d8bf0b3daad8320e495ebf64
GitHub-Last-Rev: d38e8a90c75f92031f6a8cf1f69f7bc7c28a52d8
GitHub-Pull-Request: golang/go#29546
Reviewed-on: https://go-review.googlesource.com/c/156297
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocrypto/sha1: fix casting of d.nx in UnmarshalBinary
Jason LeBrun [Fri, 4 Jan 2019 01:30:15 +0000 (01:30 +0000)]
crypto/sha1: fix casting of d.nx in UnmarshalBinary

Fixes #29543

Change-Id: Ib7f3c32cc1e57c583ee52c486673a5b9568c2df8
GitHub-Last-Rev: 0cb3dc536245bb4f414cf09bb353fbafd5ca7537
GitHub-Pull-Request: golang/go#29544
Reviewed-on: https://go-review.googlesource.com/c/156279
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: deflake TestScript/gcflags_patterns
Jay Conrod [Fri, 4 Jan 2019 22:30:36 +0000 (17:30 -0500)]
cmd/go: deflake TestScript/gcflags_patterns

The check below can fail incorrectly if the buildid ends with '-p'.

    ! stderr 'compile.* -e .*-p [^z]'

This fix changes regular expressions to '-e.* -p' or '-N.* -p' instead
of '-e .*-p'. '-l' is no longer used because the compiler accepts
multiple flags starting with '-l' ('-e' and '-N' do not have this
problem), so there could be false matches.

Change-Id: I827c411de28624019a287f853acc9666e87cbfb9
Reviewed-on: https://go-review.googlesource.com/c/156327
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: remove incorrect space in %T and %v output examples
Gabriel Aszalos [Mon, 7 Jan 2019 08:48:39 +0000 (09:48 +0100)]
doc: remove incorrect space in %T and %v output examples

Change-Id: I321890237f703b945711e59c15233ccf59c4f190
Reviewed-on: https://go-review.googlesource.com/c/156477
Run-TryBot: Gabriel Aszalos <gabriel.aszalos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoarchive/zip: fix casting overflow on 32-bit arch
LE Manh Cuong [Sat, 5 Jan 2019 16:39:24 +0000 (23:39 +0700)]
archive/zip: fix casting overflow on 32-bit arch

Fixes #29555

Change-Id: Ia3c0dd65bcf94dea3f6e04c23c1fe5d6d0b2c1e9
Reviewed-on: https://go-review.googlesource.com/c/156399
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd: vendor x/sys/unix into the stdlib
Keith Randall [Sun, 6 Jan 2019 19:33:23 +0000 (11:33 -0800)]
cmd: vendor x/sys/unix into the stdlib

upstream git hash: 1775db3f06b568179d273425900dd09125831dd5

Update #17490

Change-Id: I95e3c57137756c5c7a9b7334075caef66f205231
Reviewed-on: https://go-review.googlesource.com/c/156365
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/vendor: update to golang.org/x/tools@3ef68632
Daniel Martí [Sun, 6 Jan 2019 17:19:35 +0000 (18:19 +0100)]
cmd/vendor: update to golang.org/x/tools@3ef68632

Mainly to pull in the bug fix in the structtag pass, where filenames
could sometimes be wrong. The bug wasn't present in 1.11, so it was a
regression and needs fixing before 1.12 is out.

Fixes #29130.

Change-Id: Ie9d9bff84873f34d748ebd8f056b6bc2ac822a55
Reviewed-on: https://go-review.googlesource.com/c/156378
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 years agocrypto/x509: ignore harmless edge case in TestSystemRoots
Filippo Valsorda [Sat, 5 Jan 2019 00:27:08 +0000 (19:27 -0500)]
crypto/x509: ignore harmless edge case in TestSystemRoots

The no-cgo validation hack lets in certificates from the root store that
are not marked as roots themselves, but are signed by a root; the cgo
path correctly excludes them. When TestSystemRoots compares cgo and
no-cgo results it tries to ignore them by ignoring certificates which
pass validation, but expired certificates were failing validation.

Letting through expired certs is harmless anyway because we will refuse
to build chains to them.

Fixes #29497

Change-Id: I341e50c0f3426de2763468672f9ba1d13ad6cfba
Reviewed-on: https://go-review.googlesource.com/c/156330
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocrypto/x509: ignore 5 phantom 1024-bit roots in TestSystemRoots
Filippo Valsorda [Sat, 5 Jan 2019 00:09:01 +0000 (19:09 -0500)]
crypto/x509: ignore 5 phantom 1024-bit roots in TestSystemRoots

On macOS 10.11, but not 10.10 and 10.12, the C API returns 5 old root
CAs which are not in SystemRootCertificates.keychain (but seem to be in
X509Anchors and maybe SystemCACertificates.keychain, along with many
others that the C API does not return). They all are moribund 1024-bit
roots which are now gone from the Apple store.

Since we can't seem to find a way to make the no-cgo code see them,
ignore them rather than skipping the test.

Fixes #21416

Change-Id: I24ff0461f71cec953b888a60b05b99bc37dad2ed
Reviewed-on: https://go-review.googlesource.com/c/156329
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: modify swt.go to skip repeated walks of switch
David Chase [Fri, 4 Jan 2019 16:43:23 +0000 (11:43 -0500)]
cmd/compile: modify swt.go to skip repeated walks of switch

The compiler appears to contain several squirrelly corner
cases where nodes are double walked, some where new nodes
are created from walked parts.  Rather than trust that we
had searched hard enough for the last one, change
exprSwitch.walk() to return immediately if it has already
been walked.  This appears to be the only case where
double-walking a node is actually harmful.

Fixes #29562.

Change-Id: I0667e8769aba4c3236666cd836a934e256c0bfc5
Reviewed-on: https://go-review.googlesource.com/c/156317
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years agodoc/go1.12: remove known issue note
Filippo Valsorda [Fri, 4 Jan 2019 18:04:31 +0000 (13:04 -0500)]
doc/go1.12: remove known issue note

A workaround has been submitted.

Updates #27993

Change-Id: Ife6443c32673b38000b90dd2efb2985db37ab773
Reviewed-on: https://go-review.googlesource.com/c/156318
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoCONTRIBUTORS: first round of automated updates for Go 1.12
Dmitri Shuralyov [Fri, 4 Jan 2019 00:44:55 +0000 (19:44 -0500)]
CONTRIBUTORS: first round of automated updates for Go 1.12

These updates have been automatically generated using a modified
version of the updateac command with the following changes:

- code to automatically update the AUTHORS file has been removed,
since we're not updating that file automatically after Go 1.11
(see CL 128877)
- CLA checking code has been removed, since it was primarily needed
for updating the AUTHORS file
- instead of executing the misc/sortac binary, its code was embedded
into the updateac command itself

The modified updateac command will be added to x/build repository soon,
and the misc/sortac command can be removed afterwards.

Updates #12042

Change-Id: Ibf73068698b14b1aad4df4490747b488508ff5fd
Reviewed-on: https://go-review.googlesource.com/c/156278
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 years agodoc/go1.12: document RSA-PSS support in crypto/tls
Filippo Valsorda [Fri, 21 Dec 2018 21:57:42 +0000 (16:57 -0500)]
doc/go1.12: document RSA-PSS support in crypto/tls

Change-Id: I9350e5a72e3c375f6b76897708f09f1f50c7be14
Reviewed-on: https://go-review.googlesource.com/c/155482
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/go1.12: mention Conn.SetDeadline improvements, GODEBUG=madvdontneed=1
Brad Fitzpatrick [Wed, 2 Jan 2019 18:22:42 +0000 (18:22 +0000)]
doc/go1.12: mention Conn.SetDeadline improvements, GODEBUG=madvdontneed=1

Fixes #29439
Updates #28466

Change-Id: Ifa0779a089a969f99f1a47127e23565f31eec24f
Reviewed-on: https://go-review.googlesource.com/c/155929
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
6 years agocrypto/sha512: fix casting of d.nx in UnmarshalBinary
Jason LeBrun [Fri, 4 Jan 2019 00:21:15 +0000 (00:21 +0000)]
crypto/sha512: fix casting of d.nx in UnmarshalBinary

Fixes #29541

Change-Id: I006915b020b6e710298c32c05e3de77a7f9b54f3
GitHub-Last-Rev: c7a90a4bbe17fd1904c0942e8b343264fb85cba1
GitHub-Pull-Request: golang/go#29542
Reviewed-on: https://go-review.googlesource.com/c/156277
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: skip writes to persistent memory in cgo checker
Ian Lance Taylor [Sat, 22 Dec 2018 00:06:54 +0000 (16:06 -0800)]
runtime: skip writes to persistent memory in cgo checker

Fixes #23899
Fixes #28458

Change-Id: Ie177f2d4c399445d8d5e1a327f2419c7866cb45e
Reviewed-on: https://go-review.googlesource.com/c/155697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: work around "P has cached GC work" failures
Austin Clements [Thu, 3 Jan 2019 19:48:30 +0000 (14:48 -0500)]
runtime: work around "P has cached GC work" failures

We still don't understand what's causing there to be remaining GC work
when we enter mark termination, but in order to move forward on this
issue, this CL implements a work-around for the problem.

If debugCachedWork is false, this CL does a second check for remaining
GC work as soon as it stops the world for mark termination. If it
finds any work, it starts the world again and re-enters concurrent
mark. This will increase STW time by a small amount proportional to
GOMAXPROCS, but fixes a serious correctness issue.

This works-around #27993.

Change-Id: Ia23b85dd6c792ee8d623428bd1a3115631e387b8
Reviewed-on: https://go-review.googlesource.com/c/156140
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
6 years agocmd/go: fix failure in TestScript/build_runtime_gcflags
Jay Conrod [Thu, 3 Jan 2019 23:33:36 +0000 (18:33 -0500)]
cmd/go: fix failure in TestScript/build_runtime_gcflags

This test case failed on the longtest builder. It relied on
runtime/internal/atomic not being compiled with the -l flag in the
cache. The test case now creates its own GOCACHE, similar to
build_cache_compile and a few others.

Also, mention the correct issue the test case verifies.

Fixes #29395

Change-Id: Id50e9dfc50db03fb11582d3dd6b69c3e1ed750eb
Reviewed-on: https://go-review.googlesource.com/c/156237
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: proper panic tracebacks with mid-stack inlining
Keith Randall [Mon, 10 Dec 2018 20:49:19 +0000 (12:49 -0800)]
runtime: proper panic tracebacks with mid-stack inlining

As a followon to CL 152537, modify the panic-printing traceback
to also handle mid-stack inlining correctly.

Also declare -fm functions (aka method functions) as wrappers, so that
they get elided during traceback. This fixes part 2 of #26839.

Fixes #28640
Fixes #24488
Update #26839

Change-Id: I1c535a9b87a9a1ea699621be1e6526877b696c21
Reviewed-on: https://go-review.googlesource.com/c/153477
Reviewed-by: David Chase <drchase@google.com>
6 years agoruntime: don't scan go'd function args past length of ptr bitmap
Keith Randall [Thu, 3 Jan 2019 20:13:53 +0000 (12:13 -0800)]
runtime: don't scan go'd function args past length of ptr bitmap

Use the length of the bitmap to decide how much to pass to the
write barrier, not the total length of the arguments.

The test needs enough arguments so that two distinct bitmaps
get interpreted as a single longer bitmap.

Update #29362

Change-Id: I78f3f7f9ec89c2ad4678f0c52d3d3def9cac8e72
Reviewed-on: https://go-review.googlesource.com/c/156123
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agocrypto/sha256: fix casting of d.nx in UnmarshalBinary
Jason LeBrun [Thu, 3 Jan 2019 21:06:29 +0000 (21:06 +0000)]
crypto/sha256: fix casting of d.nx in UnmarshalBinary

Fixes #29517

Change-Id: I7e741d82bb9f8e6ab39b6d9ab37ba6163176a097
GitHub-Last-Rev: 764d0bd9579cd90868c6a134cbb06dda584474d7
GitHub-Pull-Request: golang/go#29519
Reviewed-on: https://go-review.googlesource.com/c/156118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: add test for go function argument scanning
Keith Randall [Thu, 3 Jan 2019 19:03:19 +0000 (11:03 -0800)]
runtime: add test for go function argument scanning

Derived from Naoki's reproducer.

Update #29362

Change-Id: I1cbd33b38a2f74905dbc22c5ecbad4a87a24bdd1
Reviewed-on: https://go-review.googlesource.com/c/156122
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: skip stack barrier copy when there are no pointers
Inada Naoki [Wed, 26 Dec 2018 15:47:20 +0000 (00:47 +0900)]
runtime: skip stack barrier copy when there are no pointers

After CL 31455, "go fun(n)" may put "n" to write barrier buffer
when there are no pointers in fun's arguments.

Fixes #29362

Change-Id: Icfa42b8759ce8ad9267dcb3859c626feb6fda381
Reviewed-on: https://go-review.googlesource.com/c/155779
Reviewed-by: Keith Randall <khr@golang.org>
6 years agoruntime: remove redundant slicing
Stepan Shabalin [Thu, 3 Jan 2019 10:55:15 +0000 (17:55 +0700)]
runtime: remove redundant slicing

In the twoNonZero function in hash_test, the buffer is sliced as [:] three times. This change deletes them.

Change-Id: I0701d0c810b4f3e267f80133a0dcdb4ed81fe356
Reviewed-on: https://go-review.googlesource.com/c/156138
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/go: respect gcflags, ldflags in 'go test'
Alessandro Arzilli [Wed, 19 Sep 2018 12:45:45 +0000 (14:45 +0200)]
cmd/go: respect gcflags, ldflags in 'go test'

Fixes bug introduced by https://golang.org/cl/129059 where
gcflags='all=...' and ldflags='all=...' would not be applied to some
packages built by 'go test'.

LoadImport used to set gcflags/ldflags for the Package objects it
created, in https://golang.org/cl/129059 this code was factored out to
setToolFlags. The codepath of `go build` was updated to call
setToolFlags appropriatley, but the codepath of `go test -c` wasn't,
resulting in gcflags/ldflags being applied inconsistently when building
tests.

This commit changes TestPackagesFor to call setToolFlags on the package
objects it creates.

Fixes #27681

Change-Id: Idcbec0c989ee96ec066207184611f08818873e8d
Reviewed-on: https://go-review.googlesource.com/c/136275
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
6 years agocmd/compile: fix no-op instruction used by s390x
Keith Randall [Mon, 31 Dec 2018 23:03:33 +0000 (15:03 -0800)]
cmd/compile: fix no-op instruction used by s390x

CL 152537 introduced a new use for ginsnop, the arch-dependent
routine that generates nops. The previous s390x nop clobbered flags.
It turns out the previous uses of this nop did not require flags
to be preserved, but the new use does.

Use a real nop: the 4-byte preferred nop.

Fixes #29453

Change-Id: I95310dfdd831932e26f5d5b6608324687f4c3162
Reviewed-on: https://go-review.googlesource.com/c/155926
Reviewed-by: Michael Munday <mike.munday@ibm.com>
6 years agonet: skip TestUDPZeroBytePayload on Darwin
Ian Lance Taylor [Thu, 3 Jan 2019 03:57:11 +0000 (19:57 -0800)]
net: skip TestUDPZeroBytePayload on Darwin

Updates #29225

Change-Id: I4c9b7a108861ce5c9ab84f7324ced3da51e7bf2a
Reviewed-on: https://go-review.googlesource.com/c/156119
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: go1.12: clarify use of MADV_FREE
Ian Lance Taylor [Thu, 20 Dec 2018 23:30:31 +0000 (15:30 -0800)]
doc: go1.12: clarify use of MADV_FREE

Fixes #29337

Change-Id: I1d632d19058c63dac8e25d2a5ad55555c1aec9d4
Reviewed-on: https://go-review.googlesource.com/c/155438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: Update ssa/debug_test reference files for delve and gdb
David Chase [Wed, 2 Jan 2019 21:52:49 +0000 (16:52 -0500)]
cmd/compile: Update ssa/debug_test reference files for delve and gdb

Recent changes to compiler backtraces perturbed the line
number assignment, some better, some worse, probably net
worse.  For purposes of passing the long tests, update the
reference files (delve's file was also stale).

TODO: Figure out a less delicate way to locate statement
boundaries for 1.13.

Fixes #29511.

Change-Id: If0e488341d848ba6012045b126c86b1250408d65
Reviewed-on: https://go-review.googlesource.com/c/156021
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix format test
Cherry Zhang [Wed, 2 Jan 2019 21:16:49 +0000 (16:16 -0500)]
cmd/compile: fix format test

CL 156019 adds some debug output, including printing ssa.relation
as string. Update the map.

Change-Id: I0299d2008d199da10d86e5b47a50385b3a314c68
Reviewed-on: https://go-review.googlesource.com/c/156020
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoapi: add os.(*File).SyscallConn to go1.12.txt
Brad Fitzpatrick [Wed, 2 Jan 2019 19:16:43 +0000 (19:16 +0000)]
api: add os.(*File).SyscallConn to go1.12.txt

Fixes #29507

Change-Id: I8cf52e4b89fd28126f252757260d07a31d9dad61
Reviewed-on: https://go-review.googlesource.com/c/155933
Reviewed-by: Katie Hockman <katie@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

6 years agoruntime: add GODEBUG=madvdontneed=1
Brad Fitzpatrick [Wed, 2 Jan 2019 18:47:06 +0000 (18:47 +0000)]
runtime: add GODEBUG=madvdontneed=1

Fixes #28466

Change-Id: I05b2e0da09394d111913963b60f2ec865c9b4744
Reviewed-on: https://go-review.googlesource.com/c/155931
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoruntime: don't spin in checkPut if non-preemptible
Austin Clements [Mon, 31 Dec 2018 01:04:16 +0000 (20:04 -0500)]
runtime: don't spin in checkPut if non-preemptible

Currently it's possible for the runtime to deadlock if checkPut is
called in a non-preemptible context. In this case, checkPut may spin,
so it won't leave the non-preemptible context, but the thread running
gcMarkDone needs to preempt all of the goroutines before it can
release the checkPut spin loops.

Fix this by returning from checkPut if it's called under any of the
conditions that would prevent gcMarkDone from preempting it. In this
case, it leaves a note behind that this happened; if the runtime does
later detect left-over work it can at least indicate that it was
unable to catch it in the act.

For #27993.
Updates #29385 (may fix it).

Change-Id: Ic71c10701229febb4ddf8c104fb10e06d84b122e
Reviewed-on: https://go-review.googlesource.com/c/156017
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
6 years agocmd/dist: list only supported platforms
Tobias Klauser [Fri, 28 Dec 2018 10:46:35 +0000 (11:46 +0100)]
cmd/dist: list only supported platforms

Introduce an incomplete map in dist alongside cgoEnabled and filter out
the incomplete ports in 'dist list'.

Fixes #28944

Change-Id: I15aae56aec570e1cd9e28906900cd5ba0db77811
Reviewed-on: https://go-review.googlesource.com/c/155839
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile: fix deriving from x+d >= w on overflow in prove pass
Cherry Zhang [Wed, 2 Jan 2019 17:27:55 +0000 (12:27 -0500)]
cmd/compile: fix deriving from x+d >= w on overflow in prove pass

In the case of x+d >= w, where d and w are constants, we are
deriving x is within the bound of min=w-d and max=maxInt-d. When
there is an overflow (min >= max), we know only one of x >= min
or x <= max is true, and we derive this by excluding the other.
When excluding x >= min, we did not consider the equal case, so
we could incorrectly derive x <= max when x == min.

Fixes #29502.

Change-Id: Ia9f7d814264b1a3ddf78f52e2ce23377450e6e8a
Reviewed-on: https://go-review.googlesource.com/c/156019
Reviewed-by: David Chase <drchase@google.com>
6 years agoruntime: disable GDB tests on freebsd/arm for now
Brad Fitzpatrick [Wed, 2 Jan 2019 18:53:23 +0000 (18:53 +0000)]
runtime: disable GDB tests on freebsd/arm for now

Updates #29508
Updates #28679

Change-Id: I19bc9f88aeb2b1f3e69856173a00c5a4d5ed3613
Reviewed-on: https://go-review.googlesource.com/c/155932
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
6 years agonet/http/httputil: fix missing previous headers in response when switching protocol...
Julien Salleyron [Wed, 2 Jan 2019 16:29:49 +0000 (16:29 +0000)]
net/http/httputil: fix missing previous headers in response when switching protocol in ReverseProxy

When using switching protocol, previous headers set before the reverse proxy are lost.

Fixes #29407

Change-Id: Ia2b9784022d9bccef8625519ccbabbe8a276dfc0
GitHub-Last-Rev: 79bb493dcbb9b76d9d2ff9cd0854b29d634f8b73
GitHub-Pull-Request: golang/go#29408
Reviewed-on: https://go-review.googlesource.com/c/155741
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoruntime: fix string formatting
Daniel Ingram [Sat, 22 Dec 2018 22:11:25 +0000 (22:11 +0000)]
runtime: fix string formatting

Change-Id: I87d0bc78a246e479d97b3f83cf77c1f701975413
GitHub-Last-Rev: 22cd684e08464f0e01f1cba2235443371dba3a5d
GitHub-Pull-Request: golang/go#29157
Reviewed-on: https://go-review.googlesource.com/c/153298
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
6 years agonet/url: clarify documentation about (*URL).String
Agniva De Sarker [Fri, 21 Dec 2018 08:48:50 +0000 (14:18 +0530)]
net/url: clarify documentation about (*URL).String

Fixes #23669

Change-Id: Ib7f0aab0b066f778a3097583f432f8092310fb81
Reviewed-on: https://go-review.googlesource.com/c/155598
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/compile/internal/gc: remove unused methodbyname type
Iskander Sharipov [Sat, 29 Dec 2018 20:16:01 +0000 (23:16 +0300)]
cmd/compile/internal/gc: remove unused methodbyname type

methodbyname was used for sorting in bexport.go, until
https://golang.org/cl/139338 removed the code that
invoked sorting function.

R=1.13

Change-Id: I13e313fb60111a142ed3883d81916af254445fdc
Reviewed-on: https://go-review.googlesource.com/c/155959
Run-TryBot: Iskander Sharipov <quasilyte@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: fix notetsleepg deadline on js/wasm
Richard Musiol [Tue, 11 Dec 2018 12:59:18 +0000 (13:59 +0100)]
runtime: fix notetsleepg deadline on js/wasm

A notetsleepg may get stuck if its timeout callback gets invoked
exactly on its deadline due to low precision of nanotime. This change
fixes the comparison so it also resolves the note if the timestamps are
equal.

Updates #28975

Change-Id: I045d2f48b7f41cea0caec19b56876e9de01dcd6c
Reviewed-on: https://go-review.googlesource.com/c/153558
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: fix REFLECTMETHOD macro
Michael McLoughlin [Tue, 1 Jan 2019 01:14:54 +0000 (17:14 -0800)]
runtime: fix REFLECTMETHOD macro

Removes spurious equals sign from REFLECTMETHOD macro.

Fixes #29487

Change-Id: Iaa3d85ff57087aa79a259f28816f8b0a552536f3
Reviewed-on: https://go-review.googlesource.com/c/155927
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: 2019 is the Year of the Gopher
Josh Bleecher Snyder [Tue, 1 Jan 2019 04:43:38 +0000 (18:43 -1000)]
doc: 2019 is the Year of the Gopher

whereas this is a longstanding tradition
and insofaras it is worth continuing such traditions
and notwithstanding an attempt at future-proofing
thetruthofthematter is that I have been waiting for years to send this change
so despiteallobjections I have updated the copyright year.

Change-Id: I55961b15a7eda35d84fdd9250afdbe19f0bf8412
Reviewed-on: https://go-review.googlesource.com/c/155928
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agostrconv: make docs for Itoa and Atoi slightly higher level
Josh Bleecher Snyder [Sun, 30 Dec 2018 18:22:27 +0000 (08:22 -1000)]
strconv: make docs for Itoa and Atoi slightly higher level

Fixes #29461

Change-Id: I5db8bc80e5bd0778dced8471581c67e66853aada
Reviewed-on: https://go-review.googlesource.com/c/155924
Reviewed-by: Rob Pike <r@golang.org>
6 years agosyscall: revert to pre-FreeBSD 10 / POSIX-2008 timespec field names in Stat_t on...
Yuval Pavel Zholkover [Sat, 29 Dec 2018 12:27:15 +0000 (14:27 +0200)]
syscall: revert to pre-FreeBSD 10 / POSIX-2008 timespec field names in Stat_t on FreeBSD

CL 138595 introduced the new names when the hardcoded stat8 definitions was replaced
with a cgo generated one.

Fixes #29393
Updates #22448

Change-Id: I6309958306329ff301c17344b2e0ead0cc874224
Reviewed-on: https://go-review.googlesource.com/c/155958
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agostrconv: add missing package name into doc.go(godoc overview)
Hidetatsu Yaginuma [Sun, 30 Dec 2018 07:03:53 +0000 (16:03 +0900)]
strconv: add missing package name into doc.go(godoc overview)

Change-Id: I336ad707a85bf0c81b6c2230c90452c0b3b92924
Reviewed-on: https://go-review.googlesource.com/c/155998
Reviewed-by: Robert Griesemer <gri@golang.org>