]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
4 years ago[dev.link] all: merge branch 'master' into dev.link
Cherry Zhang [Thu, 11 Jun 2020 20:49:19 +0000 (16:49 -0400)]
[dev.link] all: merge branch 'master' into dev.link

Change-Id: I446db56b20ef2189e23e225a91a17736c1d11e4c

4 years agocmd/go/internal/web: don't follow an infinite number of redirects
Baokun Lee [Tue, 9 Jun 2020 15:03:35 +0000 (23:03 +0800)]
cmd/go/internal/web: don't follow an infinite number of redirects

We replaced http.DefaultClient with securityPreservingHTTPClient,
but we still need that too many redirects check. This issue introduced
by CL 156838.

We introduce a special path to test rediret requests in the script test
framework. You can specify the number of redirects in the path.

$GOPROXY/redirect/<count>/...

Redirect request sequence details(count=8):

 request:  $GOPROXY/mod/redirect/8/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/7/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/6/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/5/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/4/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/3/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/2/rsc.io/quote/@v/v1.2.0.mod
redirect:  $GOPROXY/mod/redirect/1/rsc.io/quote/@v/v1.2.0.mod
the last:  $GOPROXY/mod/rsc.io/quote/@v/v1.2.0.mod

Fixes #39482

Change-Id: I149a3702b2b616069baeef787b2e4b73afc93b0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/237177
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agoA+C: add Vee Zhang (individual CLA)
Vee Zhang [Thu, 11 Jun 2020 04:39:49 +0000 (04:39 +0000)]
A+C: add Vee Zhang (individual CLA)

Change-Id: Id52c5fef2e5b65056d3c87e70e176b67998cea90
GitHub-Last-Rev: b88e3afa38d96a5a51334100bb29108c5f2618f4
GitHub-Pull-Request: golang/go#39520
Reviewed-on: https://go-review.googlesource.com/c/go/+/237223
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agogo/types: rename UsesCgo to go115UsesCgo
Matthew Dempsky [Wed, 10 Jun 2020 19:47:23 +0000 (12:47 -0700)]
go/types: rename UsesCgo to go115UsesCgo

This API and functionality was added late in the Go 1.15 release
cycle, and use within gopls has revealed some shortcomings. It's
possible (but not decided) that we'll want a different API long-term,
so for now this CL renames UsesCgo to a non-exported name to avoid
long-term commitment under the Go 1 compat guarantee.

Updates #16623.
Updates #39072.

Change-Id: I04bc0c161a84adebe43e926df5df406bc794c3db
Reviewed-on: https://go-review.googlesource.com/c/go/+/237417
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
4 years agocmd/internal/objabi: enable frame-pointer for iOS arm64
Gawen Arab [Wed, 10 Jun 2020 20:31:57 +0000 (20:31 +0000)]
cmd/internal/objabi: enable frame-pointer for iOS arm64

This improves stack unwinding of Go code running on iOS arm64.

Change-Id: I0494f750c15dcb895f9d4a072352f050d731df17
GitHub-Last-Rev: 435a2a1690dad98975f7463f91241831cd73d3df
GitHub-Pull-Request: golang/go#37403
Reviewed-on: https://go-review.googlesource.com/c/go/+/220588
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agoruntime: fix typo in FuncForPC doc go1.15beta1
Rodolfo Carvalho [Wed, 10 Jun 2020 13:30:42 +0000 (13:30 +0000)]
runtime: fix typo in FuncForPC doc

Change-Id: I04037e13b131e79ebc5af84896bfeda49ddc0eaa
GitHub-Last-Rev: b0d0de930862e4f163e158876cba70d81ed2d52e
GitHub-Pull-Request: golang/go#39500
Reviewed-on: https://go-review.googlesource.com/c/go/+/237220
Reviewed-by: Keith Randall <khr@golang.org>
4 years agocmd/compile: always tighten and de-duplicate tuple selectors
Michael Munday [Tue, 9 Jun 2020 10:17:17 +0000 (03:17 -0700)]
cmd/compile: always tighten and de-duplicate tuple selectors

The scheduler assumes two special invariants that apply to tuple
selectors (Select0 and Select1 ops):

  1. There is only one tuple selector of each type per generator.
  2. Tuple selectors and generators reside in the same block.

Prior to this CL the assumption was that these invariants would
only be broken by the CSE pass. The CSE pass therefore contained
code to move and de-duplicate selectors to fix these invariants.

However it is also possible to write relatively basic optimization
rules that cause these invariants to be broken. For example:

  (A (Select0 (B))) -> (Select1 (B))

This rule could result in the newly added selector (Select1) being
in a different block to the tuple generator (see issue #38356). It
could also result in duplicate selectors if this rule matches
multiple times for the same tuple generator (see issue #39472).

The CSE pass will 'fix' these invariants. However it will only do
so when optimizations are enabled (since disabling optimizations
disables the CSE pass).

This CL moves the CSE tuple selector fixup code into its own pass
and makes it mandatory even when optimizations are disabled. This
allows tuple selectors to be treated like normal ops for most of
the compilation pipeline until after the new pass has run, at which
point we need to be careful to maintain the invariant again.

Fixes #39472.

Change-Id: Ia3f79e09d9c65ac95f897ce37e967ee1258a080b
Reviewed-on: https://go-review.googlesource.com/c/go/+/237118
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agorun.bat: do not unset GOROOT_FINAL before running tests
Bryan C. Mills [Wed, 10 Jun 2020 02:00:18 +0000 (22:00 -0400)]
run.bat: do not unset GOROOT_FINAL before running tests

This removes the same logic from run.bat that was removed from
cmd/dist in CL 236819.

The duplicated logic was removed from run.bash and run.rc in CL 6531,
but that part of run.bat was apparently missed (and not noticed
because its effect was redundant).

Also fix a path-separator bug in cmd/addr2line.TestAddr2Line that was
exposed as a result.

Fixes #39478
Updates #39385

Change-Id: I00054966cf92ef92a03681bf23de7f45f46fbb5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/237359
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc: document encoding/xml change in CL 203417
Russ Cox [Fri, 5 Jun 2020 17:51:17 +0000 (13:51 -0400)]
doc: document encoding/xml change in CL 203417

Change-Id: Ibc0228f166f449ec28d813f33bdb550fe7ba2b3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236739
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocrypto/tls: restore OCSP and SCTs during session resumption
Roland Shoemaker [Fri, 15 May 2020 19:49:04 +0000 (12:49 -0700)]
crypto/tls: restore OCSP and SCTs during session resumption

Restore previously sent SCTs and stapled OCSP response during session
resumption for both TLS 1.2 and 1.3. This behavior is somewhat
complicated for TLS 1.2 as SCTs are sent during the server hello,
so they override what is saved in ClientSessionState. It is likely
that if the server is sending a different set of SCTs there is probably
a reason for doing so, such as a log being retired, or SCT validation
requirements changing, so it makes sense to defer to the server in
that case.

Fixes #39075

Change-Id: I3c0fa2f69c6bf0247a447c48a1b4c733a882a233
Reviewed-on: https://go-review.googlesource.com/c/go/+/234237
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agoapi: promote next to go1.15
Alexander Rakoczy [Tue, 9 Jun 2020 20:17:46 +0000 (16:17 -0400)]
api: promote next to go1.15

Change-Id: I42e0d096b28614b95b0af21144f8f118e3eafcd5
Reviewed-on: https://go-review.googlesource.com/c/go/+/237297
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
4 years agoruntime: fix typo in comment (object -> objects)
Brad Fitzpatrick [Tue, 9 Jun 2020 16:11:11 +0000 (09:11 -0700)]
runtime: fix typo in comment (object -> objects)

Change-Id: I2af1f9dcd1a9609681e58ab07e73e6d7a5f8a12b
Reviewed-on: https://go-review.googlesource.com/c/go/+/237160
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agointernal/poll: correct function name in comment
Vee Zhang [Tue, 9 Jun 2020 08:03:13 +0000 (08:03 +0000)]
internal/poll: correct function name in comment

Change-Id: I3b28a45e942a6d6032855758fcc41e4edd64aa32
GitHub-Last-Rev: 9c994bbee7420861b5dc83e71e50fc43d7f6650b
GitHub-Pull-Request: golang/go#39467
Reviewed-on: https://go-review.googlesource.com/c/go/+/237059
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc/go1.15: add remaining release notes for net/http and net/http/httputil
Filippo Valsorda [Tue, 9 Jun 2020 01:19:01 +0000 (21:19 -0400)]
doc/go1.15: add remaining release notes for net/http and net/http/httputil

Updates #37419

Change-Id: I3e37b650475aad4430aacd4655c02e5081ca6f5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/237019
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/asm: fix the encoding error of VCNT instruction for arm64
eric fang [Mon, 8 Jun 2020 03:19:43 +0000 (03:19 +0000)]
cmd/asm: fix the encoding error of VCNT instruction for arm64

When the arrangement specifier is "B16", the 30-bit should be 1 rather than 0.
This CL fixes this error.

Fixes #39445

Change-Id: Ib44881cdb8b3aab855cb30f2c52a085cd73a6a2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/236638
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/compile: ARM comparisons with 0 incorrect on overflow
Xiangdong Ji [Mon, 1 Jun 2020 11:01:14 +0000 (11:01 +0000)]
cmd/compile: ARM comparisons with 0 incorrect on overflow

Some ARM rewriting rules convert 'comparing to zero' conditions of if
statements to a simplified version utilizing CMN and CMP instructions to
branch over condition flags, in order to save one Add or Sub caculation.

Such optimizations lead to wrong branching in case an overflow/underflow
occurs when executing CMN or CMP.

Fix the issue by introducing new block opcodes that don't honor the
overflow/underflow flag:

  Block-Op         Meaning                   ARM condition codes
  1. LTnoov        less than                 MI
  2. GEnoov        greater than or equal     PL
  3. LEnoov        less than or equal        MI || EQ
  4. GTnoov        greater than              NEQ & PL

The patch also adds a few test cases to cover scenarios that are specific
to ARM and fine-tunes the code generation tests for 'x-const'.

For more details please refer to the previous fix on 64-bit ARM:
  https://go-review.googlesource.com/c/go/+/233097

Go1 perf, 'old' is the non-optimized version, that is removing all concerned
rewriting rules.

name                     old time/op    new time/op     delta
BinaryTree17-8              7.73s ± 0%      7.81s ± 0%  +0.97%  (p=0.000 n=7+8)
Fannkuch11-8                7.06s ± 0%      7.00s ± 0%  -0.83%  (p=0.000 n=8+8)
FmtFprintfEmpty-8           181ns ± 1%      183ns ± 1%  +1.31%  (p=0.001 n=8+8)
FmtFprintfString-8          319ns ± 1%      325ns ± 2%  +1.71%  (p=0.009 n=7+8)
FmtFprintfInt-8             358ns ± 1%      359ns ± 1%    ~     (p=0.293 n=7+7)
FmtFprintfIntInt-8          459ns ± 3%      456ns ± 1%    ~     (p=0.869 n=8+8)
FmtFprintfPrefixedInt-8     535ns ± 4%      538ns ± 4%    ~     (p=0.572 n=8+8)
FmtFprintfFloat-8          1.01µs ± 2%     1.01µs ± 2%    ~     (p=0.625 n=8+8)
FmtManyArgs-8              1.93µs ± 2%     1.93µs ± 1%    ~     (p=0.979 n=8+7)
GobDecode-8                16.1ms ± 1%     16.5ms ± 1%  +2.32%  (p=0.000 n=8+8)
GobEncode-8                15.9ms ± 0%     15.8ms ± 1%  -1.00%  (p=0.000 n=8+7)
Gzip-8                      690ms ± 1%      670ms ± 0%  -2.90%  (p=0.000 n=8+8)
Gunzip-8                    109ms ± 1%      109ms ± 1%    ~     (p=0.694 n=7+8)
HTTPClientServer-8          149µs ± 3%      146µs ± 2%  -1.70%  (p=0.028 n=8+8)
JSONEncode-8               50.5ms ± 1%     49.2ms ± 0%  -2.60%  (p=0.001 n=7+7)
JSONDecode-8                135ms ± 2%      137ms ± 1%    ~     (p=0.054 n=8+7)
Mandelbrot200-8             951ms ± 0%      952ms ± 0%    ~     (p=0.852 n=6+8)
GoParse-8                  9.47ms ± 1%     9.66ms ± 1%  +2.01%  (p=0.000 n=8+8)
RegexpMatchEasy0_32-8       288ns ± 2%      277ns ± 2%  -3.61%  (p=0.000 n=8+8)
RegexpMatchEasy0_1K-8      1.66µs ± 1%     1.69µs ± 2%  +2.21%  (p=0.001 n=7+7)
RegexpMatchEasy1_32-8       334ns ± 1%      305ns ± 2%  -8.86%  (p=0.000 n=8+8)
RegexpMatchEasy1_1K-8      2.14µs ± 2%     2.15µs ± 0%    ~     (p=0.099 n=8+8)
RegexpMatchMedium_32-8     13.3ns ± 1%     13.3ns ± 0%    ~     (p=1.000 n=7+7)
RegexpMatchMedium_1K-8     81.1µs ± 3%     80.7µs ± 1%    ~     (p=0.955 n=7+8)
RegexpMatchHard_32-8       4.26µs ± 0%     4.26µs ± 0%    ~     (p=0.933 n=7+8)
RegexpMatchHard_1K-8        124µs ± 0%      124µs ± 0%  +0.31%  (p=0.000 n=8+8)
Revcomp-8                  14.7ms ± 2%     14.5ms ± 1%  -1.66%  (p=0.003 n=8+8)
Template-8                  197ms ± 2%      200ms ± 3%  +1.62%  (p=0.021 n=8+8)
TimeParse-8                1.33µs ± 1%     1.30µs ± 1%  -1.86%  (p=0.002 n=8+8)
TimeFormat-8               3.04µs ± 1%     3.02µs ± 0%  -0.60%  (p=0.000 n=8+8)

name                     old speed      new speed       delta
GobDecode-8              47.6MB/s ± 1%   46.5MB/s ± 1%  -2.28%  (p=0.000 n=8+8)
GobEncode-8              48.1MB/s ± 0%   48.6MB/s ± 1%  +1.02%  (p=0.000 n=8+7)
Gzip-8                   28.1MB/s ± 1%   29.0MB/s ± 0%  +2.97%  (p=0.000 n=8+8)
Gunzip-8                  178MB/s ± 1%    179MB/s ± 2%    ~     (p=0.694 n=7+8)
JSONEncode-8             38.4MB/s ± 1%   39.4MB/s ± 0%  +2.67%  (p=0.001 n=7+7)
JSONDecode-8             14.3MB/s ± 2%   14.2MB/s ± 1%  -0.81%  (p=0.043 n=8+7)
GoParse-8                6.12MB/s ± 1%   5.99MB/s ± 1%  -2.00%  (p=0.000 n=8+8)
RegexpMatchEasy0_32-8     111MB/s ± 2%    115MB/s ± 2%  +3.77%  (p=0.000 n=8+8)
RegexpMatchEasy0_1K-8     618MB/s ± 1%    604MB/s ± 2%  -2.16%  (p=0.001 n=7+7)
RegexpMatchEasy1_32-8    95.7MB/s ± 1%  105.1MB/s ± 2%  +9.76%  (p=0.000 n=8+8)
RegexpMatchEasy1_1K-8     479MB/s ± 2%    477MB/s ± 0%    ~     (p=0.105 n=8+8)
RegexpMatchMedium_32-8   75.2MB/s ± 1%   75.2MB/s ± 0%    ~     (p=0.247 n=7+7)
RegexpMatchMedium_1K-8   12.6MB/s ± 3%   12.7MB/s ± 1%    ~     (p=0.538 n=7+8)
RegexpMatchHard_32-8     7.52MB/s ± 0%   7.52MB/s ± 0%    ~     (p=0.968 n=7+8)
RegexpMatchHard_1K-8     8.26MB/s ± 0%   8.24MB/s ± 0%  -0.30%  (p=0.001 n=8+8)
Revcomp-8                 173MB/s ± 2%    176MB/s ± 1%  +1.68%  (p=0.003 n=8+8)
Template-8               9.85MB/s ± 2%   9.69MB/s ± 3%  -1.59%  (p=0.021 n=8+8)

Fixes   #39303
Updates #38740

Change-Id: I0a5f87bfda679f66414c0041ace2ca2e28363f36
Reviewed-on: https://go-review.googlesource.com/c/go/+/236637
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agodoc/go1.15: remove TODO in minor library changes section
Dmitri Shuralyov [Tue, 9 Jun 2020 14:26:09 +0000 (14:26 +0000)]
doc/go1.15: remove TODO in minor library changes section

The minor changes to the library section has been populated
with TODOs for individual packages using relnote in CL 235757,
and they've been resolved in the following CLs.

We will look things over as part of finishing touches on
the release notes, but this TODO is resolved for beta 1.

For #37419.

Change-Id: I942f81a957fe8df8f630b4406ca29f73602d080a
Reviewed-on: https://go-review.googlesource.com/c/go/+/237157
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
4 years agocmd/dist: do not unset GOROOT_FINAL prior to running tests
Bryan C. Mills [Fri, 5 Jun 2020 20:08:08 +0000 (16:08 -0400)]
cmd/dist: do not unset GOROOT_FINAL prior to running tests

Also do not unset it by default in the tests for cmd/go.

GOROOT_FINAL affects the GOROOT value embedded in binaries,
such as 'cmd/cgo'. If its value changes and a build command
is performed that depends on one of those binaries, the binary
would be spuriously rebuilt.

Instead, only unset it in the specific tests that make assumptions
about the GOROOT paths embedded in specific compiled binaries.
That may cause those tests to do a little extra rebuilding when
GOROOT_FINAL is set, but that little bit of extra rebuilding
seems preferable to spuriously-stale binaries.

Fixes #39385

Change-Id: I7c87b1519bb5bcff64babf1505fd1033ffa4f4fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/236819
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoos: always check for EINTR in calls to open
Ian Lance Taylor [Mon, 8 Jun 2020 21:35:07 +0000 (14:35 -0700)]
os: always check for EINTR in calls to open

For #11180
For #20400
For #39237

Change-Id: I8de97517c8f92c08f0c8a51f651a17e31617979b
Reviewed-on: https://go-review.googlesource.com/c/go/+/236997
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoall: avoid awkward wording from CL 236857
Russ Cox [Mon, 8 Jun 2020 16:39:56 +0000 (12:39 -0400)]
all: avoid awkward wording from CL 236857

CL 236857 removed all uses of whitelist/blacklist, which is great.
But it substituted awkward phrasing using allowlist/blocklist,
especially as verbs or participles. This CL uses more standard English,
like "allow the function" or "blocked functions" instead of
"allowlist the function" or "blocklisted functions".

Change-Id: I9106a2fdbd62751c4cbda3a77181358a8a6d0f13
Reviewed-on: https://go-review.googlesource.com/c/go/+/236917
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc/go1.15: add more release notes for crypto/tls
Filippo Valsorda [Mon, 8 Jun 2020 17:58:12 +0000 (13:58 -0400)]
doc/go1.15: add more release notes for crypto/tls

Updates #37419

Change-Id: I5e03adbf6d215d65aedbdeb7bdfe1ead8a838877
Reviewed-on: https://go-review.googlesource.com/c/go/+/236921
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agocmd/go: remove a bogus assertion in mod_convert_dep
Bryan C. Mills [Sat, 6 Jun 2020 02:35:18 +0000 (22:35 -0400)]
cmd/go: remove a bogus assertion in mod_convert_dep

The removed line assumed that the script's WORK directory is not a
child of any directory containing version-control metadata.
While that assumption does hold in most cases, it does not hold when,
for example, $TMPDIR is $HOME/tmp and $HOME/.git/config exists.

A similar situation may or may not arise when using
golang.org/x/build/cmd/release. Either way, the assertion is incorrect
and was interfering with local testing for #39385.

Updates #39385
Fixes #39431

Change-Id: I67813d7ce455aa9b56a6eace6eddebf48d0f7fa6
Reviewed-on: https://go-review.googlesource.com/c/go/+/236818
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc/go1.15: add release notes for crypto and math/big
Filippo Valsorda [Mon, 8 Jun 2020 17:07:39 +0000 (13:07 -0400)]
doc/go1.15: add release notes for crypto and math/big

Updates #37419

Change-Id: I12f073697dc319e439f4ffe4e0aac7f6afb19a74
Reviewed-on: https://go-review.googlesource.com/c/go/+/236918
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agodoc/go1.15: add release notes for crypto/x509
Filippo Valsorda [Fri, 5 Jun 2020 16:48:26 +0000 (12:48 -0400)]
doc/go1.15: add release notes for crypto/x509

Updates #37419

Change-Id: Iedfd4b238980675be115c7e6e0a327d7745b5bed
Reviewed-on: https://go-review.googlesource.com/c/go/+/236737
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc/go1.15: add release notes for crypto/tls
Katie Hockman [Tue, 2 Jun 2020 19:52:51 +0000 (15:52 -0400)]
doc/go1.15: add release notes for crypto/tls

Updates #37419

Change-Id: Ie81c0b03716799c132e90dc231ab816e6ae43469
Reviewed-on: https://go-review.googlesource.com/c/go/+/236166
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: always mark span when marking an object
Austin Clements [Sat, 6 Jun 2020 02:01:25 +0000 (22:01 -0400)]
runtime: always mark span when marking an object

The page sweeper depends on spans being marked if any object in the
span is marked, but currently only greyobject does this.
gcmarknewobject and wbBufFlush1 also mark objects, but neither set
span marks. As a result, if there are live objects on a span, but
they're all marked via allocation or write barriers, then the span
itself won't be marked and the page reclaimer will free the span,
ultimately leading to memory corruption when the memory for those live
allocations gets reused.

Fix this by making gcmarknewobject and wbBufFlush1 also mark pages.

No test because I have no idea how to reliably (or even unreliably)
trigger this.

Fixes #39432.

Performance is a wash or very slightly worse. I benchmarked the
gcmarknewobject and wbBufFlush1 changes independently and both showed
a slight performance improvement, so I'm going to call this noise.

name                                old time/op  new time/op  delta
BiogoIgor                            15.9s ± 2%   15.9s ± 2%    ~     (p=0.758 n=25+25)
BiogoKrishna                         15.7s ± 3%   15.7s ± 3%    ~     (p=0.382 n=21+21)
BleveIndexBatch100                   4.94s ± 3%   5.07s ± 4%  +2.63%  (p=0.000 n=25+25)
CompileTemplate                      204ms ± 1%   205ms ± 1%  +0.43%  (p=0.000 n=21+23)
CompileUnicode                      77.8ms ± 1%  78.1ms ± 1%    ~     (p=0.130 n=23+23)
CompileGoTypes                       731ms ± 1%   733ms ± 1%  +0.30%  (p=0.006 n=22+22)
CompileCompiler                      3.64s ± 2%   3.65s ± 3%    ~     (p=0.179 n=24+25)
CompileSSA                           8.44s ± 1%   8.46s ± 1%  +0.30%  (p=0.003 n=22+23)
CompileFlate                         132ms ± 1%   133ms ± 1%    ~     (p=0.098 n=22+22)
CompileGoParser                      164ms ± 1%   164ms ± 1%  +0.37%  (p=0.000 n=21+23)
CompileReflect                       455ms ± 1%   457ms ± 2%  +0.50%  (p=0.002 n=20+22)
CompileTar                           182ms ± 2%   182ms ± 1%    ~     (p=0.382 n=22+22)
CompileXML                           245ms ± 3%   245ms ± 1%    ~     (p=0.070 n=21+23)
CompileStdCmd                        16.5s ± 2%   16.5s ± 3%    ~     (p=0.486 n=23+23)
FoglemanFauxGLRenderRotateBoat       12.9s ± 1%   13.0s ± 1%  +0.97%  (p=0.000 n=21+24)
FoglemanPathTraceRenderGopherIter1   18.6s ± 1%   18.7s ± 0%    ~     (p=0.083 n=23+24)
GopherLuaKNucleotide                 28.4s ± 1%   29.3s ± 1%  +2.84%  (p=0.000 n=25+25)
MarkdownRenderXHTML                  252ms ± 0%   251ms ± 1%  -0.50%  (p=0.000 n=23+24)
Tile38WithinCircle100kmRequest       516µs ± 2%   516µs ± 2%    ~     (p=0.763 n=24+25)
Tile38IntersectsCircle100kmRequest   689µs ± 2%   689µs ± 2%    ~     (p=0.617 n=24+24)
Tile38KNearestLimit100Request        608µs ± 1%   606µs ± 2%  -0.35%  (p=0.030 n=19+22)
[Geo mean]                           522ms        524ms       +0.41%

https://perf.golang.org/search?q=upload:20200606.4

Change-Id: I8b331f310dbfaba0468035f207467c8403005bf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/236817
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 years agocrypto/x509: match RFC suggested SKID generation method
Roland Shoemaker [Sun, 7 Jun 2020 15:32:28 +0000 (08:32 -0700)]
crypto/x509: match RFC suggested SKID generation method

Rather than hashing the encoding of the SPKI structure, hash the
bytes of the public key itself.

Fixes #39429

Change-Id: I55a0f8f08ab1f1b5702590b47d8b9a92d1dbcc1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236878
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agocmd/internal/moddeps: don't skip directories if there are unusual files
Dmitri Shuralyov [Thu, 4 Jun 2020 23:20:01 +0000 (19:20 -0400)]
cmd/internal/moddeps: don't skip directories if there are unusual files

Previously, if there was a non-directory file with the name vendor or
testdata in the Go source tree, it was possible for some directories
to be skipped by filepath.Walk performed in findGorootModules.

As unusual and unlikely as such non-directory files are, it's better
to ensure all directories are visited, and all modules in the GOROOT
source tree are found.

This increases confidence that tests relying on findGorootModule
will not have unexpected false negatives.

For #36851.
For #36907.

Change-Id: I468e80d8f57119e2c72d546b3fd1e23c31fd6e6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/236600
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoall: treat all files as binary, but check in .bat with CRLF
Dmitri Shuralyov [Thu, 4 Jun 2020 04:35:09 +0000 (00:35 -0400)]
all: treat all files as binary, but check in .bat with CRLF

This is a followup to CL 96495.

It should be simpler and more robust to achieve .bat files having
CRLF line endings by treating it as a binary file, like all other
files, and checking it in with the desired CRLF line endings.

A test is used to check the entire Go tree, short of directories
starting with "." and named "testdata", for any .bat files that
have anything other than strict CRLF line endings. This will help
catch any accidental modifications to existing .bat files or check
ins of new .bat files.

Importantly, this is compatible with how Gerrit serves .tar.gz files,
making it so that CRLF line endings are preserved.

The Go project is supported on many different environments, some of
which may have limited git implementations available, or none at all.
Relying on fewer git features and special rules makes it easier to
have confidence in the exact content of all files. Additionally, Go
development started in Subversion, moved to Perforce, then Mercurial,
and now uses Git.¹ Reducing its reliance on git-specific features will
help if there will be another transition in the project's future.

There are only 5 .bat files in the entire Go source tree, so a new one
being added is a rare event, and we prefer to do things in Go instead.
We still have the option of improving the experience for developers by
adding a pre-commit converter for .bat files to the git-codereview tool.

¹ https://groups.google.com/d/msg/golang-dev/sckirqOWepg/YmyT7dWJiocJ

Fixes #39391.
For #37791.

Change-Id: I6e202216322872f0307ac96f1b8d3f57cb901e6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/236437
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc/go1.15: document two noteworthy json changes
Daniel Martí [Sat, 6 Jun 2020 12:39:11 +0000 (13:39 +0100)]
doc/go1.15: document two noteworthy json changes

I had a look at the changes between 1.14 and master, and these are the
only two that seem relevant enough for the changelog.

There was also CL 179337 to reuse values when decoding map elements, but
it got reverted in CL 234559 and is not being included in 1.15.

Updates #37419.

Change-Id: Ib125415a953471ce29553a413d85aaf4b18a7a12
Reviewed-on: https://go-review.googlesource.com/c/go/+/236523
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoall: replace usages of whitelist/blacklist and master/slave
Filippo Valsorda [Sun, 7 Jun 2020 00:59:12 +0000 (20:59 -0400)]
all: replace usages of whitelist/blacklist and master/slave

There's been plenty of discussion on the usage of these terms in tech.
I'm not trying to have yet another debate. It's clear that there are
people who are hurt by them and who are made to feel unwelcome by their
use due not to technical reasons but to their historical and social
context. That's simply enough reason to replace them.

Anyway, allowlist and blocklist are more self-explanatory than whitelist
and blacklist, so this change has negative cost.

Didn't change vendored, bundled, and minified files. Nearly all changes
are tests or comments, with a couple renames in cmd/link and cmd/oldlink
which are extremely safe. This should be fine to land during the freeze
without even asking for an exception.

Change-Id: I8fc54a3c8f9cc1973b710bbb9558a9e45810b896
Reviewed-on: https://go-review.googlesource.com/c/go/+/236857
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Khosrow Moossavi <khos2ow@gmail.com>
Reviewed-by: Leigh McCulloch <leighmcc@gmail.com>
Reviewed-by: Urban Ishimwe <urbainishimwe@gmail.com>
4 years agodoc/go1.15: rationalize runtime sections
Austin Clements [Fri, 5 Jun 2020 13:46:21 +0000 (09:46 -0400)]
doc/go1.15: rationalize runtime sections

Use the "Core library -> runtime" section for changes that affect the
runtime package API and use the top-level "Runtime" section for
package-independent behavior changes. Also, move the one change that's
really about os (and net) into the "os" package section and reword it
to be more accurate.

Updates #37419.

Change-Id: I32896b039f29ac67308badd0d0b36e8c6e39f64f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236718
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 years agodoc/go1.15: document toolchain changes
Austin Clements [Thu, 4 Jun 2020 22:14:06 +0000 (18:14 -0400)]
doc/go1.15: document toolchain changes

Updates #37419.

Change-Id: I403cb12083d37359187b45c392046f307054a5b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/236618
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
4 years agodoc/go1.15: remove TODO intended for the Core library section
Carlos Amedee [Fri, 5 Jun 2020 22:12:22 +0000 (18:12 -0400)]
doc/go1.15: remove TODO intended for the Core library section

The TODO was added durring the initial creation of the document.
In the current location, it makes it seem like the tzdata documents
are incomplete when they are complete. It is understood that the
entire Core library section will be a work in progress until the release.

For #37419

Change-Id: Ic857eb0ec2583781c701985ea62e519e9d940090
Reviewed-on: https://go-review.googlesource.com/c/go/+/236760
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc/go1.15: add release notes for fmt
shaquilleq [Thu, 4 Jun 2020 01:25:46 +0000 (18:25 -0700)]
doc/go1.15: add release notes for fmt

Updates #37419

Change-Id: I344dd93ed7a75f88e7f937c80f5a6ad6c0327a07
Reviewed-on: https://go-review.googlesource.com/c/go/+/236417
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years ago[dev.link] all: merge branch 'master' into dev.link
Cherry Zhang [Fri, 5 Jun 2020 20:55:43 +0000 (16:55 -0400)]
[dev.link] all: merge branch 'master' into dev.link

Merge conflicts are mostly recently changed nm/objdump output
format and its tests. Resolved easily (mostly just using the
format on master branch).

Change-Id: I99d8410a9a02947ecf027d9cae5762861562baf5

4 years agodoc/go1.15: add release notes for regexp
Michael Matloob [Fri, 5 Jun 2020 17:18:28 +0000 (13:18 -0400)]
doc/go1.15: add release notes for regexp

Updates #37419

Change-Id: I340efe55b9dc41bb9ef6c9f0ec158d58a9445864
Reviewed-on: https://go-review.googlesource.com/c/go/+/236738
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: clarify wording/grammar on GODEBUG=invalidptr
Brad Fitzpatrick [Fri, 5 Jun 2020 15:32:41 +0000 (08:32 -0700)]
runtime: clarify wording/grammar on GODEBUG=invalidptr

Change-Id: Ia06b6be262922991bae3528e7b061d1db9e4c3c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/236679
Reviewed-by: Austin Clements <austin@google.com>
4 years agodoc: update contribution guide to make it friendlier for x/ repos
Rebecca Stambler [Fri, 22 May 2020 03:58:39 +0000 (23:58 -0400)]
doc: update contribution guide to make it friendlier for x/ repos

The current contributor documentation is tailored towards contributors
to golang/go, but we have a number of increasingly popular x/ repos.
In this CL, I tried to generalize the language to make it apply to any
repository.

Also, I fixed an old link I noticed in editors.html.

Change-Id: Id9d8e448262ed8c3a67f49be5d554ca29df9d3c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/234899
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
4 years agodoc/go1.15: mention new debug/pe constants
Ian Lance Taylor [Fri, 5 Jun 2020 16:52:35 +0000 (09:52 -0700)]
doc/go1.15: mention new debug/pe constants

The constants were added in CL 222637.

For #37419

Change-Id: Iae662d677d31c44a7560399ef6771f520c1f7663
Reviewed-on: https://go-review.googlesource.com/c/go/+/236682
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc/go1.15: add release notes for io/ioutil
Dominik Honnef [Fri, 5 Jun 2020 16:05:39 +0000 (18:05 +0200)]
doc/go1.15: add release notes for io/ioutil

For #37419.

Change-Id: I6c7a7e9c91f7691a6ba2a7ac4dad92c64b48962f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236658
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/asm, cmd/compile, doc: document -spectre flags
Russ Cox [Thu, 4 Jun 2020 20:20:39 +0000 (16:20 -0400)]
cmd/asm, cmd/compile, doc: document -spectre flags

Most of the docs are in the new wiki page
https://golang.org/wiki/Spectre.

Updates #37419.

Change-Id: I6e8f76670593c089de895e1665b41d874f879df9
Reviewed-on: https://go-review.googlesource.com/c/go/+/236599
Reviewed-by: Austin Clements <austin@google.com>
4 years agodoc/go1.15: exclude spaces from <code> block
Austin Clements [Fri, 5 Jun 2020 13:48:44 +0000 (09:48 -0400)]
doc/go1.15: exclude spaces from <code> block

Per the note at the top of go1.15.html.

Updates #37419.

Change-Id: Ia6917347ca1e3ebe8c55f9c0ec74e49ff481a64f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236719
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocrypto/x509: match cgo and Apple behavior in domain fallback of macOS roots
Roland Shoemaker [Mon, 11 May 2020 23:21:54 +0000 (16:21 -0700)]
crypto/x509: match cgo and Apple behavior in domain fallback of macOS roots

This change makes the direct call darwin loadSystemRoots implementation
match the existing cgo implementation, which in turn _mostly_ matches
the Apple implementation. The main change here is that when
SecTrustSettingsCopyTrustSettings the error is ignored, and can either
cause a fallback to check admin trust settings, or cause the
certificate to be marked kSecTrustSettingsResultUnspecified.

As well as updating the implementation to match the cgo one, this
change also updates the documentation of how the fallbacks work and
how they match the Apple implementations. References are made to the
Apple source where appropriate. This change does not update the
existing comments in the cgo implementation, since the goal is to
delete that code once the direct call implementation is matured.

Updates #38888

Change-Id: Id0344ea9d2eede3b715f341e9cbd3c1c661b7a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/233360
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agodoc/go1.15: add release notes for RISC-V port
Cherry Zhang [Wed, 3 Jun 2020 21:09:44 +0000 (17:09 -0400)]
doc/go1.15: add release notes for RISC-V port

Change-Id: I35045925cca942980419829fe07e5e0f38cb7a91
Reviewed-on: https://go-review.googlesource.com/c/go/+/236338
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agocmd/compile/internal: gofmt
Tobias Klauser [Thu, 4 Jun 2020 07:53:21 +0000 (09:53 +0200)]
cmd/compile/internal: gofmt

Change-Id: I67a4375d8eb976d48e4a57e482390f473658b4b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/236457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocrypto/tls: set CipherSuite for VerifyConnection
Katie Hockman [Thu, 4 Jun 2020 14:52:24 +0000 (10:52 -0400)]
crypto/tls: set CipherSuite for VerifyConnection

The ConnectionState's CipherSuite was not set prior
to the VerifyConnection callback in TLS 1.2 servers,
both for full handshakes and resumptions.

Change-Id: Iab91783eff84d1b42ca09c8df08e07861e18da30
Reviewed-on: https://go-review.googlesource.com/c/go/+/236558
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years ago[dev.link] cmd/link: reuse slice memory in deadcode pass
Cherry Zhang [Thu, 4 Jun 2020 16:01:53 +0000 (12:01 -0400)]
[dev.link] cmd/link: reuse slice memory in deadcode pass

Reuse slice memory in the deadcode pass, reduce allocations.

Linking cmd/compile,

name           old alloc/op   new alloc/op   delta
Deadcode_GC      2.10MB ± 0%    1.41MB ± 0%  -32.61%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
Deadcode_GC       8.46k ± 0%     5.55k ± 0%  -34.45%  (p=0.008 n=5+5)

Change-Id: Ib9ba0928d68a65879007218697712b53acd3c5c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/236566
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years ago[dev.link] cmd/link: rewrite heap algorithm
Cherry Zhang [Wed, 3 Jun 2020 23:34:29 +0000 (19:34 -0400)]
[dev.link] cmd/link: rewrite heap algorithm

Instead of using container/heap package, implement a simple
specialized heap algorithm for the work queue in the deadcode
pass, to avoid allocations and function pointer calls.

Linking cmd/compile,

name           old time/op    new time/op    delta
Deadcode_GC      59.8ms ± 4%    42.2ms ± 4%  -29.45%  (p=0.008 n=5+5)

name           old alloc/op   new alloc/op   delta
Deadcode_GC      3.53MB ± 0%    2.10MB ± 0%  -40.57%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
Deadcode_GC        187k ± 0%        8k ± 0%  -95.48%  (p=0.008 n=5+5)

Change-Id: Ibb21801d5b8e4a7eaf429856702e02720cd1772f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236565
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years ago[dev.link] cmd/link: compare type descriptors for interface satisfaction analysis
Cherry Zhang [Wed, 3 Jun 2020 17:28:18 +0000 (13:28 -0400)]
[dev.link] cmd/link: compare type descriptors for interface satisfaction analysis

Currently, in the deadcode pass, when checking whether a defined
method satisfies an interface, it compares the string
representation of the defined method and the interface method.
In fact, it can simply compare the method name and the type
descriptor (as we do in runtime). Make it so.

Change-Id: Ideb2b2410e5eedcd20ac31e3af41f5499fc90225
Reviewed-on: https://go-review.googlesource.com/c/go/+/236564
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years agosyscall: document float arguments and results on windows/amd64
Austin Clements [Thu, 4 Jun 2020 15:17:49 +0000 (11:17 -0400)]
syscall: document float arguments and results on windows/amd64

Updates #6510.
Updates #37273.

Change-Id: Id2732fcff0a0c5e4a324cd33ef995c7e528f5e1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/236562
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
4 years agosyscall: hide internal comment from Syscall documentation
Austin Clements [Thu, 4 Jun 2020 15:16:43 +0000 (11:16 -0400)]
syscall: hide internal comment from Syscall documentation

There's a comment on the Syscall function that's supposed to be an
internal implementation note, but since it's not separated from the
function definition, it appears in godoc. Add a blank line to prevent
this.

Change-Id: Iba307f1cc3844689ec3c6d82c21d441852e35bca
Reviewed-on: https://go-review.googlesource.com/c/go/+/236561
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
4 years agodoc/go1.15: 1.15 supports OpenBSD 6.7 on arm and arm64
Austin Clements [Thu, 4 Jun 2020 14:44:46 +0000 (10:44 -0400)]
doc/go1.15: 1.15 supports OpenBSD 6.7 on arm and arm64

Change-Id: Ibea6fbb73abdb7201855e80967120c07484d6460
Reviewed-on: https://go-review.googlesource.com/c/go/+/236557
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
4 years ago[dev.link] cmd/link: use fingerprint as package hash
Cherry Zhang [Mon, 1 Jun 2020 23:36:16 +0000 (19:36 -0400)]
[dev.link] cmd/link: use fingerprint as package hash

Now the compiler-generated fingerprint is a hash of the export
data. We don't need to hash it ourselves in the linker. And the
linker doesn't need to read export data at all.

Fixes #33820.

Change-Id: I54bf3ebfd0f0c72aa43a352d7b2e0575dd62970d
Reviewed-on: https://go-review.googlesource.com/c/go/+/236119
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years ago[dev.link] cmd/compile: use hash of export data as fingerprint
Cherry Zhang [Mon, 1 Jun 2020 22:53:58 +0000 (18:53 -0400)]
[dev.link] cmd/compile: use hash of export data as fingerprint

Currently, the compiler generates a fingerprint for each package,
which is used by the linker for index consistency check.

When building plugin or shared object, currently the linker also
generates a hash, by hashing the export data. At run time, when
a package is referenced by multiple DSOs, this hash is compared
to ensure consistency.

It would be good if we can unify this two hashes. This way, the
linker doesn't need to read the export data (which is intended
for the compiler only, and is not always available for the
linker). The export data hash is sufficient for both purposes.
It is consistent with the current hash geneated by the linker.
And the export data includes indices for exported symbols, so its
hash can be used to catch index mismatches.

Updates #33820.

Change-Id: I2bc0d74930746f54c683a10dfd695d50ea3f5a38
Reviewed-on: https://go-review.googlesource.com/c/go/+/236118
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years ago[dev.link] cmd/link: remove safe mode
Cherry Zhang [Mon, 1 Jun 2020 16:55:40 +0000 (12:55 -0400)]
[dev.link] cmd/link: remove safe mode

Safe mode in the compiler is removed in CL 142717 in Go 1.12. I
think we can delete safe mode from the linker as well.

Change-Id: I201e84fca3a566a1bb84434ab4d504516160ac4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236117
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years agoio/ioutil: update WriteFile to clarify it does not change permissions if the file...
joshuabezaleel [Fri, 7 Feb 2020 10:36:26 +0000 (17:36 +0700)]
io/ioutil: update WriteFile to clarify it does not change permissions if the file exists.

The existing documentation of WriteFile does not make it clear for
non-native English speakers that it will not change the permissions if
the file already exists before.

Fixes #35711

Change-Id: If861c3e3700957fc9ac3d5313351c57d399d3f58
Reviewed-on: https://go-review.googlesource.com/c/go/+/218417
Reviewed-by: Rob Pike <r@golang.org>
4 years agoall: fix dead links to inferno-os bitbucket repository
Tobias Klauser [Wed, 3 Jun 2020 11:17:17 +0000 (13:17 +0200)]
all: fix dead links to inferno-os bitbucket repository

Generated using:

  perl -i -npe 's#inferno-os/src/default#inferno-os/src/master#' $(git grep -l "inferno-os/src/default" | grep -v vendor)

Change-Id: I4b6443bd09a8ea4c8aaeb40a1c73520d1f7ca648
Reviewed-on: https://go-review.googlesource.com/c/go/+/235821
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
4 years agocmd/compile: add interface equality tests
Keith Randall [Thu, 4 Jun 2020 03:38:20 +0000 (20:38 -0700)]
cmd/compile: add interface equality tests

Add interfaces which differ in type. Those used so far only
differ in value, not type.

These additional tests are needed to generate a failure
before CL 236278 went in.

Update #8606

Change-Id: Icdb7647b1973c2fff7e5afe2bd8b8c1b384f583e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236418
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
4 years agodoc/go1.15: add release notes for time
Julie Qiu [Tue, 2 Jun 2020 17:51:38 +0000 (13:51 -0400)]
doc/go1.15: add release notes for time

Updates #37419

Change-Id: I2018b55f335400070bfa3573adab9549a5bf6a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/236158
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc/go1.15: add release notes for strconv
Julie Qiu [Tue, 2 Jun 2020 17:46:34 +0000 (13:46 -0400)]
doc/go1.15: add release notes for strconv

Updates #37419

Change-Id: Ic72bf0da914fa8a56570750b8fd4b4d09d2ed075
Reviewed-on: https://go-review.googlesource.com/c/go/+/236157
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: make runtime-gdb.py tolerant of creatively-named gdb versions
David Chase [Wed, 3 Jun 2020 18:21:18 +0000 (14:21 -0400)]
runtime: make runtime-gdb.py tolerant of creatively-named gdb versions

"Fedora" and "Red Hat" are not numbers, it turns out.
Don't rely on version numbers, instead use a regexp to
handle variation across the 2 patterns thus far observed
for gdb-generated Go type names.

Change-Id: I18c81aa2848265a47daf1180d8f6678566ae3f19
Reviewed-on: https://go-review.googlesource.com/c/go/+/236280
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agocrypto/tls: test that Clone copies session ticket key fields
Katie Hockman [Mon, 1 Jun 2020 20:20:32 +0000 (16:20 -0400)]
crypto/tls: test that Clone copies session ticket key fields

Updates #25256

Change-Id: If16c42581f1cf3500fd7fd01c915e487f8025e55
Reviewed-on: https://go-review.googlesource.com/c/go/+/235922
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agocmd/internal/goobj2: add referenced symbol names to object file
Cherry Zhang [Tue, 2 Jun 2020 21:45:57 +0000 (17:45 -0400)]
cmd/internal/goobj2: add referenced symbol names to object file

Currently, for symbols defined in other packages and referenced
by index, we don't record its name in the object file, as the
linker doesn't need the name, only the index. As a consequence,
tools like objdump and nm also don't know the referenced symbol
names and cannot dump it properly.

This CL adds referenced symbol names to the object file. So the
object file is self-contained. And tools can retrieve referenced
symbol names properly.

Tools now should work as good for new object files as for old
object files.

Fixes #38875.

Change-Id: I16c685c1fd83273ab1faef474e19acf4af46396f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236168
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years agoRevert "cmd/internal/goobj: add index to symbol name for indexed symbols"
Cherry Zhang [Tue, 2 Jun 2020 18:52:16 +0000 (14:52 -0400)]
Revert "cmd/internal/goobj: add index to symbol name for indexed symbols"

This reverts CL 229246.

For new indexed object files, in CL 229246 we added symbol index
to tools (nm, objdump) output. This affects external tools that
parse those outputs. And the added index doesn't look very nice.
In this release we take it out. For future releases we may
introduce a flag to tools (nm, objdump) and optionally dump the
symbol index.

For refererenced (not defined) indexed symbols, currently the
symbol is still referenced only by index, not by name. The next
CL will make the object file self-contained, so tools can dump
the symbol names properly (as before).

For #38875.

Change-Id: I07375e85a8e826e15c82fa452d11f0eaf8535a00
Reviewed-on: https://go-review.googlesource.com/c/go/+/236167
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
4 years agocmd/compile: test that equality is evaluated in order
Keith Randall [Wed, 3 Jun 2020 17:52:23 +0000 (10:52 -0700)]
cmd/compile: test that equality is evaluated in order

Make sure that we compare fields of structs and elements of arrays in order,
with proper short-circuiting.

Update #8606

Change-Id: I0a66ad92ea0af7bcc56dfdb275dec2b8d7e8b4fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/236147
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agocrypto/tls: fix duplicate calls to VerifyConnection
Katie Hockman [Wed, 13 May 2020 21:44:20 +0000 (17:44 -0400)]
crypto/tls: fix duplicate calls to VerifyConnection

Also add a test that could reproduce this error and
ensure it doesn't occur in other configurations.

Fixes #39012

Change-Id: If792b5131f312c269fd2c5f08c9ed5c00188d1af
Reviewed-on: https://go-review.googlesource.com/c/go/+/233957
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agocmd/link: new DWARF line table test case
Than McIntosh [Mon, 1 Jun 2020 14:24:46 +0000 (10:24 -0400)]
cmd/link: new DWARF line table test case

Add a test case for an issue with how Go emits DWARF line tables,
specifically relating to the line table "end sequence" operator.

Updates #38192.

Change-Id: I878b262e6ca6c550c0e460c3d5a1969ac4a2c31b
Reviewed-on: https://go-review.googlesource.com/c/go/+/235917
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agoRevert "cmd/compile: improve equality algs for arrays of interfaces"
Keith Randall [Wed, 3 Jun 2020 17:07:09 +0000 (17:07 +0000)]
Revert "cmd/compile: improve equality algs for arrays of interfaces"

This reverts commit 7eab9506c92562fe49861597e7bf1fcb28f2fd40.

Reason for revert: Undoing to get back to semantics discussed in #8606.

Change-Id: If0cd7518c10c37a81fdbb4ae112239e04c0b1448
Reviewed-on: https://go-review.googlesource.com/c/go/+/236278
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
4 years agoRevert "cmd/compile: improve generated eq algs for structs containing interfaces"
Keith Randall [Wed, 3 Jun 2020 17:02:10 +0000 (17:02 +0000)]
Revert "cmd/compile: improve generated eq algs for structs containing interfaces"

This reverts commit 1cc7be89a94951cbd1b6db669cb5a278e7aea545.

Reason for revert: Undoing to get back to semantics discussed in #8606.

Change-Id: Ib44a2e79cf113b3d15c3546cd8aa6fc27860819e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236146
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
4 years agodoc/go1.15: add release notes for plugin
Than McIntosh [Tue, 2 Jun 2020 21:15:35 +0000 (17:15 -0400)]
doc/go1.15: add release notes for plugin

Add a blurb to the release notes mentioning that the
linker now supports DWARF generation for -buildmode=plugin,
and that plugin builds work now for freebsd/amd64.

Updates #37419.

Change-Id: I84da7a52af84a9d765f73ca7ea525e7af8d64f05
Reviewed-on: https://go-review.googlesource.com/c/go/+/236162
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: repair gdb printing fix for 7.12, 8.{1,2,3}.1, 9.2
David Chase [Tue, 2 Jun 2020 21:53:47 +0000 (17:53 -0400)]
runtime: repair gdb printing fix for 7.12, 8.{1,2,3}.1, 9.2

Hand-verified for listed gdb versions.  Gdb (apparently)
changed the way it names certain Go types, and this change
broke the pretty-printer-activating code in runtime-gdb.py

runtime-gdb_test.go now checks channel, map, string, and slice
printing unconditionally (i.e., no opt-out for old versions).

Updates #39368.

Change-Id: I98d72e1291c66bd40d970990e1a377ff2ed0c5d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/236164
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc/go1.15: runtime release notes
Austin Clements [Wed, 3 Jun 2020 01:51:39 +0000 (21:51 -0400)]
doc/go1.15: runtime release notes

Change-Id: Ie37e993e840df2c063dee98fa3f6eca8e8713ca3
Reviewed-on: https://go-review.googlesource.com/c/go/+/236177
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years ago[dev.link] cmd/link: make addgotsym architecture agnostic
Jeremy Faller [Tue, 26 May 2020 17:40:12 +0000 (13:40 -0400)]
[dev.link] cmd/link: make addgotsym architecture agnostic

Change-Id: Icb64df32ef6599260a0cd3987a8afe98024da539
Reviewed-on: https://go-review.googlesource.com/c/go/+/235277
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years agocmd/internal/obj/arm64: fix typos in document
fanzha02 [Wed, 3 Jun 2020 02:33:03 +0000 (10:33 +0800)]
cmd/internal/obj/arm64: fix typos in document

The current document mismatches Go syntax loads a signed-byte
instruction "MOVB" with GNU syntax loads an 64bit double-word
instruction "ldr". This is just a typo in the document, the
assembler has the correct encoding. This patch fix this error.

Fixes #39367

Change-Id: Idb8f65ca540514ee5bc8f07073e756838710ba93
Reviewed-on: https://go-review.googlesource.com/c/go/+/236217
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/{compile,link}: fix problem with DWARF end_sequence ops
Than McIntosh [Fri, 29 May 2020 20:01:08 +0000 (16:01 -0400)]
cmd/{compile,link}: fix problem with DWARF end_sequence ops

During DWARF line table emission in the linker, prior to issuing a
DW_LNE_end_sequence op to mark the end of the line table for a
compilation unit, advance the PC to produce an address beyond the last
text address in the unit (this is required by the DWARF standard).
Because of the way that GDB interprets end-sequence ops, we were
effectively losing the last row in the line table for each unit, which
degraded the debugging experience.

This problem has been around for a while, but has surfaced recently
due to changes in line table generation. Prior to Go 1.14, the DWARF
line table was emitted entirely in the linker, and a single monolithic
line table was created for each Go package (including functions from
assembly). In 1.14 we moved to having the compiler emit line table
fragments for each function, and having the linker stitch together the
fragments. As part of this change we moved to a model in which each
"go tool compile/asm" output has its own DWARF line table instance,
meaning that there are many more "end sequence" ops, which made the
problem more visible.

Fixes #38192.

Change-Id: Ic29e2f6e0ac952360c81fcba5268ad70b2b44184
Reviewed-on: https://go-review.googlesource.com/c/go/+/235739
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
4 years agodoc/go1.15: add release notes for new linker
Than McIntosh [Tue, 2 Jun 2020 17:56:26 +0000 (13:56 -0400)]
doc/go1.15: add release notes for new linker

Add a blurb to the release notes describing improvements made to the
Go linker in the most recent development cycle.

Updates #37419.

Change-Id: I3b870f0c00efc0b7b33aab2631d8c4e1c273922d
Reviewed-on: https://go-review.googlesource.com/c/go/+/236159
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: steal timers from running P's
Ian Lance Taylor [Mon, 4 May 2020 23:19:16 +0000 (16:19 -0700)]
runtime: steal timers from running P's

Previously we did not steal timers from running P's, because that P
should be responsible for running its own timers. However, if the P
is running a CPU-bound G, this can cause measurable delays in running
ready timers. Also, in CL 214185 we avoided taking the timer lock of a P
with no ready timers, which reduces the chances of timer lock contention.

So, if we can't find any ready timers on sleeping P's, try stealing
them from running P's.

Fixes #38860

Change-Id: I0bf1d5dc56258838bdacccbf89493524e23d7fed
Reviewed-on: https://go-review.googlesource.com/c/go/+/232199
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 years agocmd/go: add -Wl,-wrap,symbol to linker flag whitelist
Andrew G. Morgan [Tue, 2 Jun 2020 20:13:54 +0000 (13:13 -0700)]
cmd/go: add -Wl,-wrap,symbol to linker flag whitelist

This is needed for cgo support for libpsx.

Fixes: #39361
Change-Id: I500f5614ea4b82b085322af1f1ffeb1f55270a05
Reviewed-on: https://go-review.googlesource.com/c/go/+/236139
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agotesting: capture testname on --- PASS and --- FAIL lines
Jean de Klerk [Mon, 1 Jun 2020 18:19:05 +0000 (12:19 -0600)]
testing: capture testname on --- PASS and --- FAIL lines

This fixes an issue raised at https://github.com/golang/go/issues/38458#issuecomment-635617670
in which --- PASS and --- FAIL lines would not trigger --- CONT lines
of other tests.

Change-Id: I0d8cc54d682a370d0a6ea6816a11b2e462a92efe
Reviewed-on: https://go-review.googlesource.com/c/go/+/235997
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agotime: note that formats may parse invalid strings
David Golden [Thu, 23 Apr 2020 01:16:49 +0000 (21:16 -0400)]
time: note that formats may parse invalid strings

The existing documentation for time format constants doesn't mention
that they may parse technically-invalid strings, such as single-digit
hours when a two-digit hour is required by a specification.  This commit
adds a short warning note to that effect.

Fixes #37616

Change-Id: I6e5e12bd42dc368f8ca542b4c0527a2b7d30acaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/229460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoruntime: repair slice, string, and channel printing in gdb
David Chase [Mon, 1 Jun 2020 18:30:24 +0000 (14:30 -0400)]
runtime: repair slice, string, and channel printing in gdb

"Something" changed the names of types in gdb, causing the
pretty-printer matchers to fail to match.  This tracks that
change.

Updated runtime-gdb_test.go to include a slice and a channel printing test.

(The straightforward printing of a slicevar doesn't work because
of compiler DWARF problems describing the slicevar, not gdb problems).

Change-Id: I21607a955b9c894f11ecf3763aea2a6dd59a3f42
Reviewed-on: https://go-review.googlesource.com/c/go/+/235926
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
4 years agocmd: update golang.org/x/tools to v0.0.0-20200601175630-2caf76543d99
Ian Lance Taylor [Tue, 2 Jun 2020 20:00:01 +0000 (13:00 -0700)]
cmd: update golang.org/x/tools to v0.0.0-20200601175630-2caf76543d99

This teaches vet to recognize %O in a fmt.Printf format string.
O has been supported since the 1.13 release, but vet would warn about it.

Fixes #29986

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

4 years agodoc/go1.15: remove TODOs for tools and go command sections
Jay Conrod [Tue, 2 Jun 2020 19:33:58 +0000 (15:33 -0400)]
doc/go1.15: remove TODOs for tools and go command sections

For #37419

Change-Id: I35a5cf86ff09a3962959627dce58155b26ad4748
Reviewed-on: https://go-review.googlesource.com/c/go/+/236160
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
4 years agocrypto/x509: document support for leading periods in DNS constraints
Roland Shoemaker [Wed, 13 May 2020 01:49:34 +0000 (18:49 -0700)]
crypto/x509: document support for leading periods in DNS constraints

This change adds a comment to the Verify documentation that indicates
that you can use URI and email style name constraints with a leading
period for DNS names (and explains what they do). This behavior is
not standards compliant, but matches the community application of
RFC 5280, so it makes sense to document it.

Fixes #37535

Change-Id: Ibd6f039e4fa46d40ad7ae1ab48eab86f13cf8eff
Reviewed-on: https://go-review.googlesource.com/c/go/+/233525
Reviewed-by: Ryan Sleevi <sleevi@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agoruntime: add three new partial orders for lock ranking
Dan Scales [Tue, 2 Jun 2020 15:50:54 +0000 (08:50 -0700)]
runtime: add three new partial orders for lock ranking

Two are associated with the new sysmon rank:  lockRankSysmon -> lockRankFin
(https://build.golang.org/log/07b0b8ee6ec9421d83699a1d850d9938390fb996)
and one I encountered during testing, lockRankSysmon -> lockRankWbufSpans

And another just seems not to have occurred before:  lockRankScavenge -> lockRankFin
(https://build.golang.org/log/07ba499b861fc93f527ef8514f5ba4c77086f4c4)

Change-Id: I070b5ed8e742857e815c6a56f8439d17a0ba36f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/236137
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 years agointernal/poll: add mutex to prevent SetDeadline race in Plan 9
Richard Miller [Tue, 2 Jun 2020 09:34:09 +0000 (10:34 +0100)]
internal/poll: add mutex to prevent SetDeadline race in Plan 9

There are data races on fd.[rw]aio and fd.[rw]timedout when Read/Write
is called on a polled fd concurrently with SetDeadline (see #38769).
Adding a mutex around accesses to each pair (read and write) prevents
the race, which was causing deadlocks in net/http tests on the builders.

Updates #38769.

Change-Id: I31719b3c9a664e81a775cda583cff31c0da946c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/235820
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
4 years agomisc/cgo/testplugin: fix typo in comment
Cherry Zhang [Mon, 1 Jun 2020 22:06:45 +0000 (18:06 -0400)]
misc/cgo/testplugin: fix typo in comment

Change-Id: I7d1a5f6936505dff8f765541b5102dcbcd6ae835
Reviewed-on: https://go-review.googlesource.com/c/go/+/235924
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc: document the new Cgo EGLConfig special case
Elias Naur [Mon, 1 Jun 2020 09:47:23 +0000 (11:47 +0200)]
doc: document the new Cgo EGLConfig special case

Change-Id: I7ae5eaa974b85eac421a0b1f79cb734a0fe44e72
Reviewed-on: https://go-review.googlesource.com/c/go/+/235818
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc: document new Android default linker
Elias Naur [Mon, 1 Jun 2020 09:58:54 +0000 (11:58 +0200)]
doc: document new Android default linker

Change-Id: I3557f6726afe325db79b2c972d107b3bcc103b8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/235819
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/link: flush file mapping before unmapping
Cherry Zhang [Fri, 29 May 2020 05:59:09 +0000 (01:59 -0400)]
cmd/link: flush file mapping before unmapping

Call FlushViewOfFile before unmapping the output file, for extra
safety. The documentation says the function does not wait for
the data to be written to disk, so it should be cheap.

Fixes #38440.

Change-Id: I05352f15d9305e6e7086a002f61802f74036b710
Reviewed-on: https://go-review.googlesource.com/c/go/+/235639
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agocmd/go/internal/modload: document mvsReqs.Max
Jay Conrod [Thu, 14 May 2020 19:03:26 +0000 (15:03 -0400)]
cmd/go/internal/modload: document mvsReqs.Max

The version "" denotes the main module, which has no version. The
mvs.Reqs interface documentation hints this is allowed, but it's not
obvious from the implementation in modload.mvsReqs.Max.

Also, replace a related TODO with a comment in mvs.Downgrade.

Fixes #39042

Change-Id: I11e10908c9b3d8c2283eaa5c04bd8e1b936851fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/234003
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/test2json: attribute output to the correct test
Daniel Nephin [Mon, 1 Jun 2020 16:11:34 +0000 (16:11 +0000)]
cmd/test2json: attribute output to the correct test

When printing regular test output check the indentation of the output, and use
the report stack to find the appropriate test name for that output.

This change includes a whitespace change to some golden test files. The
indentation of tests was changed in CL 113177
from tabs to spaces. The golden files have been updated to match the new
output format. The tabs in the golden files cause problems because the indentation check
looks for 4 spaces.

Fixes #29755
Updates #25369

Change-Id: Iebab51816a9755168083a7a665b41497e9dfd85f
GitHub-Last-Rev: 898827f1a6a163fd81dc667f5d27fd4893260038
GitHub-Pull-Request: golang/go#34419
Reviewed-on: https://go-review.googlesource.com/c/go/+/196617
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc/go1.15: update Go 1.15 release notes using relnote
Alexander Rakoczy [Fri, 29 May 2020 21:53:27 +0000 (17:53 -0400)]
doc/go1.15: update Go 1.15 release notes using relnote

The additions were generated using golang.org/x/build/cmd/relnote.

Updates #37419

Change-Id: Iad7b564dd7e6cbcbd0d216c2530802e086ec49cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/235757
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agoruntime: fix race condition between timer and event handler
Richard Musiol [Sat, 25 Apr 2020 16:53:53 +0000 (18:53 +0200)]
runtime: fix race condition between timer and event handler

This change fixes a race condition between beforeIdle waking up the
innermost event handler and a timer causing a different goroutine to
wake up at the exact same moment. This messes up the wasm event handling
and leads to memory corruption. The solution is to make beforeIdle
return the goroutine that must run next and have findrunnable pick
this goroutine without considering timers again.

Fixes #38093
Fixes #38574

Change-Id: Iffbe99411d25c2730953d1c8b0741fd892f8e540
Reviewed-on: https://go-review.googlesource.com/c/go/+/230178
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agocmd/cgo,cmd/fix,misc/cgo: map the EGLConfig C type to uintptr in Go
Elias Naur [Sat, 30 May 2020 14:34:23 +0000 (16:34 +0200)]
cmd/cgo,cmd/fix,misc/cgo: map the EGLConfig C type to uintptr in Go

Similarly to EGLDisplay, EGLConfig is declared as a pointer but may
contain non-pointer values.

I believe this is the root cause of https://todo.sr.ht/~eliasnaur/gio/121.

Change-Id: I412c4fbc2eef4aa028534d68bda95db98e3a365d
Reviewed-on: https://go-review.googlesource.com/c/go/+/235817
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocontainer/list: fix typo in function comments
Yasser Abdolmaleki [Sun, 31 May 2020 00:42:34 +0000 (17:42 -0700)]
container/list: fix typo in function comments

The correct word to use here is 'another' not 'an other'

Change-Id: Ie4f748ae94a5945dceb52779222ffd8cf36b8845
Reviewed-on: https://go-review.googlesource.com/c/go/+/235838
Reviewed-by: Robert Griesemer <gri@golang.org>
4 years agonet/http: reject HTTP/1.1 Content-Length with sign in response
Paschalis Tsilias [Thu, 21 May 2020 12:33:39 +0000 (15:33 +0300)]
net/http: reject HTTP/1.1 Content-Length with sign in response

Enforces section 14.13 of RFC 2616 so that Content-Length header
values with a sign such as "+5" will be rejected.

Updates #39017

Change-Id: Icce9f00d03c8475fe704b33f9bed9089ff8802f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/234817
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agoRevert "cmd/go: group 'go get' update messages together near the end of output"
Austin Clements [Sat, 30 May 2020 20:40:58 +0000 (20:40 +0000)]
Revert "cmd/go: group 'go get' update messages together near the end of output"

This reverts https://golang.org/cl/232578.

Reason for revert: This commit broke TestScript/mod_load_badchain,
which is causing all longtest builders to fail.

Change-Id: I4a17392ce74ac3a7ad340980556025f669d94b65
Reviewed-on: https://go-review.googlesource.com/c/go/+/235857
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodatabase/sql/driver: use correct method name "Connect" in DriverContext docs
Brad Erickson [Sat, 30 May 2020 03:10:57 +0000 (03:10 +0000)]
database/sql/driver: use correct method name "Connect" in DriverContext docs

Change-Id: I755fedebb1f8f4d3f27b2b3f8626bca03bd36c88
GitHub-Last-Rev: 4a123572d55ad3b0104d3e6501eef5b2f37af4cd
GitHub-Pull-Request: golang/go#39305
Reviewed-on: https://go-review.googlesource.com/c/go/+/235518
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>