aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-22[release-branch.go1.9] go1.9.3go1.9.3Andrew Bonventre
Change-Id: I9347a78c86dcc13cd5f6f000e788934cb1bda491 Reviewed-on: https://go-review.googlesource.com/89015 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] doc/contrib.html: fix outdated linkStanislav Afanasev
Change-Id: I6d94a14a781a2fbeb90db35ae3490ce2ac5f8ed1 Reviewed-on: https://go-review.googlesource.com/83315 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 2fb9fe48c63ed0b7eee36d0d8c2d494ad70602b0) Reviewed-on: https://go-review.googlesource.com/89036 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] doc: update 1.9.3 release dateAndrew Bonventre
Change-Id: I689ccfb8452a170629425dc97da503b28766c6f9 Reviewed-on: https://go-review.googlesource.com/89035 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 7abbaddea4819515e1dad817cc1090e18f655b60) Reviewed-on: https://go-review.googlesource.com/89055 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] doc: change anchor URLs from golang.org/dl/ to /dl/Andrew Bonventre
When running locally, it will redirect properly to golang.org/dl/ (see https://github.com/golang/tools/blob/master/cmd/godoc/dl.go). This is to support domains in prod other than golang.org. Change-Id: I6d3051fcd7e06a86442324a64d781d8ad95c624f Reviewed-on: https://go-review.googlesource.com/88679 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/88715 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-22[release-branch.go1.9] net/http: update bundled http2Andrew Bonventre
Updates http2 to x/net/http2 git rev 44b7c21 for http2: Discard data reads on HEAD requests https://golang.org/cl/88655 Fixes golang/go#22376 Change-Id: I931d9065d7309bc6d3f978bfe8cc6a9f940ce9e9 Reviewed-on: https://go-review.googlesource.com/88676 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-22[release-branch.go1.9] cmd/compile: fix mapassign_fast* routines for pointer ↵Keith Randall
keys The signature of the mapassign_fast* routines need to distinguish the pointerness of their key argument. If the affected routines suspend part way through, the object pointed to by the key might get garbage collected because the key is typed as a uint{32,64}. This is not a problem for mapaccess or mapdelete because the key in those situations do not live beyond the call involved. If the object referenced by the key is garbage collected prematurely, the code still works fine. Even if that object is subsequently reallocated, it can't be written to the map in time to affect the lookup/delete. Fixes #22781 Change-Id: I0bbbc5e9883d5ce702faf4e655348be1191ee439 Reviewed-on: https://go-review.googlesource.com/79018 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Martin Möhrmann <moehrmann@google.com> Reviewed-on: https://go-review.googlesource.com/88635 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2018-01-22[release-branch.go1.9] net/url: reject invalid userinfo values when parsing URLsBrad Fitzpatrick
Fixes #23392 Change-Id: I5822b082b14d886b9c3b5ad7beebb2c01a77851b Reviewed-on: https://go-review.googlesource.com/87038 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/88535 Run-TryBot: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] runtime: call amd64 VDSO entry points on large stackIan Lance Taylor
NOTE: This elides changes to src/runtime/sys_linux_386.s since that requires another change (golang.org/cl/69390) which we don’t want to backport. If the Linux kernel was built with CONFIG_OPTIMIZE_INLINING=n and was built with hardening options turned on, GCC will insert a stack probe in the VDSO function that requires a full page of stack space. The stack probe can corrupt memory if another thread is using it. Avoid sporadic crashes by calling the VDSO on the g0 or gsignal stack. While we're at it, align the stack as C code expects. We've been getting away with a misaligned stack, but it's possible that the VDSO code will change in the future to break that assumption. Benchmarks show a 11% hit on time.Now, but it's only 6ns. name old time/op new time/op delta AfterFunc-12 1.66ms ± 0% 1.66ms ± 1% ~ (p=0.905 n=9+10) After-12 1.90ms ± 6% 1.86ms ± 0% -2.05% (p=0.012 n=10+8) Stop-12 113µs ± 3% 115µs ± 2% +1.60% (p=0.017 n=9+10) SimultaneousAfterFunc-12 145µs ± 1% 144µs ± 0% -0.68% (p=0.002 n=10+8) StartStop-12 39.5µs ± 3% 40.4µs ± 5% +2.19% (p=0.023 n=10+10) Reset-12 10.2µs ± 0% 10.4µs ± 0% +2.45% (p=0.000 n=10+9) Sleep-12 190µs ± 1% 190µs ± 1% ~ (p=0.971 n=10+10) Ticker-12 4.68ms ± 2% 4.64ms ± 2% -0.83% (p=0.043 n=9+10) Now-12 48.4ns ±11% 54.0ns ±11% +11.42% (p=0.017 n=10+10) NowUnixNano-12 48.5ns ±13% 56.9ns ± 8% +17.30% (p=0.000 n=10+10) Format-12 489ns ±11% 504ns ± 6% ~ (p=0.289 n=10+10) FormatNow-12 436ns ±23% 480ns ±13% +10.25% (p=0.026 n=9+10) MarshalJSON-12 656ns ±14% 587ns ±24% ~ (p=0.063 n=10+10) MarshalText-12 647ns ± 7% 638ns ± 9% ~ (p=0.516 n=10+10) Parse-12 348ns ± 8% 328ns ± 9% -5.66% (p=0.030 n=10+10) ParseDuration-12 136ns ± 9% 140ns ±11% ~ (p=0.425 n=10+10) Hour-12 14.8ns ± 6% 15.6ns ±11% ~ (p=0.085 n=10+10) Second-12 14.0ns ± 6% 14.3ns ±12% ~ (p=0.443 n=10+10) Year-12 32.4ns ±11% 33.4ns ± 6% ~ (p=0.492 n=10+10) Day-12 41.5ns ± 9% 42.3ns ±12% ~ (p=0.239 n=10+10) Fixes #20427 Change-Id: Ia395cbb863215f4499b8e7ef95f4b99f51090911 Reviewed-on: https://go-review.googlesource.com/76990 Reviewed-by: Austin Clements <austin@google.com> Reviewed-on: https://go-review.googlesource.com/88495 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-22[release-branch.go1.9] runtime: use MAP_ANON in sigstack checkAustin Clements
MAP_ANON is the deprecated but more portable spelling of MAP_ANONYMOUS. Use MAP_ANON to un-break the Darwin 10.10 builder. Updates #22930. Change-Id: Iedd6232b94390b3b2a7423c45cdcb25c1a5b3323 Reviewed-on: https://go-review.googlesource.com/88316 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-22[release-branch.go1.9] runtime: restore the Go-allocated signal stack in unminitAustin Clements
Currently, when we minit on a thread that already has an alternate signal stack (e.g., because the M was an extram being used for a cgo callback, or to handle a signal on a C thread, or because the platform's libc always allocates a signal stack like on Android), we simply drop the Go-allocated gsignal stack on the floor. This is a problem for Ms on the extram list because those Ms may later be reused for a different thread that may not have its own alternate signal stack. On tip, this manifests as a crash in sigaltstack because we clear the gsignal stack bounds in unminit and later try to use those cleared bounds when we re-minit that M. On 1.9 and earlier, we didn't clear the bounds, so this manifests as running more than one signal handler on the same signal stack, which could lead to arbitrary memory corruption. This CL fixes this problem by saving the Go-allocated gsignal stack in a new field in the m struct when overwriting it with a system-provided signal stack, and then restoring the original gsignal stack in unminit. This CL is designed to be easy to back-port to 1.9. It won't quite cherry-pick cleanly, but it should be sufficient to simply ignore the change in mexit (which didn't exist in 1.9). Now that we always have a place to stash the original signal stack in the m struct, there are some simplifications we can make to the signal stack handling. We'll do those in a later CL. Fixes #22930. Change-Id: I55c5a6dd9d97532f131146afdef0b216e1433054 Reviewed-on: https://go-review.googlesource.com/88315 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-22[release-branch.go1.9] cmd/compile: fix decomposition of 1-element arraysKeith Randall
The offending rule could move the load to a different block, which is always a bad idea. Fixes #22683 Change-Id: I973c88389b2359f734924d9f45c3fb38e166691d Reviewed-on: https://go-review.googlesource.com/77331 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
2018-01-22[release-branch.go1.9] doc: document Go 1.9.3Andrew Bonventre
Change-Id: Ic7a5d3118754b34ab0652fcef889259a03baebc3 Reviewed-on: https://go-review.googlesource.com/88536 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/88678 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] cmd/compile: fix large load/store offsets on 386Keith Randall
Pointer arithemetic is done mod 2^32 on 386, so we can just drop the high bits of any large constant offsets. The bounds check will make sure wraparounds are never observed. Fixes #21655 Change-Id: I68ae5bbea9f02c73968ea2b21ca017e5ecb89223 Reviewed-on: https://go-review.googlesource.com/82675 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/88324 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2018-01-22[release-branch.go1.9] database/sql: fix transaction leakkirk
When the user context which passed in (*DB)BeginTx is canceled or timeout, the current implementation could cause db transaction leak in some extreme scenario. Goroutine 1: Call (*DB) BeginTx begins a transaction with a userContext. In (*DB)BeginTx, a new goroutine (*Tx)awaitDone which monitor context and rollback tx if needed will be created Goroutine 2(awaitDone): block on tx.ctx.Done() Goroutine 1: Execute some insert or update sqls on the database Goroutine 1: Commit the transaction, (*Tx)Commit set the atomic variable tx.done to 1 Goroutine 3(maybe global timer): Cancel userContext which be passed in Tx Goroutine 1: (*Tx)Commit checks tx.ctx.Done(). Due to the context has been canceled, it will return context.Canceled or context.DeadlineExceeded error immediately and abort the real COMMIT operation of transaction Goroutine 2: Release with tx.ctx.Done() signal, execute (*Tx)rollback. However the atomic variable tx.done is 1 currently, it will return ErrTxDone error immediately and abort the real ROLLBACK operation of transaction Fixes #22976 Change-Id: I3bc23adf25db823861d91e33d3cca6189fb1171d Reviewed-on: https://go-review.googlesource.com/81736 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Reviewed-on: https://go-review.googlesource.com/88323 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-22[release-branch.go1.9] math/big: protect against aliasing in nat.divLargeAlberto Donizetti
In nat.divLarge (having signature (z nat).divLarge(u, uIn, v nat)), we check whether z aliases uIn or v, but aliasing is currently not checked for the u parameter. Unfortunately, z and u aliasing each other can in some cases cause errors in the computation. The q return parameter (which will hold the result's quotient), is unconditionally initialized as q = z.make(m + 1) When cap(z) ≥ m+1, z.make() will reuse z's backing array, causing q and z to share the same backing array. If then z aliases u, setting q during the quotient computation will then corrupt u, which at that point already holds computation state. To fix this, we add an alias(z, u) check at the beginning of the function, taking care of aliasing the same way we already do for uIn and v. Fixes #22830 Change-Id: I3ab81120d5af6db7772a062bb1dfc011de91f7ad Reviewed-on: https://go-review.googlesource.com/78995 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-on: https://go-review.googlesource.com/88322 Run-TryBot: Andrew Bonventre <andybons@golang.org>
2018-01-22[release-branch.go1.9] runtime: fix gctrace STW CPU time and CPU fractionAustin Clements
The CPU time reported in the gctrace for STW phases is simply work.stwprocs times the wall-clock duration of these phases. However, work.stwprocs is set to gcprocs(), which is wrong for multiple reasons: 1. gcprocs is intended to limit the number of Ms used for mark termination based on how well the garbage collector actually scales, but the gctrace wants to report how much CPU time is being stolen from the application. During STW, that's *all* of the CPU, regardless of how many the garbage collector can actually use. 2. gcprocs assumes it's being called during STW, so it limits its result to sched.nmidle+1. However, we're not calling it during STW, so sched.nmidle is typically quite small, even if GOMAXPROCS is quite large. Fix this by setting work.stwprocs to min(ncpu, GOMAXPROCS). This also fixes the overall GC CPU fraction, which is based on the computed CPU times. Fixes #22725. Change-Id: I64b5ce87e28dbec6870aa068ce7aecdd28c058d1 Reviewed-on: https://go-review.googlesource.com/77710 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/88321 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2018-01-22[release-branch.go1.9] cmd/compile: fix runtime.KeepAliveKeith Randall
KeepAlive needs to introduce a use of the spill of the value it is keeping alive. Without that, we don't guarantee that the spill dominates the KeepAlive. This bug was probably introduced with the code to move spills down to the dominator of the restores, instead of always spilling just after the value itself (CL 34822). Fixes #22458. Change-Id: I94955a21960448ffdacc4df775fe1213967b1d4c Reviewed-on: https://go-review.googlesource.com/74210 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/88318 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2018-01-22[release-branch.go1.9] cmd/compile: make sure not to use SP as an index registerKeith Randall
...because that's an illegal addressing mode. I double-checked handling of this code, and 387 is the only place where this check is missing. Fixes #22429 Change-Id: I2284fe729ea86251c6af2f04076ddf7a5e66367c Reviewed-on: https://go-review.googlesource.com/73551 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/88317 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2018-01-20doc: hide content blocked by GFW when served in CNAndrew Bonventre
Change-Id: Ia3d0fa0517d96f0672d3c5ce7e7b7bb8bd0ce093 Reviewed-on: https://go-review.googlesource.com/60070 Reviewed-by: Chris Broadfoot <cbro@golang.org> (cherry picked from commit 98603e7af6056734e0f5bee5f05b3623ca5189de) Reviewed-on: https://go-review.googlesource.com/88735 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-25[release-branch.go1.9] doc: document Go 1.8.5Russ Cox
Change-Id: I9241e6acb65c337b961eed9cdeaf4c041b6326a3 Reviewed-on: https://go-review.googlesource.com/73390 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org> Reviewed-on: https://go-review.googlesource.com/73590
2017-10-25[release-branch.go1.9] go1.9.2go1.9.2Russ Cox
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>
2017-10-25[release-branch.go1.9] runtime: use simple, more robust fastrandnRuss Cox
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>
2017-10-25[release-branch.go1.9] cmd/compile: fix sign-extension merging rulesKeith Randall
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>
2017-10-25[release-branch.go1.9] cmd/compile: avoid generating large offsetsKeith Randall
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>
2017-10-25[release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 ↵Michael Matloob
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>
2017-10-25[release-branch.go1.9] cmd/cgo: support large unsigned macro againHiroshi Ioka
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>
2017-10-25[release-branch.go1.9] cmd/cgo: avoid using common names for sniffingHiroshi Ioka
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>
2017-10-25[release-branch.go1.9] os: skip TestPipeThreads as flaky for 1.9Ian Lance Taylor
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>
2017-10-25[release-branch.go1.9] runtime: avoid monotonic time zero on systems with ↵Russ Cox
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>
2017-10-25[release-branch.go1.9] doc: document Go 1.9.2Russ Cox
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>
2017-10-25[release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMainRuss Cox
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
2017-10-25[release-branch.go1.9] cmd/compile: omit ICE diagnostics after normal error ↵Matthew Dempsky
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>
2017-10-25[release-branch.go1.9] database/sql: prevent race in driver by locking dc in ↵Daniel Theophanes
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>
2017-10-25[release-branch.go1.9] internal/poll: only call ↵Alex Brainman
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>
2017-10-25[release-branch.go1.9] internal/poll: do not call ↵Alex Brainman
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>
2017-10-25[release-branch.go1.9] cmd/go: correct directory used in checkNestedVCS testIan Lance Taylor
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>
2017-10-25[release-branch.go1.9] crypto/x509: reject intermediates with unknown ↵Adam Langley
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>
2017-10-25[release-branch.go1.9] net/smtp: NewClient: set tls field to true when ↵Jeff
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>
2017-10-25[release-branch.go1.9] net: increase expected time to dial a closed port on ↵Author Name
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>
2017-10-25[release-branch.go1.9] cmd/compile: fix merge rules for panic callsKeith Randall
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>
2017-10-25[release-branch.go1.9] net: bump TestDialerDualStackFDLeak timeout on iOSElias Naur
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>
2017-10-25[release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=offAustin Clements
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>
2017-10-25[release-branch.go1.9] cmd/compile: fix regression in PPC64.rules move zeroLynn Boger
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>
2017-10-25[release-branch.go1.9] internal/poll: be explicit when using runtime netpollerAlex Brainman
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>
2017-10-25[release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refillingMatthew Dempsky
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>
2017-10-25[release-branch.go1.9] reflect: fix pointer past-the-end in Call with ↵Cherry Zhang
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>
2017-10-25[release-branch.go1.9] log: fix data race on log.Outputhagen1778
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>
2017-10-25[release-branch.go1.9] cmd/compile: replace GOROOT in //line directivesDavid Crawshaw
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>
2017-10-25[release-branch.go1.9] cmd/compile: limit the number of simultaneously ↵zhongtao.chen
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>
2017-10-25[release-branch.go1.9] expvar: make (*Map).Init clear existing keysBryan C. Mills
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>