]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
6 years ago[release-branch.go1.9] go1.9.2 go1.9.2
Russ Cox [Wed, 25 Oct 2017 18:29:22 +0000 (14:29 -0400)]
[release-branch.go1.9] go1.9.2

Change-Id: Idb72e9f562887680e0b287649a4ae1325d7e3eb5
Reviewed-on: https://go-review.googlesource.com/71271
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] runtime: use simple, more robust fastrandn
Russ Cox [Sun, 15 Oct 2017 02:47:24 +0000 (22:47 -0400)]
[release-branch.go1.9] runtime: use simple, more robust fastrandn

CL 36932 (speed up fastrandn) made it faster but introduced
bad interference with some properties of fastrand itself, making
fastrandn not very random in certain ways. In particular, certain
selects are demonstrably unfair.

For Go 1.10 the new faster fastrandn has induced a new fastrand,
which in turn has caused other follow-on bugs that are still being
discovered and fixed.

For Go 1.9.2, just go back to the barely slower % implementation
that we used in Go 1.8 and earlier. This should restore fairness in
select and any other problems caused by the clever fastrandn.

The test in this CL is copied from CL 62530.

Fixes #22253.

Change-Id: Ibcf948a7bce981452e05c90dbdac122043f6f813
Reviewed-on: https://go-review.googlesource.com/70991
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: fix sign-extension merging rules
Keith Randall [Thu, 21 Sep 2017 19:52:38 +0000 (12:52 -0700)]
[release-branch.go1.9] cmd/compile: fix sign-extension merging rules

If we have

  y = <int16> (MOVBQSX x)
  z = <int32> (MOVWQSX y)

We used to use this rewrite rule:

(MOVWQSX x:(MOVBQSX _)) -> x

But that resulted in replacing z with a value whose type
is only int16.  Then if z is spilled and restored, it gets
zero extended instead of sign extended.

Instead use the rule

(MOVWQSX (MOVBQSX x)) -> (MOVBQSX x)

The result is has the correct type, so it can be spilled
and restored correctly.  It might mean that a few more extension
ops might not be eliminated, but that's the price for correctness.

Fixes #21963

Change-Id: I6ec82c3d2dbe43cc1fee6fb2bd6b3a72fca3af00
Reviewed-on: https://go-review.googlesource.com/65290
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/70986
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: avoid generating large offsets
Keith Randall [Mon, 28 Aug 2017 19:57:52 +0000 (12:57 -0700)]
[release-branch.go1.9] cmd/compile: avoid generating large offsets

The assembler barfs on large offsets. Make sure that all the
instructions that need to have their offsets in an int32
  1) check on any rule that computes offsets for such instructions
  2) change their aux fields so the check builder checks it.

The assembler also silently misassembled offsets between 1<<31
and 1<<32. Add a check in the assembler to barf on those as well.

Fixes #21655

Change-Id: Iebf24bf10f9f37b3ea819ceb7d588251c0f46d7d
Reviewed-on: https://go-review.googlesource.com/59630
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-on: https://go-review.googlesource.com/70981
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 after...
Michael Matloob [Tue, 12 Sep 2017 16:22:22 +0000 (12:22 -0400)]
[release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 after flush

After the number of lost extra events are written to the the cpuprof log,
the number of lost extra events should be set to zero, or else, the next
time time addExtra is logged, lostExtra will be overcounted. This change
resets lostExtra after its value is written to the log.

Fixes #21836

Change-Id: I8a6ac9c61e579e7a5ca7bdb0f3463f8ae8b9f864
Reviewed-on: https://go-review.googlesource.com/63270
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/70974
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] cmd/cgo: support large unsigned macro again
Hiroshi Ioka [Thu, 31 Aug 2017 04:49:43 +0000 (13:49 +0900)]
[release-branch.go1.9] cmd/cgo: support large unsigned macro again

The approach of https://golang.org/cl/43476 turned out incorrect.
The problem is that the sniff introduced by the CL only work for simple
expression. And when it fails it fallback to uint64, not int64, which
breaks backward compatibility.
In this CL, we use DWARF for guessing kind instead. That should be more
reliable than previous approach. And importanly, it fallbacks to int64 even
if it fails to guess kind.

Fixes #21708

Change-Id: I39a18cb2efbe4faa9becdcf53d5ac68dba180d47
Reviewed-on: https://go-review.googlesource.com/60510
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/60810
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/70970
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] cmd/cgo: avoid using common names for sniffing
Hiroshi Ioka [Mon, 28 Aug 2017 22:39:57 +0000 (07:39 +0900)]
[release-branch.go1.9] cmd/cgo: avoid using common names for sniffing

Current code uses names like "x" and "s" which can conflict with user's
code easily. Use cryptographic names.

Fixes #21668

Change-Id: Ib6d3d6327aa5b92d95c71503d42e3a79d96c8e16
Reviewed-on: https://go-review.googlesource.com/59710
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/59730
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/70849
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] os: skip TestPipeThreads as flaky for 1.9
Ian Lance Taylor [Fri, 13 Oct 2017 19:22:20 +0000 (12:22 -0700)]
[release-branch.go1.9] os: skip TestPipeThreads as flaky for 1.9

Updates #21559

Change-Id: I90fa8b4ef97c4251440270491ac4c833d76ee872
Reviewed-on: https://go-review.googlesource.com/70771
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] runtime: avoid monotonic time zero on systems with low-res...
Russ Cox [Wed, 25 Oct 2017 15:13:23 +0000 (11:13 -0400)]
[release-branch.go1.9] runtime: avoid monotonic time zero on systems with low-res timers

Otherwise low-res timers cause problems at call sites that expect to
be able to use 0 as meaning "no time set" and therefore expect that
nanotime never returns 0 itself. For example, sched.lastpoll == 0
means no last poll.

Fixes #22394.

Change-Id: Iea28acfddfff6f46bc90f041ec173e0fea591285
Reviewed-on: https://go-review.googlesource.com/73410
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/73491
TryBot-Result: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] doc: document Go 1.9.2
Russ Cox [Wed, 25 Oct 2017 14:57:00 +0000 (10:57 -0400)]
[release-branch.go1.9] doc: document Go 1.9.2

Change-Id: I7d63e747e798d588bdcf2b79b6ecd21fce7bbc9c
Reviewed-on: https://go-review.googlesource.com/73391
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/73490
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain
Russ Cox [Tue, 17 Oct 2017 19:10:59 +0000 (15:10 -0400)]
[release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain

More generally I'm concerned about these tests using
$GOROOT/src/cmd/go as scratch space, especially
combined wtih tg.parallel() - it's easy to believe some other
test might inadvertently also try to write x.exe about the
same time. This CL only solves the "didn't clean up x.exe"
problem and leaves for another day the "probably shouldn't
write to cmd/go at all" problem.

Fixes #22266.

Change-Id: I651534d70e2d360138e0373fb4a316081872550b
Reviewed-on: https://go-review.googlesource.com/71410
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/71530

6 years ago[release-branch.go1.9] cmd/compile: omit ICE diagnostics after normal error messages
Matthew Dempsky [Fri, 13 Oct 2017 21:47:45 +0000 (14:47 -0700)]
[release-branch.go1.9] cmd/compile: omit ICE diagnostics after normal error messages

After we detect errors, the AST is in a precarious state and more
likely to trip useless ICE failures. Instead let the user fix any
existing errors and see if the ICE persists.  This makes Fatalf more
consistent with how panics are handled by hidePanic.

While here, also fix detection for release versions: release version
strings begin with "go" ("go1.8", "go1.9.1", etc), not "release".

Fixes #22252.

Change-Id: I1c400af62fb49dd979b96e1bf0fb295a81c8b336
Reviewed-on: https://go-review.googlesource.com/70850
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/70985
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
6 years ago[release-branch.go1.9] database/sql: prevent race in driver by locking dc in Next
Daniel Theophanes [Sat, 23 Sep 2017 22:30:46 +0000 (15:30 -0700)]
[release-branch.go1.9] database/sql: prevent race in driver by locking dc in Next

Database drivers should be called from a single goroutine to ease
driver's design. If a driver chooses to handle context
cancels internally it may do so.

The sql package violated this agreement when calling Next or
NextResultSet. It was possible for a concurrent rollback
triggered from a context cancel to call a Tx.Rollback (which
takes a driver connection lock) while a Rows.Next is in progress
(which does not tack the driver connection lock).

The current internal design of the sql package is each call takes
roughly two locks: a closemu lock which prevents an disposing of
internal resources (assigning nil or removing from lists)
and a driver connection lock that prevents calling driver code from
multiple goroutines.

Fixes #21117

Change-Id: Ie340dc752a503089c27f57ffd43e191534829360
Reviewed-on: https://go-review.googlesource.com/65731
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/71510
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
6 years ago[release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes...
Alex Brainman [Wed, 11 Oct 2017 07:23:30 +0000 (18:23 +1100)]
[release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes for sockets

CL 36799 made SetFileCompletionNotificationModes to be called for
file handles. I don't think it is correct. Revert that change.

Fixes #22024
Fixes #22207

Change-Id: I26260e8a727131cffbf60958d79eca2457495554
Reviewed-on: https://go-review.googlesource.com/69871
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70990
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years ago[release-branch.go1.9] internal/poll: do not call SetFileCompletionNotificationModes...
Alex Brainman [Wed, 11 Oct 2017 07:15:25 +0000 (18:15 +1100)]
[release-branch.go1.9] internal/poll: do not call SetFileCompletionNotificationModes if it is broken

Current code assumes that SetFileCompletionNotificationModes
is safe to call even if we know that it is not safe to use
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS flag. It appears (see issue #22149),
SetFileCompletionNotificationModes crashes when we call it without
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS flag.

Do not call SetFileCompletionNotificationModes in that situation.
We are allowed to do that, because SetFileCompletionNotificationModes
is just an optimisation.

Fixes #22149

Change-Id: I0ad3aff4eabd8c27739417a62c286b1819ae166a
Reviewed-on: https://go-review.googlesource.com/69870
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70989
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years ago[release-branch.go1.9] cmd/go: correct directory used in checkNestedVCS test
Ian Lance Taylor [Tue, 10 Oct 2017 21:10:28 +0000 (14:10 -0700)]
[release-branch.go1.9] cmd/go: correct directory used in checkNestedVCS test

This error was not used when using git because nested git is permitted.
Add test using Mercurial, so that at least we have a test, even though
the test is not run by default.

Fixes #22157
Fixes #22201

Change-Id: If521f3c09b0754e00e56fa3cd0364764a57a43ad
Reviewed-on: https://go-review.googlesource.com/69670
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/70984
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] crypto/x509: reject intermediates with unknown critical extens...
Adam Langley [Fri, 6 Oct 2017 19:46:22 +0000 (12:46 -0700)]
[release-branch.go1.9] crypto/x509: reject intermediates with unknown critical extensions.

In https://golang.org/cl/9390 I messed up and put the critical extension
test in the wrong function. Thus it only triggered for leaf certificates
and not for intermediates or roots.

In practice, this is not expected to have a security impact in the web
PKI.

Change-Id: I4f2464ef2fb71b5865389901f293062ba1327702
Reviewed-on: https://go-review.googlesource.com/69294
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/70983
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] net/smtp: NewClient: set tls field to true when already using...
Jeff [Thu, 5 Oct 2017 17:11:17 +0000 (10:11 -0700)]
[release-branch.go1.9] net/smtp: NewClient: set tls field to true when already using a TLS connection

Change-Id: I34008f56c191df0edcaafc20d569bbc6184f89fc
Reviewed-on: https://go-review.googlesource.com/68470
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70982
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] net: increase expected time to dial a closed port on all Darwi...
Author Name [Sat, 30 Sep 2017 20:47:48 +0000 (13:47 -0700)]
[release-branch.go1.9] net: increase expected time to dial a closed port on all Darwin ports

All current darwin architectures seem to take at least 100ms to dial a closed port,
and that was making the all.bash script fail.

Fixes #22062

Change-Id: Ib79c4b7a5db2373c95ce5d993cdcbee55cc0667f
Reviewed-on: https://go-review.googlesource.com/67350
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70988
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] cmd/compile: fix merge rules for panic calls
Keith Randall [Mon, 2 Oct 2017 22:47:41 +0000 (15:47 -0700)]
[release-branch.go1.9] cmd/compile: fix merge rules for panic calls

Use entire inlining call stack to decide whether two panic calls
can be merged. We used to merge panic calls when only the leaf
line numbers matched, but that leads to places higher up the call
stack being merged incorrectly.

Fixes #22083

Change-Id: Ia41400a80de4b6ecf3e5089abce0c42b65e9b38a
Reviewed-on: https://go-review.googlesource.com/67632
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/70980
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] net: bump TestDialerDualStackFDLeak timeout on iOS
Elias Naur [Wed, 27 Sep 2017 11:36:54 +0000 (13:36 +0200)]
[release-branch.go1.9] net: bump TestDialerDualStackFDLeak timeout on iOS

On an iPhone 6 running iOS 11, the TestDialerDualStackFDLeak test
started failing with dial durations just above the limit:

FAIL: TestDialerDualStackFDLeak (0.21s)

dial_test.go:90: got 101.154ms; want <= 95ms

Bump the timeout on iOS.

For the iOS builder.

Change-Id: Id42b471e7cf7d0c84f6e83ed04b395fa1a2d449d
Reviewed-on: https://go-review.googlesource.com/66491
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70987
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off
Austin Clements [Mon, 25 Sep 2017 18:58:13 +0000 (14:58 -0400)]
[release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off

Currently, the priority of checks in (gcTrigger).test() puts the
gcpercent<0 test above gcTriggerCycle, which is used for runtime.GC().
This is an unintentional change from 1.8 and before, where
runtime.GC() triggered a GC even if GOGC=off.

Fix this by rearranging the priority so the gcTriggerCycle test
executes even if gcpercent < 0.

Fixes #22023.

Change-Id: I109328d7b643b6824eb9d79061a9e775f0149575
Reviewed-on: https://go-review.googlesource.com/65994
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-on: https://go-review.googlesource.com/70979
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years ago[release-branch.go1.9] cmd/compile: fix regression in PPC64.rules move zero
Lynn Boger [Tue, 19 Sep 2017 21:36:57 +0000 (17:36 -0400)]
[release-branch.go1.9] cmd/compile: fix regression in PPC64.rules move zero

When a MOVDstorezero (8 bytes) is used the offset field
in the instruction must be a multiple of 4. This situation
had been corrected in the rules for other types of stores
but not for the zero case.

This also removes some of the special MOVDstorezero cases since
they can be handled by the general LowerZero case.

Updates made to the ssa test for lowering zero moves to
include cases where the target is not aligned to at least 4.

Fixes #21947

Change-Id: I7cceceb1be4898c77cd3b5e78b58dce0a7e28edd
Reviewed-on: https://go-review.googlesource.com/64970
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-on: https://go-review.googlesource.com/70978
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] internal/poll: be explicit when using runtime netpoller
Alex Brainman [Mon, 25 Sep 2017 08:54:14 +0000 (18:54 +1000)]
[release-branch.go1.9] internal/poll: be explicit when using runtime netpoller

internal/poll package assumes that only net sockets use runtime
netpoller on windows. We get memory corruption if other file
handles are passed into runtime poller. Make FD.Init receive
and use useNetpoller argument, so FD.Init caller is explicit
about using runtime netpoller.

Fixes #21172

Change-Id: I60e2bfedf9dda9b341eb7a3e5221035db29f5739
Reviewed-on: https://go-review.googlesource.com/65810
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/71132
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years ago[release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling
Matthew Dempsky [Tue, 19 Sep 2017 21:28:03 +0000 (14:28 -0700)]
[release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling

The previous code seems to have an off-by-1 in it somewhere, the
consequence being that we didn't properly preserve all of the old
buffer contents that we intended to.

After spending a while looking at the existing window-shifting logic,
I wasn't able to understand exactly how it was supposed to work or
where the issue was, so I rewrote it to be (at least IMO) more
obviously correct.

Fixes #21938.

Change-Id: I1ed7bbc1e1751a52ab5f7cf0411ae289586dc345
Reviewed-on: https://go-review.googlesource.com/64830
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/70977
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
6 years ago[release-branch.go1.9] reflect: fix pointer past-the-end in Call with zero-sized...
Cherry Zhang [Fri, 1 Sep 2017 02:02:37 +0000 (22:02 -0400)]
[release-branch.go1.9] reflect: fix pointer past-the-end in Call with zero-sized return value

If a function with nonzero frame but zero-sized return value is
Call'd, we may write a past-the-end pointer in preparing the
return Values. Fix by return the zero value for zero-sized
return value.

Fixes #21717.

Change-Id: I5351cd86d898467170a888b4c3fc9392f0e7aa3b
Reviewed-on: https://go-review.googlesource.com/60811
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/70971
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years ago[release-branch.go1.9] log: fix data race on log.Output
hagen1778 [Tue, 19 Sep 2017 17:28:11 +0000 (20:28 +0300)]
[release-branch.go1.9] log: fix data race on log.Output

There was unprotected access to Logger.flag in log.Output which
could lead to data race in cases when log.SetFlags called simultaneously.
For example, "hot" switching on/off debug-mode for Logger by log.SetFlags
while application still writing logs.

Fixes #21935

Change-Id: I36be25f23cad44cde62ed1af28a30d276400e1b8
Reviewed-on: https://go-review.googlesource.com/64710
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/70976
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] cmd/compile: replace GOROOT in //line directives
David Crawshaw [Wed, 13 Sep 2017 23:04:25 +0000 (19:04 -0400)]
[release-branch.go1.9] cmd/compile: replace GOROOT in //line directives

The compiler replaces any path of the form /path/to/goroot/src/net/port.go
with GOROOT/src/net/port.go so that the same object file is
produced if the GOROOT is moved. It was skipping this transformation
for any absolute path into the GOROOT that came from //line directives,
such as those generated by cmd/cgo.

Fixes #21373
Fixes #21720
Fixes #21825

Change-Id: I2784c701b4391cfb92e23efbcb091a84957d61dd
Reviewed-on: https://go-review.googlesource.com/63693
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-on: https://go-review.googlesource.com/70975
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] cmd/compile: limit the number of simultaneously opened files...
zhongtao.chen [Tue, 22 Aug 2017 02:33:10 +0000 (10:33 +0800)]
[release-branch.go1.9] cmd/compile: limit the number of simultaneously opened files to avoid EMFILE/ENFILE errors

If the Go packages with enough source files,it will cause EMFILE/ENFILE error,
Fix this by limiting the number of simultaneously opened files.

Fixes #21621

Change-Id: I8555d79242d2f90771e37e073b7540fc7194a64a
Reviewed-on: https://go-review.googlesource.com/57751
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/63752
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] expvar: make (*Map).Init clear existing keys
Bryan C. Mills [Fri, 8 Sep 2017 18:36:43 +0000 (14:36 -0400)]
[release-branch.go1.9] expvar: make (*Map).Init clear existing keys

fixes #21619

Change-Id: I5bb513dfc8cac875b06a262eec40b5863ae23a4c
Reviewed-on: https://go-review.googlesource.com/62370
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/70973
Run-TryBot: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] cmd/compile: simplify "missing function body" error message
Matthew Dempsky [Sun, 3 Sep 2017 19:31:14 +0000 (12:31 -0700)]
[release-branch.go1.9] cmd/compile: simplify "missing function body" error message

Fixes #21747.

Change-Id: I6a68370be3b7510ce364ddd1e41a1d767ce3a67f
Reviewed-on: https://go-review.googlesource.com/61311
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/70972
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
6 years ago[release-branch.go1.9] time: fix documentation of Round, Truncate behavior for d...
Dmitri Shuralyov [Thu, 17 Aug 2017 23:30:34 +0000 (19:30 -0400)]
[release-branch.go1.9] time: fix documentation of Round, Truncate behavior for d <= 0

Saying that they return t unchanged is misleading, because they return
a modified t, stripped of any monotonic clock reading, as of Go 1.9.

Fixes #21485.

Change-Id: Icddf8813aed3d687fcefcd2fe542829438be6a0a
Reviewed-on: https://go-review.googlesource.com/56690
Reviewed-by: Avelino <t@avelino.xxx>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70846
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Russ Cox <rsc@golang.org>

6 years ago[release-branch.go1.9] runtime: capture runtimeInitTime after nanotime is initialized
Austin Clements [Thu, 24 Aug 2017 19:06:26 +0000 (15:06 -0400)]
[release-branch.go1.9] runtime: capture runtimeInitTime after nanotime is initialized

CL 36428 changed the way nanotime works so on Darwin and Windows it
now depends on runtime.startNano, which is computed at runtime.init
time. Unfortunately, the `runtimeInitTime = nanotime()` initialization
happened *before* runtime.init, so on these platforms runtimeInitTime
is set incorrectly. The one (and only) consequence of this is that the
start time printed in gctrace lines is bogus:

gc 1 18446653480.186s 0%: 0.092+0.47+0.038 ms clock, 0.37+0.15/0.81/1.8+0.15 ms cpu, 4->4->1 MB, 5 MB goal, 8 P

To fix this, this commit moves the runtimeInitTime initialization to
shortly after runtime.init, at which point nanotime is safe to use.

This also requires changing the condition in newproc1 that currently
uses runtimeInitTime != 0 simply to detect whether or not the main M
has started. Since runtimeInitTime could genuinely be 0 now, this
introduces a separate flag to newproc1.

Fixes #21554.

Change-Id: Id874a4b912d3fa3d22f58d01b31ffb3548266d3b
Reviewed-on: https://go-review.googlesource.com/58690
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70848
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
6 years ago[release-branch.go1.9] crypto/x509: skip TestSystemRoots
Martin Möhrmann [Tue, 22 Aug 2017 18:00:02 +0000 (20:00 +0200)]
[release-branch.go1.9] crypto/x509: skip TestSystemRoots

golang.org/cl/36941 enabled loading of all trusted certs on darwin
for the non-cgo execSecurityRoots.

The corresponding cgo version golang.org/cl/36942 for systemRootsPool
has not been merged yet.

This tests fails reliably on some darwin systems:
--- FAIL: TestSystemRoots (1.28s)
        root_darwin_test.go:31:     cgo sys roots: 353.552363ms
        root_darwin_test.go:32: non-cgo sys roots: 921.85297ms
        root_darwin_test.go:44: got 169 roots
        root_darwin_test.go:44: got 455 roots
        root_darwin_test.go:73: insufficient overlap between cgo and non-cgo roots; want at least 227, have 168
FAIL
FAIL    crypto/x509     2.445s

Updates #16532
Updates #21416

Change-Id: I52c2c847651fb3621fdb6ab858ebe8e28894c201
Reviewed-on: https://go-review.googlesource.com/57830
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-on: https://go-review.googlesource.com/70847
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
6 years ago[release-branch.go1.9] internal/poll: add tests for Windows file and serial ports
Alex Brainman [Mon, 7 Aug 2017 02:57:58 +0000 (12:57 +1000)]
[release-branch.go1.9] internal/poll: add tests for Windows file and serial ports

I also wanted to test net sockets, but I do not know how to
access their file handles. So I did not implement socket tests.

Updates #21172

Change-Id: I5062c0e65a817571d755397d60762c175f9791ce
Reviewed-on: https://go-review.googlesource.com/53530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/71131
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years ago[release-branch.go1.9] doc: add missing "Minor revisions" header for 1.9
Chris Broadfoot [Wed, 4 Oct 2017 20:20:45 +0000 (13:20 -0700)]
[release-branch.go1.9] doc: add missing "Minor revisions" header for 1.9

Change-Id: Ib042e472e62f48a6afaba1762beaf102a9b99cf5
Reviewed-on: https://go-review.googlesource.com/68290
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/68291
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] go1.9.1 go1.9.1
Chris Broadfoot [Wed, 4 Oct 2017 18:37:20 +0000 (11:37 -0700)]
[release-branch.go1.9] go1.9.1

Change-Id: I711b38738a7f6fade42a2821908234940f3cf280
Reviewed-on: https://go-review.googlesource.com/68233
Reviewed-by: Russ Cox <rsc@golang.org>
6 years ago[release-branch.go1.9] doc: document go1.9.1 and go1.8.4
Chris Broadfoot [Wed, 4 Oct 2017 18:09:15 +0000 (11:09 -0700)]
[release-branch.go1.9] doc: document go1.9.1 and go1.8.4

Change-Id: Ib42fabc6829b6033373c0378713733f88e73e73d
Reviewed-on: https://go-review.googlesource.com/68230
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/68231
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] doc/1.9: add mention of net/http.LocalAddrContextKey
Tom Bergan [Mon, 28 Aug 2017 18:09:37 +0000 (11:09 -0700)]
[release-branch.go1.9] doc/1.9: add mention of net/http.LocalAddrContextKey

Fixes #21603

Reviewed-on: https://go-review.googlesource.com/59530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/59670
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Change-Id: Ie9732d57948593dc0306a4a649664eedb3de370c
Reviewed-on: https://go-review.googlesource.com/68232
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] net/smtp: fix PlainAuth to refuse to send passwords to non...
Russ Cox [Wed, 4 Oct 2017 17:24:49 +0000 (13:24 -0400)]
[release-branch.go1.9] net/smtp: fix PlainAuth to refuse to send passwords to non-TLS servers

PlainAuth originally refused to send passwords to non-TLS servers
and was documented as such.

In 2013, issue #5184 was filed objecting to the TLS requirement,
despite the fact that it is spelled out clearly in RFC 4954.
The only possibly legitimate use case raised was using PLAIN auth
for connections to localhost, and the suggested fix was to let the
server decide: if it advertises that PLAIN auth is OK, believe it.
That approach was adopted in CL 8279043 and released in Go 1.1.

Unfortunately, this is exactly wrong. The whole point of the TLS
requirement is to make sure not to send the password to the wrong
server or to a man-in-the-middle. Instead of implementing this rule,
CL 8279043 blindly trusts the server, so that if a man-in-the-middle
says "it's OK, you can send me your password," PlainAuth does.
And the documentation was not updated to reflect any of this.

This CL restores the original TLS check, as required by RFC 4954
and as promised in the documentation for PlainAuth.
It then carves out a documented exception for connections made
to localhost (defined as "localhost", "127.0.0.1", or "::1").

Cherry-pick of CL 68170.

Change-Id: I1d3729bbd33aa2f11a03f4c000e6bb473164957b
Reviewed-on: https://go-review.googlesource.com/68210
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] cmd/go: reject update of VCS inside VCS
Russ Cox [Fri, 22 Sep 2017 16:17:21 +0000 (12:17 -0400)]
[release-branch.go1.9] cmd/go: reject update of VCS inside VCS

Cherry-pick of CL 68110.

Change-Id: Iae84c6404ab5eeb6950faa2364f97a017c67c506
Reviewed-on: https://go-review.googlesource.com/68022
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] runtime: deflake TestPeriodicGC
Russ Cox [Wed, 4 Oct 2017 16:28:20 +0000 (12:28 -0400)]
[release-branch.go1.9] runtime: deflake TestPeriodicGC

It was only waiting 0.1 seconds for the two GCs it wanted.
Let it wait 1 second.

Change-Id: Ib3cdc8127cbf95694a9f173643c02529a85063af
Reviewed-on: https://go-review.googlesource.com/68118
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] go1.9 go1.9
Chris Broadfoot [Thu, 24 Aug 2017 19:57:28 +0000 (12:57 -0700)]
[release-branch.go1.9] go1.9

Change-Id: I0899ec0150f2a051b7572879b446a8548f742ae0
Reviewed-on: https://go-review.googlesource.com/58731
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] doc: add go1.9 to golang.org/project
Chris Broadfoot [Tue, 1 Aug 2017 00:28:35 +0000 (17:28 -0700)]
[release-branch.go1.9] doc: add go1.9 to golang.org/project

Pre-emptive. Go 1.9 is expected to be released in August.

Change-Id: I0f58c012c4110bf490022dc2c1d69c0988d73bfa
Reviewed-on: https://go-review.googlesource.com/52351
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/58730
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] doc: document go1.9
Chris Broadfoot [Thu, 24 Aug 2017 18:52:35 +0000 (11:52 -0700)]
[release-branch.go1.9] doc: document go1.9

Change-Id: I97075f24319a4b96cbeb9e3ff2e7b2056ff59e32
Reviewed-on: https://go-review.googlesource.com/58651
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/58710
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] doc/go1.9: fix typo in Moved GOROOT
Ryuji IWATA [Sun, 20 Aug 2017 02:03:57 +0000 (11:03 +0900)]
[release-branch.go1.9] doc/go1.9: fix typo in Moved GOROOT

Change-Id: I71bfff6a3462e6dfd7a65ef76ec56644bae37c34
Reviewed-on: https://go-review.googlesource.com/57272
Reviewed-by: Avelino <t@avelino.xxx>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/58650
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: remove gc.Sysfunc calls from 387 backend
Josh Bleecher Snyder [Tue, 8 Aug 2017 23:38:25 +0000 (16:38 -0700)]
[release-branch.go1.9] cmd/compile: remove gc.Sysfunc calls from 387 backend

[This is a cherry-pick of CL 54090 to the 1.9 release branch.]

gc.Sysfunc must not be called concurrently.
We set up runtime routines used by the backend
prior to doing any backend compilation.
I missed the 387 ones; fix that.

Sysfunc should have been unexported during 1.9.
I will rectify that in a subsequent CL.

Fixes #21352

Change-Id: I485bb1867b46d8e5cf64bc820b8963576dc16174
Reviewed-on: https://go-review.googlesource.com/55970
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] doc/go1.9: fix typo in crypto/x509 of "Minor changes to the...
Ian Lance Taylor [Mon, 21 Aug 2017 04:29:18 +0000 (21:29 -0700)]
[release-branch.go1.9] doc/go1.9: fix typo in crypto/x509 of "Minor changes to the library".

Backport of https://golang.org/cl/57390 to 1.9 release branch.

Change-Id: Ieea5a048732db7ee5dc5cf13f06e11ca4f5313cc
Reviewed-on: https://go-review.googlesource.com/57450
Reviewed-by: Keith Randall <khr@golang.org>
6 years ago[release-branch.go1.9] runtime: fix false positive race in profile label reading
Austin Clements [Thu, 17 Aug 2017 22:40:07 +0000 (18:40 -0400)]
[release-branch.go1.9] runtime: fix false positive race in profile label reading

Because profile labels are copied from the goroutine into the tag
buffer by the signal handler, there's a carefully-crafted set of race
detector annotations to create the necessary happens-before edges
between setting a goroutine's profile label and retrieving it from the
profile tag buffer.

Given the constraints of the signal handler, we have to approximate
the true synchronization behavior. Currently, that approximation is
too weak.

Ideally, runtime_setProfLabel would perform a store-release on
&getg().labels and copying each label into the profile would perform a
load-acquire on &getg().labels. This would create the necessary
happens-before edges through each individual g.labels object.

Since we can't do this in the signal handler, we instead synchronize
on a "labelSync" global. The problem occurs with the following
sequence:

1. Goroutine 1 calls setProfLabel, which does a store-release on
   labelSync.

2. Goroutine 2 calls setProfLabel, which does a store-release on
   labelSync.

3. Goroutine 3 reads the profile, which does a load-acquire on
   labelSync.

The problem is that the load-acquire only synchronizes with the *most
recent* store-release to labelSync, and the two store-releases don't
synchronize with each other. So, once goroutine 3 touches the label
set by goroutine 1, we report a race.

The solution is to use racereleasemerge. This is like a
read-modify-write, rather than just a store-release. Each RMW of
labelSync in runtime_setProfLabel synchronizes with the previous RMW
of labelSync, and this ultimately carries forward to the load-acquire,
so it synchronizes with *all* setProfLabel operations, not just the
most recent.

Change-Id: Iab58329b156122002fff12cfe64fbeacb31c9613
Reviewed-on: https://go-review.googlesource.com/57190
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] testing: don't fail all tests after racy test failure
Ian Lance Taylor [Fri, 18 Aug 2017 19:58:08 +0000 (12:58 -0700)]
[release-branch.go1.9] testing: don't fail all tests after racy test failure

The code was adding race.Errors to t.raceErrors before checking
Failed, but Failed was using t.raceErrors+race.Errors. We don't want
to change Failed, since that would affect tests themselves, so modify
the harness to not unnecessarily change t.raceErrors.

Updates #19851
Fixes #21338

Change-Id: I483f27c68c340928f1cbdef160abc0a5716efb5d
Reviewed-on: https://go-review.googlesource.com/57151
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.9] cmd/dist: update deps.go for current dependencies
Ian Lance Taylor [Fri, 18 Aug 2017 20:26:52 +0000 (13:26 -0700)]
[release-branch.go1.9] cmd/dist: update deps.go for current dependencies

Fixes #21456

Change-Id: I7841d816e8c1c581e61db4f24124f99f5184fead
Reviewed-on: https://go-review.googlesource.com/57170
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: add rules handling unsigned div/mod by constant...
Cherry Zhang [Fri, 18 Aug 2017 12:37:58 +0000 (08:37 -0400)]
[release-branch.go1.9] cmd/compile: add rules handling unsigned div/mod by constant 1<<63

Cherry-pick CL 56890.

Normally 64-bit div/mod is turned into runtime calls on 32-bit
arch, but the front end leaves power-of-two constant division
and hopes the SSA backend turns into a shift or AND. The SSA rule is

(Mod64u <t> n (Const64 [c])) && isPowerOfTwo(c) -> (And64 n (Const64 <t> [c-1]))

But isPowerOfTwo returns true only for positive int64, which leaves
out 1<<63 unhandled. Add a special case for 1<<63.

Fixes #21517.

Change-Id: Ic91f86fd5e035a8bb64b937c15cb1c38fec917d6
Reviewed-on: https://go-review.googlesource.com/57070
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] runtime: fix usleep by correctly setting nanoseconds parameter...
pvoicu [Fri, 18 Aug 2017 10:32:49 +0000 (03:32 -0700)]
[release-branch.go1.9] runtime: fix usleep by correctly setting nanoseconds parameter for pselect6

Fixes #21518

Change-Id: Idd67e3f0410d0ce991b34dcc0c8f15e0d5c529c9
Reviewed-on: https://go-review.googlesource.com/56891
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Petrica Voicu <pvoicu@paypal.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago[release-branch.go1.9] go1.9rc2 go1.9rc2
Chris Broadfoot [Mon, 7 Aug 2017 19:23:06 +0000 (12:23 -0700)]
[release-branch.go1.9] go1.9rc2

Change-Id: If95cec0ec7e32cdb450818c4c55e2d03b847ab65
Reviewed-on: https://go-review.googlesource.com/53630
Reviewed-by: Austin Clements <austin@google.com>
6 years ago[release-branch.go1.9] all: merge master into release-branch.go1.9
Chris Broadfoot [Mon, 7 Aug 2017 17:28:03 +0000 (10:28 -0700)]
[release-branch.go1.9] all: merge master into release-branch.go1.9

579120323f runtime: mapassign_* should use typedmemmove to update keys
380525598c all: remove some manual hyphenation
f096b5b340 runtime: mark activeModules nosplit/nowritebarrier
3e3da54633 math/bits: fix example for OnesCount64
9b1e7cf2ac math/bits: add examples for OnesCount functions
b01db023b1 misc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC
a279b53a18 reflect: document how DeepEqual handles cycles
909f409a8d doc: mention handling of moved GOROOT in 1.9 release notes
58ad0176ca doc: use better wording to explain type-aware completion
92dac21d29 doc: replace paid with commercial
9bb98e02de doc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.
78d74fc2cd doc: clarify that Gogland is for paid IntelliJ platform IDEs
5495047223 doc/1.9: fix broken html link in CL 53030/53210
890e0e862f doc: fix bad link in go1.9 release notes
be596f049a doc/1.9: fix stray html in CL 53030
0173631d53 encoding/binary: add examples for varint functions
ac0ccf3cd2 doc/1.9: add CL 36696 for crypto/x509 to the release notes
cc402c2c4d doc: hide blog content for golang.google.cn
f396fa4285 internal/poll: don't add non-sockets to runtime poller
664cd26c89 cmd/vet: don't exit with failure on type checking error
a8730cd93a doc: hide video and share if being served from CN
b63db76c4a testsanitizers: check that tsan program runs, skip tsan10 on gcc
193eda7291 time: skip ZoneAbbr test in timezones with no abbreviation
6f08c935a9 cmd/go: show examples with empty output in go test -list
f20944de78 cmd/compile: set/unset base register for better assembly print
623e2c4603 runtime: map bitmap and spans during heap initialization
780249eed4 runtime: fall back to small mmaps if we fail to grow reservation
31b2c4cc25 .github: add .md extension to SUPPORT file
ac29f30dbb plugin: mention that there are known bugs with plugins
45a4609c0a cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
e157fac02d test: add README
835dfef939 runtime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}
df91b8044d doc: list editor options by name, not plugin name
3d9475c04b doc: cleanup editor page
b9661a14ea doc: add Atom to editor guide
ee392ac10c cmd/compile: consider exported flag in namedata

Change-Id: I3a48493e8c05d97cb3b61635503ef0ccd646e5cb

6 years agoruntime: mapassign_* should use typedmemmove to update keys
Keith Randall [Sat, 5 Aug 2017 16:58:41 +0000 (09:58 -0700)]
runtime: mapassign_* should use typedmemmove to update keys

We need to make sure that when the key contains a pointer, we use
a write barrier to update the key.

Also mapdelete_* should use typedmemclr.

Fixes #21297

Change-Id: I63dc90bec1cb909c2c6e08676c9ec853d736cdf8
Reviewed-on: https://go-review.googlesource.com/53414
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoall: remove some manual hyphenation
Josh Bleecher Snyder [Sun, 6 Aug 2017 13:17:42 +0000 (06:17 -0700)]
all: remove some manual hyphenation

Manual hyphenation doesn't work well when text gets reflown,
for example by godoc.

There are a few other manual hyphenations in the tree,
but they are in local comments or comments for unexported functions.

Change-Id: I17c9b1fee1def650da48903b3aae2fa1e1119a65
Reviewed-on: https://go-review.googlesource.com/53510
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: mark activeModules nosplit/nowritebarrier
Ian Lance Taylor [Fri, 4 Aug 2017 17:36:40 +0000 (10:36 -0700)]
runtime: mark activeModules nosplit/nowritebarrier

The activeModules function is called by the cgo pointer checking code,
which is called by the write barrier (when GODEBUG=cgocheck=2), and as
such must be nosplit/nowritebarrier.

Fixes #21306

Change-Id: I57f2124f14de7f3872b2de9532abab15df95d45a
Reviewed-on: https://go-review.googlesource.com/53352
Reviewed-by: Austin Clements <austin@google.com>
6 years agomath/bits: fix example for OnesCount64
Francesc Campoy Flores [Sat, 5 Aug 2017 00:03:33 +0000 (17:03 -0700)]
math/bits: fix example for OnesCount64

Erroneously called OnesCount instead of OnesCount64

Change-Id: Ie877e43f213253e45d31f64931c4a15915849586
Reviewed-on: https://go-review.googlesource.com/53410
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agomath/bits: add examples for OnesCount functions
Francesc Campoy [Fri, 4 Aug 2017 22:41:57 +0000 (15:41 -0700)]
math/bits: add examples for OnesCount functions

Change-Id: Ie673f9665825a40281c2584d478ba1260f725856
Reviewed-on: https://go-review.googlesource.com/53357
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agomisc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC
Ian Lance Taylor [Fri, 4 Aug 2017 22:33:48 +0000 (15:33 -0700)]
misc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC

Updates #21196

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

6 years agoreflect: document how DeepEqual handles cycles
Ian Lance Taylor [Thu, 3 Aug 2017 00:52:06 +0000 (17:52 -0700)]
reflect: document how DeepEqual handles cycles

Fixes #20428

Change-Id: Ia450e615728efd4ccb6e42117b547cac162f13a3
Reviewed-on: https://go-review.googlesource.com/52931
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
6 years agodoc: mention handling of moved GOROOT in 1.9 release notes
Ian Lance Taylor [Fri, 4 Aug 2017 18:23:25 +0000 (11:23 -0700)]
doc: mention handling of moved GOROOT in 1.9 release notes

Updates #20587

Change-Id: Ia131b9a4dc4986950d9ecbfcbd6b026ade234fc0
Reviewed-on: https://go-review.googlesource.com/53370
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: use better wording to explain type-aware completion
Jaana Burcu Dogan [Fri, 4 Aug 2017 19:59:55 +0000 (12:59 -0700)]
doc: use better wording to explain type-aware completion

Some editors can filter the autocompletion suggestions based on
whether the code will compile once autocompleted. Explain this
feature with better wording.

Change-Id: I29e4b0396878f18c79208915402c0a209a813b04
Reviewed-on: https://go-review.googlesource.com/53355
Reviewed-by: Florin Patan <florinpatan@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc: replace paid with commercial
Jaana Burcu Dogan [Fri, 4 Aug 2017 19:44:18 +0000 (12:44 -0700)]
doc: replace paid with commercial

Change-Id: I3e6de4da0648f61e254c7597f316df3e5791321a
Reviewed-on: https://go-review.googlesource.com/53354
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.
Tristan Colgate [Fri, 4 Aug 2017 07:27:56 +0000 (08:27 +0100)]
doc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.

Add https://go-review.googlesource.com/c/43712,
"net/http/httputil: ReverseProxy should pass on unannounced Trailers"
to the relase notes.

Fixes #21307

Change-Id: I52c126987a5d0abc4153c0e71b535529c46cd457
Reviewed-on: https://go-review.googlesource.com/53290
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: clarify that Gogland is for paid IntelliJ platform IDEs
Jaana Burcu Dogan [Fri, 4 Aug 2017 16:47:06 +0000 (09:47 -0700)]
doc: clarify that Gogland is for paid IntelliJ platform IDEs

Fixes #21213.

Change-Id: I7b8a84de92bbd1d3f78f8a9612f3af8cd092cb94
Reviewed-on: https://go-review.googlesource.com/53351
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc/1.9: fix broken html link in CL 53030/53210
Dmitry Savintsev [Fri, 4 Aug 2017 08:12:21 +0000 (10:12 +0200)]
doc/1.9: fix broken html link in CL 53030/53210

Change-Id: I7176becd10ad84cbfc3fb9427e190028626e5baf
Reviewed-on: https://go-review.googlesource.com/53291
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: fix bad link in go1.9 release notes
Alberto Donizetti [Fri, 4 Aug 2017 10:13:33 +0000 (12:13 +0200)]
doc: fix bad link in go1.9 release notes

Change-Id: I64ba37428f5cc560f0f20fe039feaecf5fcda93e
Reviewed-on: https://go-review.googlesource.com/53330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc/1.9: fix stray html in CL 53030
Dmitry Savintsev [Thu, 3 Aug 2017 21:25:59 +0000 (23:25 +0200)]
doc/1.9: fix stray html in CL 53030

Change-Id: Ib4102b1e2a8863712f725c4d1e37fdbe3dfe3c07
Reviewed-on: https://go-review.googlesource.com/53210
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/binary: add examples for varint functions
Axel Wagner [Sat, 15 Jul 2017 17:43:22 +0000 (11:43 -0600)]
encoding/binary: add examples for varint functions

Change-Id: I191f6e46b452fadde9f641140445d843b0c7d534
Reviewed-on: https://go-review.googlesource.com/48604
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/1.9: add CL 36696 for crypto/x509 to the release notes
Dmitry Savintsev [Thu, 3 Aug 2017 14:51:32 +0000 (16:51 +0200)]
doc/1.9: add CL 36696 for crypto/x509 to the release notes

add https://go-review.googlesource.com/c/36696
"crypto/x509: ignore CN if SAN extension present"
to the release notes.

Fixes #21289

Change-Id: Ifa184d3816806a8da3c67b68476c923329acf13e
Reviewed-on: https://go-review.googlesource.com/53030
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: hide blog content for golang.google.cn
Andrew Bonventre [Thu, 3 Aug 2017 16:33:26 +0000 (12:33 -0400)]
doc: hide blog content for golang.google.cn

/blog redirects to blog.golang.org (currently blocked in China)
unless there is a local checkout of golang.org/x/blog, which is
not possible on App Engine Classic.

Change-Id: Ia695e663c9bebcc6c3bedea324c630299eaad4dc
Reviewed-on: https://go-review.googlesource.com/53051
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agointernal/poll: don't add non-sockets to runtime poller
Ian Lance Taylor [Tue, 1 Aug 2017 23:05:17 +0000 (16:05 -0700)]
internal/poll: don't add non-sockets to runtime poller

Updates #21172

Change-Id: I0fec6e645328bbc85f3e47f4f71dd8d1d68c75ab
Reviewed-on: https://go-review.googlesource.com/52551
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agocmd/vet: don't exit with failure on type checking error
Ian Lance Taylor [Wed, 2 Aug 2017 19:06:58 +0000 (12:06 -0700)]
cmd/vet: don't exit with failure on type checking error

The vet tool only reports a type checking error when invoked with -v.
Don't let that by itself cause vet to exit with an error exit status.

Updates #21188

Change-Id: I172c13d46c35d49e229e96e833683d8c82a77de7
Reviewed-on: https://go-review.googlesource.com/52851
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
6 years agodoc: hide video and share if being served from CN
Andrew Bonventre [Wed, 2 Aug 2017 20:31:46 +0000 (16:31 -0400)]
doc: hide video and share if being served from CN

In the case where requests are coming from mainland China, hide
links to locations that are blocked and functionality that is
not permitted.

Additionally, some very small cleanup of the JS.

This change requires https://go-review.googlesource.com/c/52873

Change-Id: I7fc68748e629dbe5b966d6bf117e7f7b546966eb
Reviewed-on: https://go-review.googlesource.com/52872
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agotestsanitizers: check that tsan program runs, skip tsan10 on gcc
Ian Lance Taylor [Wed, 2 Aug 2017 17:49:20 +0000 (10:49 -0700)]
testsanitizers: check that tsan program runs, skip tsan10 on gcc

Check not only that a tsan program can be built, but also that it runs.
This fails with some installations of GCC 7.

Skip the tsan10 program when using GCC, as it reportedly hangs.

This is a patch to help people build 1.9; we may be able to do a
better fix for 1.10.

Updates #21196

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

6 years agotime: skip ZoneAbbr test in timezones with no abbreviation
Alberto Donizetti [Tue, 1 Aug 2017 15:41:51 +0000 (17:41 +0200)]
time: skip ZoneAbbr test in timezones with no abbreviation

The testZoneAbbr assumes that

  Parse(RFC1123, t1.Format(RFC1123))

will always succeed. This is not true because Format will fall back to
the numeric zone (ex. -07) for timezones with no abbreviation, but
Parse won't accept the numeric zone when the layout specifies 'MST'
(an abbreviation).

Skip the zone abbreviation test in timezones with no abbreviation.

Fixes #21183

Change-Id: If04691cc23ae1075d8a953733024e17f5a7646de
Reviewed-on: https://go-review.googlesource.com/52430
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: show examples with empty output in go test -list
Seiji Takahashi [Sun, 30 Jul 2017 12:00:09 +0000 (21:00 +0900)]
cmd/go: show examples with empty output in go test -list

Fixes #21205

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

6 years agocmd/compile: set/unset base register for better assembly print
Cherry Zhang [Tue, 18 Jul 2017 12:35:00 +0000 (08:35 -0400)]
cmd/compile: set/unset base register for better assembly print

For address of an auto or arg, on all non-x86 architectures
the assembler backend encodes the actual SP offset in the
instruction but leaves the offset in Prog unchanged. When the
assembly is printed in compile -S, it shows an offset
relative to pseudo FP/SP with an actual hardware SP base
register (e.g. R13 on ARM). This is confusing. Unset the
base register if it is indeed SP, so the assembly output is
consistent. If the base register isn't SP, it should be an
error and the error output contains the actual base register.

For address loading instructions, the base register isn't set
in the compiler on non-x86 architectures. Set it. Normally it
is SP and will be unset in the change mentioned above for
printing. If it is not, it will be an error and the error
output contains the actual base register.

No change in generated binary, only printed assembly. Passes
"go build -a -toolexec 'toolstash -cmp' std cmd" on all
architectures.

Fixes #21064.

Change-Id: Ifafe8d5f9b437efbe824b63b3cbc2f5f6cdc1fd5
Reviewed-on: https://go-review.googlesource.com/49432
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
6 years ago[release-branch.go1.9] runtime: map bitmap and spans during heap initialization
Austin Clements [Fri, 28 Jul 2017 21:44:09 +0000 (17:44 -0400)]
[release-branch.go1.9] runtime: map bitmap and spans during heap initialization

We lazily map the bitmap and spans areas as the heap grows. However,
right now we're very slightly too lazy. Specifically, the following
can happen on 32-bit:

1. mallocinit fails to allocate any heap arena, so
   arena_used == arena_alloc == arena_end == bitmap.

2. There's less than 256MB between the end of the bitmap mapping and
   the next mapping.

3. On the first allocation, mheap.sysAlloc sees that there's not
   enough room in [arena_alloc, arena_end) because there's no room at
   all. It gets a 256MB mapping from somewhere *lower* in the address
   space than arena_used and sets arena_alloc and arena_end to this
   hole.

4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
   doesn't bother to call mheap.setArenaUsed, so we still don't have a
   bitmap mapping or a spans array mapping.

5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
   spans array and crashes.

Fix this by mapping the metadata regions for the initial arena_used
when the heap is initialized, rather than trying to wait for an
allocation. This maintains the intended invariant that the structures
are always mapped for [arena_start, arena_used).

Fixes #21044.

Cherry-pick of CL 51714. Fixes #21234.

Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
Reviewed-on: https://go-review.googlesource.com/52191
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation
Austin Clements [Fri, 28 Jul 2017 22:06:03 +0000 (18:06 -0400)]
[release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation

Right now, if it's possible to grow the arena reservation but
mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
However, on 32-bit we have a fallback path that uses much smaller
mmaps that could take in this situation, but fail to.

This commit fixes mheap.sysAlloc to use a common failure path in case
it can't grow the reservation. On 32-bit, this path includes the
fallback.

Ideally, mheap.sysAlloc would attempt smaller reservation growths
first, but taking the fallback path is a simple change for Go 1.9.

Updates #21044 (fixes one of two issues).

Cherry-pick of CL 51713. Updates #21234.

Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
Reviewed-on: https://go-review.googlesource.com/52190
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: map bitmap and spans during heap initialization
Austin Clements [Fri, 28 Jul 2017 21:44:09 +0000 (17:44 -0400)]
runtime: map bitmap and spans during heap initialization

We lazily map the bitmap and spans areas as the heap grows. However,
right now we're very slightly too lazy. Specifically, the following
can happen on 32-bit:

1. mallocinit fails to allocate any heap arena, so
   arena_used == arena_alloc == arena_end == bitmap.

2. There's less than 256MB between the end of the bitmap mapping and
   the next mapping.

3. On the first allocation, mheap.sysAlloc sees that there's not
   enough room in [arena_alloc, arena_end) because there's no room at
   all. It gets a 256MB mapping from somewhere *lower* in the address
   space than arena_used and sets arena_alloc and arena_end to this
   hole.

4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
   doesn't bother to call mheap.setArenaUsed, so we still don't have a
   bitmap mapping or a spans array mapping.

5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
   spans array and crashes.

Fix this by mapping the metadata regions for the initial arena_used
when the heap is initialized, rather than trying to wait for an
allocation. This maintains the intended invariant that the structures
are always mapped for [arena_start, arena_used).

Fixes #21044.

Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
Reviewed-on: https://go-review.googlesource.com/51714
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: fall back to small mmaps if we fail to grow reservation
Austin Clements [Fri, 28 Jul 2017 22:06:03 +0000 (18:06 -0400)]
runtime: fall back to small mmaps if we fail to grow reservation

Right now, if it's possible to grow the arena reservation but
mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
However, on 32-bit we have a fallback path that uses much smaller
mmaps that could take in this situation, but fail to.

This commit fixes mheap.sysAlloc to use a common failure path in case
it can't grow the reservation. On 32-bit, this path includes the
fallback.

Ideally, mheap.sysAlloc would attempt smaller reservation growths
first, but taking the fallback path is a simple change for Go 1.9.

Updates #21044 (fixes one of two issues).

Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
Reviewed-on: https://go-review.googlesource.com/51713
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago.github: add .md extension to SUPPORT file
Gustav Westling [Sun, 30 Jul 2017 20:14:22 +0000 (22:14 +0200)]
.github: add .md extension to SUPPORT file

This makes GitHub render the markdown file automatically
on their web UI.

SUPPORT.md is the recommended file name according to the GitHub
documentation:
https://help.github.com/articles/adding-support-resources-to-your-project/

Fixes #21223

Change-Id: I9f9b9daced9c29a16850e8c446656f353f50b1ae
Reviewed-on: https://go-review.googlesource.com/52013
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoplugin: mention that there are known bugs with plugins
Ian Lance Taylor [Wed, 26 Jul 2017 16:46:58 +0000 (09:46 -0700)]
plugin: mention that there are known bugs with plugins

Change-Id: I9e63661cac2bebc41d7aa3cd80e1920eec22b894
Reviewed-on: https://go-review.googlesource.com/51250
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
6 years ago[release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when...
Brad Fitzpatrick [Thu, 27 Jul 2017 04:33:18 +0000 (04:33 +0000)]
[release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests

Change-Id: I0bcae339624e7d61037d9ea0885b7bd07491bbb6
Reviewed-on: https://go-review.googlesource.com/51430
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 4833e920c1d7f6b23458e6ff3c73951fcf754219)
Reviewed-on: https://go-review.googlesource.com/51450
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
Brad Fitzpatrick [Thu, 27 Jul 2017 04:33:18 +0000 (04:33 +0000)]
cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests

Change-Id: I0bcae339624e7d61037d9ea0885b7bd07491bbb6
Reviewed-on: https://go-review.googlesource.com/51430
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agotest: add README
Josh Bleecher Snyder [Mon, 24 Jul 2017 17:17:15 +0000 (10:17 -0700)]
test: add README

Updates #21034

Change-Id: I951fb48ab3b9ed54d225c11879db8f09048a36a3
Reviewed-on: https://go-review.googlesource.com/50950
Reviewed-by: Rob Pike <r@golang.org>
6 years agoruntime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}
Vladimir Stefanovic [Thu, 4 May 2017 14:45:29 +0000 (16:45 +0200)]
runtime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}

64bit atomics on mips/mipsle are implemented using spinlocks. If SIGPROF
is received while the program is in the critical section, it will try to
write the sample using the same spinlock, creating a deadloop.
Prevent it by creating a counter of SIGPROFs during atomic64 and
postpone writing the sample(s) until called from elsewhere, with
pc set to _LostSIGPROFDuringAtomic64.

Added a test case, per Cherry's suggestion. Works around #20146.

Change-Id: Icff504180bae4ee83d78b19c0d9d6a80097087f9
Reviewed-on: https://go-review.googlesource.com/42652
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agodoc: list editor options by name, not plugin name
Jaana Burcu Dogan [Tue, 25 Jul 2017 20:03:48 +0000 (13:03 -0700)]
doc: list editor options by name, not plugin name

So the users can recognize their option by their editor's name.

Fixes #20398.

Change-Id: Id314d4dbe26f40231a479b179620d7e66512b506
Reviewed-on: https://go-review.googlesource.com/51114
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agodoc: cleanup editor page
Zac Bergquist [Tue, 25 Jul 2017 18:08:47 +0000 (14:08 -0400)]
doc: cleanup editor page

Fix some UI issues introduced with CL50952:
- increase header colspan to account for additional column
- remove ':' character from footnotes

Change-Id: I56f59b8e4b2852612b3c6c7c0dfe99125dd8b57b
Reviewed-on: https://go-review.googlesource.com/51113
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
6 years agodoc: add Atom to editor guide
Zac Bergquist [Mon, 24 Jul 2017 23:05:43 +0000 (19:05 -0400)]
doc: add Atom to editor guide

Fixes #20569

Change-Id: I752a49ed50c1567f8db7112859ac073f37dd77dc
Reviewed-on: https://go-review.googlesource.com/50952
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
6 years ago[release-branch.go1.9] go1.9rc1 go1.9rc1
Chris Broadfoot [Mon, 24 Jul 2017 17:28:28 +0000 (10:28 -0700)]
[release-branch.go1.9] go1.9rc1

Change-Id: I6251fc128990f9494a0b037cabb24ada5eabb6b5
Reviewed-on: https://go-review.googlesource.com/50951
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: consider exported flag in namedata
Ian Lance Taylor [Fri, 21 Jul 2017 23:37:40 +0000 (16:37 -0700)]
[release-branch.go1.9] cmd/compile: consider exported flag in namedata

It is possible to have an unexported name with a nil package,
for an embedded field whose type is a pointer to an unexported type.
We must encode that fact in the type..namedata symbol name,
to avoid incorrectly merging an unexported name with an exported name.

Fixes #21120

Change-Id: I2e3879d77fa15c05ad92e0bf8e55f74082db5111
Reviewed-on: https://go-review.googlesource.com/50710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-on: https://go-review.googlesource.com/50970
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agocmd/compile: consider exported flag in namedata
Ian Lance Taylor [Fri, 21 Jul 2017 23:37:40 +0000 (16:37 -0700)]
cmd/compile: consider exported flag in namedata

It is possible to have an unexported name with a nil package,
for an embedded field whose type is a pointer to an unexported type.
We must encode that fact in the type..namedata symbol name,
to avoid incorrectly merging an unexported name with an exported name.

Fixes #21120

Change-Id: I2e3879d77fa15c05ad92e0bf8e55f74082db5111
Reviewed-on: https://go-review.googlesource.com/50710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
6 years agocmd/link: use full link, not compile, to test for -no-?pie
Ian Lance Taylor [Mon, 24 Jul 2017 17:13:25 +0000 (10:13 -0700)]
cmd/link: use full link, not compile, to test for -no-?pie

This avoids an error from clang when using -nopie during compilation,
and permits us to check that the entire build succeeds.

Updates #21042

Change-Id: I2e6c7d5c97a85c223ed3288622bbb58ce33b8774
Reviewed-on: https://go-review.googlesource.com/50874
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago.github: recommend 'go bug' when filing an issue
Josh Bleecher Snyder [Mon, 24 Jul 2017 16:54:13 +0000 (09:54 -0700)]
.github: recommend 'go bug' when filing an issue

It was released with 1.8, so it should be widely available.

Change-Id: I7dcf205009b528071ea63f99cb5da0db183df341
Reviewed-on: https://go-review.googlesource.com/50932
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago.github: add SUPPORT file
Josh Bleecher Snyder [Mon, 24 Jul 2017 15:18:06 +0000 (08:18 -0700)]
.github: add SUPPORT file

GitHub recently added support for a SUPPORT file:

https://github.com/blog/2400-support-file-support

This SUPPORT file is a very lightly edited copy
of the wiki entry on asking questions:

https://github.com/golang/go/wiki/Questions

Change-Id: Ic1eb74d985ea30862defb99750fb42da84e492de
Reviewed-on: https://go-review.googlesource.com/50930
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/json: ignore embedded fields of pointers to unexported non-structs
Joe Tsai [Fri, 21 Jul 2017 23:53:54 +0000 (16:53 -0700)]
encoding/json: ignore embedded fields of pointers to unexported non-structs

https://golang.org/cl/33773 fixes the JSON marshaler to avoid serializing
embedded fields on unexported types of non-struct types. However, Go allows
embedding pointer to types, so the check for whether the field is a non-struct
type must first dereference the pointer to get at the underlying type.

Furthermore, due to a edge-case in the behavior of StructField.PkgPath not
being a reliable indicator of whether the field is unexported (see #21122),
we use our own logic to determine whether the field is exported or not.

The logic in this CL may be simplified depending on what happens in #21122.

Fixes #21121
Updates #21122

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