aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-07[release-branch.go1.8] go1.8.7go1.8.7release-branch.go1.8Russ Cox
Change-Id: Ida9b4f44033f33657dad213f65b0c85ad89b08a7 Reviewed-on: https://team-review.git.corp.google.com/213169 Reviewed-by: Andrew Bonventre <andybons@google.com>
2018-02-07[release-branch.go1.8] doc: document Go 1.8.7Russ Cox
Change-Id: I7ea97312bdf489c2833b1823dd633eb55f3bcd72 Reviewed-on: https://team-review.git.corp.google.com/213168 Reviewed-by: Andrew Bonventre <andybons@google.com>
2018-02-07[release-branch.go1.8] cmd/go: accept only limited compiler and linker flags ↵Russ Cox
in #cgo directives Both gcc and clang accept an option -fplugin=code.so to load a plugin from the ELF shared object file code.so. Obviously that plugin can then do anything it wants during the build. This is contrary to the goal of "go get" never running untrusted code during the build. (What happens if you choose to run the result of the build is your responsibility.) Disallow this behavior by only allowing a small set of known command-line flags in #cgo CFLAGS directives (and #cgo LDFLAGS, etc). The new restrictions can be adjusted by the environment variables CGO_CFLAGS_ALLOW, CGO_CFLAGS_DISALLOW, and so on. See the documentation. In addition to excluding cgo-defined flags, we also have to make sure that when we pass file names on the command line, they don't look like flags. So we now refuse to build packages containing suspicious file names like -x.go. A wrinkle in all this is that GNU binutils uniformly accept @foo on the command line to mean "if the file foo exists, then substitute its contents for @foo in the command line". So we must also reject @x.go, flags and flag arguments beginning with @, and so on. Fixes #23674, CVE-2018-6574. Change-Id: I59e7c1355155c335a5c5ae0d2cf8fa7aa313940a Reviewed-on: https://team-review.git.corp.google.com/212688 Reviewed-by: Ian Lance Taylor <iant@google.com>
2018-01-23[release-branch.go1.8] go1.8.6go1.8.6Andrew Bonventre
Change-Id: I0aeac01cb7a4329129351d3175f11a0a50b7466c Reviewed-on: https://go-review.googlesource.com/89195 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-23[release-branch.go1.8] doc: document Go 1.8.6Andrew Bonventre
Update golang/go#23515 Change-Id: Id334d8663bf4cbb68f224d1bba4c9ad3855f8aae Reviewed-on: https://go-review.googlesource.com/89155 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-on: https://go-review.googlesource.com/89157 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-23[release-branch.go1.8] 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/89156 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-11-30[release-branch.go1.8] doc: hide blog content for golang.google.cnAndrew Bonventre
/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> Reviewed-on: https://go-review.googlesource.com/81175 Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-30[release-branch.go1.8] doc: hide video and share if being served from CNAndrew Bonventre
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> Reviewed-on: https://go-review.googlesource.com/81095 Reviewed-by: Russ Cox <rsc@golang.org>
2017-10-25[release-branch.go1.8] go1.8.5go1.8.5Russ Cox
Change-Id: I7c6cf169e84329a31d2d9dc4c52d5c29e80482c9 Reviewed-on: https://go-review.googlesource.com/71350 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.8] 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/73392 TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-25[release-branch.go1.8] cmd/internal/obj/x86: use LEAx rather than ADDx when ↵Michael Hudson-Doyle
calling DUFFxxxx via GOT DUFFZERO on 386 is not marked as clobbering flags, but rewriteToUseGot rewrote "ADUFFZERO $offset" to "MOVL runtime.duffxxx@GOT, CX; ADDL $offset, CX; CALL CX" which does. Luckily the fix is easier than figuring out what the problem was: replace the ADDL $offset, CX with LEAL $offset(CX), CX. On amd64 DUFFZERO clobbers flags, on arm, arm64 and ppc64 ADD does not clobber flags and s390x does not use the duff functions, so I'm fairly confident this is the only fix required. I don't know how to write a test though. Change-Id: I69b0958f5f45771d61db5f5ecb4ded94e8960d4d Reviewed-on: https://go-review.googlesource.com/41821 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/70871 Run-TryBot: Russ Cox <rsc@golang.org>
2017-10-25[release-branch.go1.8] 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. [Merge conflicts resolved in verify_test.go] 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/70842 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
2017-10-25[release-branch.go1.8] cmd/link: implement trampolines for ppc64le with ext ↵Lynn Boger
linking When using golang on ppc64le there have been issues when building executables that generate extremely large text sections. This is due to the call instruction and the limitation on the offset field, which is smaller than most platforms. If the size of the call target offset is too big for the offset field in the call instruction, then link errors can occur. The original solution to this problem in golang was to split the text section when it became too large, allowing the external (GNU) linker to insert the necessary stub to handle the long call. That worked fine until the another size limit for the program size was hit, where a plt_branch was created instead of a long branch. In that case the plt_branch code sequence expects r2 to contain the address of the TOC, but when golang creates dynamic executables by default (-buildmode=exe) r2 does not always contain the address of the TOC and as a result when building programs that reach this extremely large size, a runtime SEGV or SIGILL can occur due to branching to a bad address. When using internal linking, trampolines are generated to handle the long calls but the text sections are not split. With this change, text sections will still be split approrpriately with external linking but if the buildmode being used does not maintain r2 as the TOC addresses, then trampolines will be created for those calls. Fixes #20497 Change-Id: If5400b0f86c2c08e106b332be6db0b259b07d93d Reviewed-on: https://go-review.googlesource.com/45130 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/70837 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
2017-10-25[release-branch.go1.8] 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/71490
2017-10-25[release-branch.go1.8] 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/70839 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-25[release-branch.go1.8] 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/70843 Run-TryBot: Russ Cox <rsc@golang.org>
2017-10-25[release-branch.go1.8] 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/71331 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-25[release-branch.go1.8] 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/71330 Run-TryBot: Russ Cox <rsc@golang.org>
2017-10-25[release-branch.go1.8] runtime: fix usleep by correctly setting nanoseconds ↵pvoicu
parameter for pselect6 Fixes #21518 Change-Id: Idd67e3f0410d0ce991b34dcc0c8f15e0d5c529c9 Reviewed-on: https://go-review.googlesource.com/56850 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/70838 Run-TryBot: Russ Cox <rsc@golang.org>
2017-10-25[release-branch.go1.8] doc: delete go1.8.txtBrad Fitzpatrick
Fixes #20591 Change-Id: I2a4674a3430c5a4d3c569f3ea654c6ff4d9bf7ee Reviewed-on: https://go-review.googlesource.com/45015 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/70836 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-25[release-branch.go1.8] cmd/compile: fix subword store/load elision for MIPSCherry Zhang
Apply the fix in CL 44355 to MIPS. ARM64 has these rules but commented out for performance reason. Fix the commented rules, in case they are enabled in the future. Enhance the test so it triggers the failure on ARM and MIPS without the fix. Updates #20530. Change-Id: I82d77448e3939a545fe519d0a29a164f8fa5417c Reviewed-on: https://go-review.googlesource.com/44430 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/70840 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-10-25[release-branch.go1.8] cmd/compile: fix subword store/load elision for ↵David Chase
amd64, x86, arm Replacing byteload-of-bytestore-of-x with x is incorrect when x contains a larger-than-byte value (and so on for 16 and 32-bit load/store pairs). Replace "x" with the appropriate zero/sign extension of x, which if unnecessary will be repaired by other rules. Made logic for arm match x86 and amd64; yields minor extra optimization, plus I am (much) more confident it's correct, despite inability to reproduce bug on arm. Ppc64 lacks this optimization, hence lacks this problem. See related https://golang.org/cl/37154/ Fixes #20530. [Merge conflicts in generated rewrite files resolved by regenerating from scratch, using the programs in ssa/gen.] Change-Id: I6af9cac2ad43bee99cafdcb04725ce7e55a43323 Reviewed-on: https://go-review.googlesource.com/44355 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/70841 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-10-25[release-branch.go1.8] net/http: Fix TestLinuxSendfile without strace ↵Kenny Grant
permissions If go doesn't have permission to run strace, this test hangs while waiting for strace to run. Instead try invoking strace with Run() first - on fail skip and report error, otherwise run the test normally using strace. Also fix link to open mips64 issue in same test. Fixes #9711 Change-Id: Ibbc5fbb143ea6d0f8b6cfdca4b385ef4c8960b3d Reviewed-on: https://go-review.googlesource.com/38633 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/72170 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.8] cmd/compile: zero extend when replacing ↵Michael Munday
load-hit-store on s390x Keith pointed out that these rules should zero extend during the review of CL 36845. In practice the generic rules are responsible for eliminating most load-hit-stores and they do not have this problem. When the s390x rules are triggered any cast following the elided load-hit-store is kept because of the sequence the rules are applied in (i.e. the load is removed before the zero extension gets a chance to be merged into the load). It is therefore not clear that this issue results in any functional bugs. This CL includes a test, but it only tests the generic rules currently. Change-Id: Idbc43c782097a3fb159be293ec3138c5b36858ad Reviewed-on: https://go-review.googlesource.com/37154 Run-TryBot: Michael Munday <munday@ca.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/70831 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Michael Munday <mike.munday@ibm.com>
2017-10-25[release-branch.go1.8] net: skip Windows test using getmac if getmac cmdlet ↵Brad Fitzpatrick
not available This doesn't appear to be present on Windows Server 2012 or 2016: https://build.golang.org/log/6ea21b99c9b8a2be20f9aeaec6c425b84faf1af7 https://build.golang.org/log/2bcf04f1df003577352f4f987a39a59a081094ee Updates golang/go#17513 Updates golang/go#20073 Change-Id: I72820704b4cb16bb1720b7f6a9f2e10028c71334 Reviewed-on: https://go-review.googlesource.com/41395 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-on: https://go-review.googlesource.com/70845 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-04[release-branch.go1.8] go1.8.4go1.8.4Chris Broadfoot
Change-Id: Iae6c1ccd1e42656fa5a57d6367e43085143cd590 Reviewed-on: https://go-review.googlesource.com/68234 Reviewed-by: Russ Cox <rsc@golang.org>
2017-10-04[release-branch.go1.8] net/smtp: fix PlainAuth to refuse to send passwords ↵Russ Cox
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/68023 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-10-04[release-branch.go1.8] cmd/go: reject update of VCS inside VCSRuss Cox
Cherry-pick of CL 68110. Change-Id: Iae84c6404ab5eeb6950faa2364f97a017c67c506 Reviewed-on: https://go-review.googlesource.com/68190 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-10-04[release-branch.go1.8] runtime: deflake TestPeriodicGCRuss Cox
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/68150 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2017-10-04[release-branch.go1.8] os: skip TestNetworkSymbolicLink if Server service is ↵Alex Brainman
not started Fixes #20179 Change-Id: I2b405c9a212a75aae628ad51885616d33c054191 Reviewed-on: https://go-review.googlesource.com/42190 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/68030 Run-TryBot: Chris Broadfoot <cbro@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-31[release-branch.go1.8] doc: update bootstrap archive URLChris Broadfoot
This includes the patch for systems that build PIE executables by defaul Updates #20276. Change-Id: Iecf8dfcf11bc18d397b8075559c37e3610f825cb Reviewed-on: https://go-review.googlesource.com/44470 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/44491 Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-24[release-branch.go1.8] go1.8.3go1.8.3Chris Broadfoot
Change-Id: I048f21f8ca68758fdd7ac875f7db5e4ed1930f3b Reviewed-on: https://go-review.googlesource.com/44037 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-24[release-branch.go1.8] doc: document go1.8.3Chris Broadfoot
Change-Id: I5d55c3b1011dd10552d8e740fb65886306d91b5c Reviewed-on: https://go-review.googlesource.com/44035 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/44036
2017-05-24[release-branch.go1.8] cmd/compile: don't move spills to loop exits where ↵Keith Randall
the spill is dead We shouldn't move a spill to a loop exit where the spill itself is dead. The stack location assigned to the spill might already be reused by another spill at this point. The case we previously handled incorrectly is the one where the value being spilled is still live, but the spill itself is dead. Fixes #20472 Patching directly on the release branch because the spill moving code has already been rewritten for 1.9. (And it doesn't have this bug.) Change-Id: I26c5273dafd98d66ec448750073c2b354ef89ad6 Reviewed-on: https://go-review.googlesource.com/44033 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-05-24[release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLsKeith Randall
This is a redo of CL 41076 backported to the 1.8 release branch. There were major conflicts, so I had to basically rewrite it again from scratch. The way Progs are allocated changed. Liveness analysis and Prog generation got reordered. Liveness analysis changed from running on gc.BasicBlock to ssa.Block. All that makes the logic quite a bit different. Please review carefully. From CL 41076: At VARKILLs, zero a variable if it is ambiguously live. After the VARKILL anything this variable references might be collected. If it were to become live again later, the GC will see references to already-collected objects. We don't know a variable is ambiguously live until very late in compilation (after lowering, register allocation, ...), so it is hard to generate the code in an arch-independent way. We also have to be careful not to clobber any registers. Fortunately, this almost never happens so performance is ~irrelevant. There are only 2 instances where this triggers in the stdlib. Fixes #20029 Change-Id: Ibb757eec58ee07f40df5e561b19d315684dc4bda Reviewed-on: https://go-review.googlesource.com/43998 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-05-23[release-branch.go1.8] runtime: use pselect6 for usleep on linux/386Austin Clements
Commit 4dcba023c6 replaced select with pselect6 on linux/amd64 and linux/arm, but it turns out the Android emulator uses linux/386. This makes the equivalent change there, too. Fixes #20409 more. Change-Id: If542d6ade06309aab8758d5f5f6edec201ca7670 Reviewed-on: https://go-review.googlesource.com/44011 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit ecad34a40ea390ddf5ba2da8f3c3f2c5f15297c8) Reviewed-on: https://go-review.googlesource.com/44002 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and ↵Austin Clements
linux/arm Android O black-lists the select system call because its libc, Bionic, does not use this system call. Replace our use of select with pselect6 (which is allowed) on the platforms that support targeting Android. linux/arm64 already uses pselect6 because there is no select on arm64, so only linux/amd64 and linux/arm need changing. pselect6 has been available since Linux 2.6.16, which is before Go's minimum requirement. Fixes #20409. Change-Id: Ic526b5b259a9e01d2f145a1f4d2e76e8c49ce809 Reviewed-on: https://go-review.googlesource.com/43641 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 4dcba023c62d7f7968abc54fa5d38d2bf11412ba) Reviewed-on: https://go-review.googlesource.com/44001 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] cmd/compile: ignore types when considering tuple ↵Todd Neal
select for CSE Fixes #20097 Change-Id: I3c9626ccc8cd0c46a7081ea8650b2ff07a5d4fcd Reviewed-on: https://go-review.googlesource.com/41505 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/43997 Run-TryBot: Chris Broadfoot <cbro@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23[release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh ↵Brad Fitzpatrick
lock contention slowdown This updates the bundled x/net/http2 repo to git rev 186fd3fc (from the net repo's release-branch.go1.8) for: [release-branch.go1.8] http2: fix lock contention slowdown due to gracefulShutdownCh https://golang.org/cl/43459 Fixes #20302 Change-Id: Ia01a44c6749292de9c16ca330bdebe1e52458b18 Reviewed-on: https://go-review.googlesource.com/43996 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-23[release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant ↵Michael Munday
merging rules On s390x unsigned integer comparisons with immediates require the immediate to be an unsigned 32-bit integer. The rule was checking that the immediate was a signed 32-bit integer. This CL also adds a test for comparisons that could be turned into compare with immediate or equivalent instructions (depending on architecture and optimizations applied). Cherry-pick of CL 40433 and CL 40873. Fixes #19940. Reviewed-on: https://go-review.googlesource.com/40931 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce Reviewed-on: https://go-review.googlesource.com/43994 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23[release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try ↵Brad Fitzpatrick
without -g Backport of CL 38072 Fixes #14705 Reviewed-on: https://go-review.googlesource.com/42500 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Change-Id: Ia6ce2a41434aef2f8745a6a862ea66608b1e25f7 Reviewed-on: https://go-review.googlesource.com/43995 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23[release-branch.go1.8] runtime: don't corrupt arena bounds on low mmapAustin Clements
Cherry-pick of CL 43870. If mheap.sysAlloc doesn't have room in the heap arena for an allocation, it will attempt to map more address space with sysReserve. sysReserve is given a hint, but can return any unused address range. Currently, mheap.sysAlloc incorrectly assumes the returned region will never fall between arena_start and arena_used. If it does, mheap.sysAlloc will blindly accept the new region as the new arena_used and arena_end, causing these to decrease and make it so any Go heap above the new arena_used is no longer considered part of the Go heap. This assumption *used to be* safe because we had all memory between arena_start and arena_used mapped, but when we switched to an arena_start of 0 on 32-bit, it became no longer safe. Most likely, we've only recently seen this bug occur because we usually start arena_used just above the binary, which is low in the address space. Hence, the kernel is very unlikely to give us a region before arena_used. Since mheap.sysAlloc is a linear allocator, there's not much we can do to handle this well. Hence, we fix this problem by simply rejecting the new region if it isn't after arena_end. In this case, we'll take the fall-back path and mmap a small region at any address just for the requested memory. Fixes #20259. Change-Id: Ib72e8cd621545002d595c7cade1e817cfe3e5b1e Reviewed-on: https://go-review.googlesource.com/43954 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] cmd/compile: fix store chain in schedule passKeith Randall
Cherry-pick of CL 43294. Tuple ops are weird. They are essentially a pair of ops, one which consumes a mem and one which generates a mem (the Select1). The schedule pass didn't handle these quite right. Fix the scheduler to include both parts of the paired op in the store chain. That makes sure that loads are correctly ordered with respect to the first of the pair. Add a check for the ssacheck builder, that there is only one live store at a time. I thought we already had such a check, but apparently not... Fixes #20335 Change-Id: I59eb3446a329100af38d22820b1ca2190ca46a78 Reviewed-on: https://go-review.googlesource.com/43411 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2017-05-23[release-branch.go1.8] runtime: doubly fix "double wakeup" panicAustin Clements
Cherry-pick of CL 43311. runtime.gchelper depends on the non-atomic load of work.ndone happening strictly before the atomic add of work.nwait. Until very recently (commit 978af9c2db, fixing #20334), the compiler reordered these operations. This created a race since work.ndone can change as soon as work.nwait is equal to work.ndone. If that happened, more than one gchelper could attempt to wake up the work.alldone note, causing a "double wakeup" panic. This was fixed in the compiler, but to make this code less subtle, make the load of work.ndone atomic. This clearly forces the order of these operations, ensuring the race doesn't happen. Fixes #19305 (though really 978af9c2db fixed it). Change-Id: Ieb1a84e1e5044c33ac612c8a5ab6297e7db4c57d Reviewed-on: https://go-review.googlesource.com/43412 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2017-05-23[release-branch.go1.8] database/sql: ensure releaseConn is defined before a ↵Daniel Theophanes
possible close Applies https://golang.org/cl/42139 to the go1.8 release branch. Also correct two minor issues detected with go vet. Fixes #20217 Change-Id: I2c41af9497493598fbcfc140439b4e25b9bb7e72 Reviewed-on: https://go-review.googlesource.com/42532 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] runtime: print debug info on "base out of range"Austin Clements
Cherry-pick of CL 43310. This adds debugging information when we panic with "heapBitsForSpan: base out of range". Updates #20259. Change-Id: I0dc1a106aa9e9531051c7d08867ace5ef230eb3f Reviewed-on: https://go-review.googlesource.com/43410 Run-TryBot: Austin Clements <austin@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23[release-branch.go1.8] doc: remove mentions of yacc toolBrad Fitzpatrick
It was removed in CL 27325. Fixes #20431 Change-Id: I6842851444186e19029d040f61fdf4f87a3103a6 Reviewed-on: https://go-review.googlesource.com/43771 Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit deebd8fe273df2de2d590ee41ae1155c521219e9) Reviewed-on: https://go-review.googlesource.com/43772 Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] go1.8.2go1.8.2Chris Broadfoot
Change-Id: Ib04878cbfbb0c09fbd0cc614df314c835e9a6eb0 Reviewed-on: https://go-review.googlesource.com/43991 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-23[release-branch.go1.8] doc: document go1.8.2 and go1.7.6Chris Broadfoot
Change-Id: I2ed2e8c4890a65288cf3066ebe3c1d9a16fb4c05 Reviewed-on: https://go-review.googlesource.com/43990 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/43993 Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-05-23[release-branch.go1.8] crypto/elliptic: fix carry bug in x86-64 P-256 ↵Adam Langley
implementation. Patch from Vlad Krasnov and confirmed to be under CLA. Fixes #20040. Change-Id: Ieb8436c4dcb6669a1620f1e0d257efd047b1b87c Reviewed-on: https://go-review.googlesource.com/41070 Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 9294fa2749ffee7edbbb817a0ef9fe633136fa9c) Reviewed-on: https://go-review.googlesource.com/43770 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>