aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-10[release-branch.go1.16-security] go1.16.1go1.16.1Alexander Rakoczy
Change-Id: I4999d72caf9462554a2a6f1d761244cafec34718 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1014541 Reviewed-by: Katie Hockman <katiehockman@google.com>
2021-03-09[release-branch.go1.16-security] archive/zip: fix panic in Reader.OpenRoland Shoemaker
When operating on a Zip file that contains a file prefixed with "../", Open(...) would cause a panic in toValidName when attempting to strip the prefixed path components. Fixes CVE-2021-27919 Change-Id: Ic755d8126cb0897e2cbbdacf572439c38dde7b35 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1004761 Reviewed-by: Filippo Valsorda <valsorda@google.com> Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Katie Hockman <katiehockman@google.com> (cherry picked from commit ce22003b26eaf8e4a690757f699aae7062d41472) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1013753 Reviewed-by: Roland Shoemaker <bracewell@google.com>
2021-03-09[release-branch.go1.16-security] encoding/xml: prevent infinite loop while ↵Katie Hockman
decoding This change properly handles a TokenReader which returns an EOF in the middle of an open XML element. Thanks to Sam Whited for reporting this. Fixes CVE-2021-27918 Change-Id: Id02a3f3def4a1b415fa2d9a8e3b373eb6cb0f433 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1004594 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Roland Shoemaker <bracewell@google.com> Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit e7ce1f6746223ec7b4caa3b1ece25d9be3864710) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1014235
2021-02-16[release-branch.go1.16] go1.16go1.16Alexander Rakoczy
Change-Id: I4c1350e0cb74ebfde5832973979e02997476d16c Reviewed-on: https://go-review.googlesource.com/c/go/+/292609 TryBot-Result: Go Bot <gobot@golang.org> Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-02-16[release-branch.go1.16] all: merge master into release-branch.go1.16Alexander Rakoczy
1004a7cb31 runtime/metrics: update documentation to current interface 6530f2617f doc/go1.16: remove draft notice 353e111455 doc/go1.16: fix mismatched id attribute f0d23c9dbb internal/poll: netpollcheckerr before sendfile 0cb3415154 doc: remove all docs not tied to distribution 626ef08127 doc: remove install.html and install-source.html 30641e36aa internal/poll: if copy_file_range returns 0, assume it failed 33d72fd412 doc/faq: update generics entry to reflect accepted proposal 852ce7c212 cmd/go: provide a more helpful suggestion for "go vet -?" 66c27093d0 cmd/link: fix typo in link_test.go ff0e93ea31 doc/go1.16: note that package path elements beginning with '.' are disallowed 249da7ec02 CONTRIBUTORS: update for the Go 1.16 release 864d4f1c6b cmd/go: multiple small 'go help' fixes 26ceae85a8 spec: More precise wording in section on function calls. 930c2c9a68 cmd/go: reject embedded files that can't be packed into modules e5b08e6d5c io/fs: allow backslash in ValidPath, reject in os.DirFS.Open ed8079096f cmd/compile: mark concrete call of reflect.(*rtype).Method as REFLECTMETHOD e9c9683597 cmd/go: suppress errors from 'go get -d' for packages that only conditionally exist e0ac989cf3 archive/tar: detect out of bounds accesses in PAX records resulting from padded lengths c9d6f45fec runtime/metrics: fix a couple of documentation typpos cea4e21b52 io/fs: backslash is always a glob meta character dc725bfb3c doc/go1.16: mention new vet check for asn1.Unmarshal 1901853098 runtime/metrics: fix panic in readingAllMetric example ed3e4afa12 syscall/plan9: remove spooky fd action at a distance 724d0720b3 doc/go1.16: add missed heading tag in vet section b54cd94d47 embed, io/fs: clarify that leading and trailing slashes are disallowed 4516afebed testing/fstest: avoid symlink-induced failures in tester 8869086d8f runtime: fix typo in histogram.go e491c6eea9 math/big: fix comment in divRecursiveStep fca94ab3ab spec: improve the example in Type assertions section 98f8454a73 cmd/link: don't decode type symbol in shared library in deadcode 1426a571b7 cmd/link: fix off-by-1 error in findShlibSection 32e789f4fb test: fix incorrectly laid out instructions in issue11656.go 0b6cfea634 doc/go1.16: document that on OpenBSD syscalls are now made through libc 26e29aa15a cmd/link: disable TestPIESize if CGO isn't enabled 6ac91e460c doc/go1.16: minor markup fixes 44361140c0 embed: update docs for proposal tweaks 68058edc39 runtime: document pointer write atomicity for memclrNoHeapPointers c8bd8010ff syscall: generate readlen/writelen for openbsd libc 41bb49b878 cmd/go: revert TestScript/build_trimpath to use ioutil.ReadFile 725a642c2d runtime: correct syscall10/syscall10X on openbsd/amd64 4b068cafb5 doc/go1.16: document go/build/constraint package 376518d77f runtime,syscall: convert syscall on openbsd/arm64 to libc Change-Id: Icfe3d849f459eda48d7d786d0cd7b082c9c2c325
2021-02-16runtime/metrics: update documentation to current interfaceBranden J Brown
The package documentation referenced sample metadata that was removed in CL 282632. Update this documentation to be less specific about what metadata is available. Additionally, the documentation on the Sample type referred to Descriptions instead of All as the source of metrics names. Fixes #44280. Change-Id: I24fc63a744bf498cb4cd5bda56c1599f6dd75929 Reviewed-on: https://go-review.googlesource.com/c/go/+/292309 Reviewed-by: Michael Knyszek <mknyszek@google.com> Trust: Michael Knyszek <mknyszek@google.com> Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-16doc/go1.16: remove draft noticeDmitri Shuralyov
Fixes #40700. Change-Id: I99ed479d1bb3cdf469c0209720c728276182a7a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/291809 Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-16doc/go1.16: fix mismatched id attributeKimMachineGun
For #40700. Change-Id: I186a21899404bfb79c08bfa8623caf9da74b6b0d GitHub-Last-Rev: 25d240db3c0e2a923720bb9667ef0599ec06819e GitHub-Pull-Request: golang/go#44145 Reviewed-on: https://go-review.googlesource.com/c/go/+/290329 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16internal/poll: netpollcheckerr before sendfileWei Fu
In net/http package, the ServeContent/ServeFile doesn't check the I/O timeout error from chunkWriter or *net.TCPConn, which means that both HTTP status and headers might be missing when WriteTimeout happens. If the poll.SendFile() doesn't check the *poll.FD state before sending data, the client will only receive the response body with status and report "malformed http response/status code". This patch is to enable netpollcheckerr before sendfile, which should align with normal *poll.FD.Write() and Splice(). Fixes #43822 Change-Id: I32517e3f261bab883a58b577b813ef189214b954 Reviewed-on: https://go-review.googlesource.com/c/go/+/285914 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
2021-02-16doc: remove all docs not tied to distributionRuss Cox
They have moved to x/website in CL 291693. The docs that are left are the ones that are edited at the same time as development in this repository and are tied to the specific version of Go being developed. Those are: - the language spec - the memory model - the assembler manual - the current release's release notes Change-Id: I437c4d33ada1b1716b1919c3c939c2cacf407e83 Reviewed-on: https://go-review.googlesource.com/c/go/+/291711 Trust: Russ Cox <rsc@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16doc: remove install.html and install-source.htmlRuss Cox
These live in x/website/content/doc now. The copies here just attract edits that have no actual effect. For #40496. For #41861. Change-Id: I2fdd7375e373949eb9a88f4cdca440b6a5d45eea Reviewed-on: https://go-review.googlesource.com/c/go/+/291709 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16internal/poll: if copy_file_range returns 0, assume it failedIan Lance Taylor
On current Linux kernels copy_file_range does not correctly handle files in certain special file systems, such as /proc. For those file systems it fails to copy any data and returns zero. This breaks Go's io.Copy for those files. Fix the problem by assuming that if copy_file_range returns 0 the first time it is called on a file, that that file is not supported. In that case fall back to just using read. This will force an extra system call when using io.Copy to copy a zero-sized normal file, but at least it will work correctly. For #36817 Fixes #44272 Change-Id: I02e81872cb70fda0ce5485e2ea712f219132e614 Reviewed-on: https://go-review.googlesource.com/c/go/+/291989 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-02-15doc/faq: update generics entry to reflect accepted proposalIan Lance Taylor
For #43651 Change-Id: Idb511f4c759d9a77de289938c19c2c1d4a542a17 Reviewed-on: https://go-review.googlesource.com/c/go/+/291990 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2021-02-15cmd/go: provide a more helpful suggestion for "go vet -?"Rob Pike
For the command go vet -? the output was, usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages] Run 'go help vet' for details. Run 'go tool vet -help' for the vet tool's flags. but "go help vet" is perfunctory at best. (That's another issue I'm working on—see https://go-review.googlesource.com/c/tools/+/291909— but vendoring is required to sort that out.) Add another line and rewrite a bit to make it actually helpful: usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages] Run 'go help vet' for details. Run 'go tool vet help' for a full list of flags and analyzers. Run 'go tool vet -help' for an overview. Change-Id: I9d8580f0573321a57d55875ac3185988ce3eaf64 Reviewed-on: https://go-review.googlesource.com/c/go/+/291929 Trust: Rob Pike <r@golang.org> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-02-13cmd/link: fix typo in link_test.goIkko Ashimine
specfic -> specific Change-Id: Icad0f70c77c866a1031a2929b90fef61fe92aaee GitHub-Last-Rev: f66b56491c0125f58c47f7f39410e0aeef2539be GitHub-Pull-Request: golang/go#44246 Reviewed-on: https://go-review.googlesource.com/c/go/+/291829 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
2021-02-12doc/go1.16: note that package path elements beginning with '.' are disallowedBryan C. Mills
For #43985 Change-Id: I1a16f66800c5c648703f0a0d2ad75024525a710f Reviewed-on: https://go-review.googlesource.com/c/go/+/291389 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-02-11CONTRIBUTORS: update for the Go 1.16 releaseCarlos Amedee
This update was created using the updatecontrib command: go get golang.org/x/build/cmd/updatecontrib cd gotip updatecontrib With manual changes based on publicly available information to canonicalize letter case and formatting for a few names. For #12042. Change-Id: I030b77e8ebcc7fe02106f0f264acdfb0b56e20d9 Reviewed-on: https://go-review.googlesource.com/c/go/+/291189 Trust: Carlos Amedee <carlos@golang.org> Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-11cmd/go: multiple small 'go help' fixesJay Conrod
* Link to privacy policies for proxy.golang.org and sum.golang.org in 'go help modules'. It's important that both policies are linked from the go command's documentation. * Fix wording and typo in 'go help vcs' following comments in CL 290992, which adds reference documentation for GOVCS. * Fix whitespace on GOVCS in 'go help environment'. For #41730 Change-Id: I86abceacd4962b748361244026f219157c9285e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/291230 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-11spec: More precise wording in section on function calls.DQNEO
A caller is not always in a function. For example, a call can appear in top level declarations. e.g. var x = f() Change-Id: I29c4c3b7663249434fb2b8a6d0003267c77268cf Reviewed-on: https://go-review.googlesource.com/c/go/+/290849 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Griesemer <gri@golang.org>
2021-02-11cmd/go: reject embedded files that can't be packed into modulesRuss Cox
If the file won't be packed into a module, don't put those files into embeds. Otherwise people will be surprised when things work locally but not when imported by another module. Observed on CL 290709 Change-Id: Ia0ef7d0e0f5e42473c2b774e57c843e68a365bc7 Reviewed-on: https://go-review.googlesource.com/c/go/+/290809 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-02-11io/fs: allow backslash in ValidPath, reject in os.DirFS.OpenRuss Cox
Rejecting backslash introduces problems with presenting underlying OS file systems that contain names with backslash. Rejecting backslash also does not Windows-proof the syntax, because colon can also be a path separator. And we are not going to reject colon from all names. So don't reject backslash either. There is a similar problem on Windows with names containing slashes, but those are more difficult (though not impossible) to create. Also document and enforce that paths must be UTF-8. Fixes #44166. Change-Id: Iac7a9a268025c1fd31010dbaf3f51e1660c7ae2a Reviewed-on: https://go-review.googlesource.com/c/go/+/290709 TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2021-02-10cmd/compile: mark concrete call of reflect.(*rtype).Method as REFLECTMETHODCherry Zhang
For functions that call reflect.Type.Method (or MethodByName), we mark it as REFLECTMETHOD, which tells the linker that methods can be retrieved via reflection and the linker keeps all exported methods live. Currently, this marking expects exactly the interface call reflect.Type.Method (or MethodByName). But now the compiler can devirtualize that call to a concrete call reflect.(*rtype).Method (or MethodByName), which is not handled and causing the linker to discard methods too aggressively. Handle the latter in this CL. Fixes #44207. Change-Id: Ia4060472dbff6ab6a83d2ca8e60a3e3f180ee832 Reviewed-on: https://go-review.googlesource.com/c/go/+/290950 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-02-09cmd/go: suppress errors from 'go get -d' for packages that only ↵Bryan C. Mills
conditionally exist Fixes #44106 Fixes #29268 Change-Id: Id113f2ced274d43fbf66cb804581448218996f81 Reviewed-on: https://go-review.googlesource.com/c/go/+/289769 TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com>
2021-02-09archive/tar: detect out of bounds accesses in PAX records resulting from ↵Emmanuel T Odeke
padded lengths Handles the case in which padding of a PAX record's length field violates invariants about the formatting of record, whereby it no longer matches the prescribed format: "%d %s=%s\n", <length>, <keyword>, <value> as per: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_03 0-padding, and paddings of other sorts weren't handled and we assumed that only non-padded decimal lengths would be passed in. Added test cases to ensure that the parsing still proceeds as expected. The prior crashing repro: 0000000000000000000000000000000030 mtime=1432668921.098285006\n30 ctime=2147483649.15163319 exposed the fallacy in the code, that assumed that the length would ALWAYS be a non-padded decimal length string. This bug has existed since Go1.1 as per CL 6700047. Thanks to Josh Bleecher Snyder for fuzzing this package, and thanks to Tom Thorogood for advocacy, raising parity with GNU Tar, but for providing more test cases. Fixes #40196 Change-Id: I32e0af4887bc9221481bd9e8a5120a79f177f08c Reviewed-on: https://go-review.googlesource.com/c/go/+/289629 Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2021-02-09runtime/metrics: fix a couple of documentation typposIan Lance Taylor
Fixes #44150 Change-Id: Ibe5bfba01491dd8c2f0696fab40a1673230d76e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/290349 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-02-09io/fs: backslash is always a glob meta characterIan Lance Taylor
Fixes #44171 Change-Id: I2d3437a2f5b9fa0358e4664e1a8eacebed975eed Reviewed-on: https://go-review.googlesource.com/c/go/+/290512 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-02-08doc/go1.16: mention new vet check for asn1.UnmarshalKimMachineGun
This vet check was added in CL 243397. For #40700. Change-Id: Ibff6df9395d37bb2b84a791443578009f23af4fb GitHub-Last-Rev: e47c38f6309f31a6de48d4ffc82078d7ad45b171 GitHub-Pull-Request: golang/go#44147 Reviewed-on: https://go-review.googlesource.com/c/go/+/290330 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-08runtime/metrics: fix panic in readingAllMetric exampleChangkun Ou
medianBucket can return if the total is greater than thresh. However, if a histogram has no counts, total and thresh will both be zero and cause panic. Adding an equal sign to prevent the potential panic. Fixes #44148 Change-Id: Ifb8a781990f490d142ae7c035b4e01d6a07ae04d Reviewed-on: https://go-review.googlesource.com/c/go/+/290171 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-08syscall/plan9: remove spooky fd action at a distanceOri Bernstein
Change Plan 9 fork/exec to use the O_CLOEXEC file descriptor, instead of relying on spooky at a distance. Historically, Plan 9 has set the O_CLOEXEC flag on the underlying channels in the kernel, rather than the file descriptors -- if two fds pointed at a single channel, as with dup, changing the flags on one of them would be observable on the other. The per-Chan semantics are ok, if unexpected, when a chan is only handled within a single process, but this isn't always the case. Forked processes share Chans, but even more of a problem is the interaction between /srv and OCEXEC, which can lead to unexectedly closed file descriptors in completely unrelated proceses. For example: func exists() bool { // If some other thread execs here, // we don't want to leak the fd, so // open it O_CLOEXEC fd := Open("/srv/foo", O_CLOEXEC) if fd != -1 { Close(fd) return true } return false } would close the connection to any file descriptor (maybe even for the root fs) in ALL other processes that have it open if an exec were to happen(!), which is quite undesriable. As a result, 9front will be changing this behavior for the next release. Go is the only code observed so far that relies on this behavior on purpose, and It's easy to make the code work with both semantics: simply using the file descriptor that was opened with O_CEXEC instead of throwing it away. So we do that here. Fixes #43524 Change-Id: I4887f5c934a5e63e5e6c1bb59878a325abc928d3 GitHub-Last-Rev: 96bb21bd1e8f64dc7e082a56928748a7d54c9272 GitHub-Pull-Request: golang/go#43533 Reviewed-on: https://go-review.googlesource.com/c/go/+/281833 Reviewed-by: David du Colombier <0intro@gmail.com> Reviewed-by: Richard Miller <millerresearch@gmail.com> Reviewed-by: Jacob Moody <j4kem00dy@gmail.com> Run-TryBot: David du Colombier <0intro@gmail.com> Trust: Ian Lance Taylor <iant@golang.org>
2021-02-05doc/go1.16: add missed heading tag in vet sectionKimMachineGun
Add missed heading tag in CL 276373. For #40700 Change-Id: Ida9e8861589bbc296a5a1cecbf9fe33fa09ed0ca GitHub-Last-Rev: d218f8d4b70b20c30422863db7bed3683e3218e6 GitHub-Pull-Request: golang/go#44111 Reviewed-on: https://go-review.googlesource.com/c/go/+/289869 Reviewed-by: Tim King <taking@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Tim King <taking@google.com> Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-05embed, io/fs: clarify that leading and trailing slashes are disallowedJay Conrod
Fixes #44012 Change-Id: I5782cea301a65ae12ba870ff1e6b2e0a2651dc09 Reviewed-on: https://go-review.googlesource.com/c/go/+/290071 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jay Conrod <jayconrod@google.com>
2021-02-05testing/fstest: avoid symlink-induced failures in testerRuss Cox
Do not require directory entry and Stat result to match for symlinks, because they won't (Stat dereferences the symlink). Fixes #44113. Change-Id: Ifc6dbce5719906e2f42254a7172f1ef787464a9e Reviewed-on: https://go-review.googlesource.com/c/go/+/290009 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-02-04runtime: fix typo in histogram.goIkko Ashimine
indicies -> indices Change-Id: Ia50ae5918fc7a53c23590a94a18087a99bfd9bb7 GitHub-Last-Rev: 98eb724275fd61d5f5ce5dad6b1010c10f76906d GitHub-Pull-Request: golang/go#44095 Reviewed-on: https://go-review.googlesource.com/c/go/+/289529 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Keith Randall <khr@golang.org>
2021-02-03math/big: fix comment in divRecursiveStepKatie Hockman
There appears to be a typo in the description of the recursive division algorithm. Two things seem suspicious with the original comment: 1. It is talking about choosing s, but s doesn't appear anywhere in the equation. 2. The math in the equation is incorrect. Where B = len(v)/2 s = B - 1 Proof that it is incorrect: len(v) - B >= B + 1 len(v) - len(v)/2 >= len(v)/2 + 1 This doesn't hold if len(v) is even, e.g. 10: 10 - 10/2 >= 10/2 + 1 10 - 5 >= 5 + 1 5 >= 6 // this is false The new equation will be the following, which will be mathematically correct: len(v) - s >= B + 1 len(v) - (len(v)/2 - 1) >= len(v)/2 + 1 len(v) - len(v)/2 + 1 >= len(v)/2 + 1 len(v) - len(v)/2 >= len(v)/2 This holds if len(v) is even or odd. e.g. 10 10 - 10/2 >= 10/2 10 - 5 >= 5 5 >= 5 e.g. 11 11 - 11/2 >= 11/2 11 - 5 >= 5 6 >= 5 Change-Id: If77ce09286cf7038637b5dfd0fb7d4f828023f56 Reviewed-on: https://go-review.googlesource.com/c/go/+/287372 Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Trust: Katie Hockman <katie@golang.org>
2021-02-02spec: improve the example in Type assertions sectiontask4233
The example, var v, ok T1 = x.(T), can be interpreted as type T1 interface{} or type T = bool; type T1 = T. Separating the example would help understanding for readers. Change-Id: I179f4564e67f4d503815d29307df2cebb50c82f9 GitHub-Last-Rev: b34fffb6bb07cb2883bc313ef3bc9980b3dd4abe GitHub-Pull-Request: golang/go#44040 Reviewed-on: https://go-review.googlesource.com/c/go/+/288472 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Robert Griesemer <gri@golang.org>
2021-02-02cmd/link: don't decode type symbol in shared library in deadcodeCherry Zhang
In the linker's deadcode pass we decode type symbols for interface satisfaction analysis. When linking against Go shared libraries, the type symbol may come from a shared library, so it doesn't have data in the current module being linked, so we cannot decode it. We already have code to skip DYNIMPORT symbols. However, this doesn't actually work, because at that point the type symbols' names haven't been mangled, whereas they may be mangled in the shared library. So the symbol definition (in shared library) and reference (in current module) haven't been connected. Skip decoding type symbols of type Sxxx (along with DYNIMPORT) when linkShared. Note: we cannot skip all type symbols, as we still need to mark unexported methods defined in the current module. Fixes #44031. Change-Id: I833d19a060c94edbd6fc448172358f9a7d760657 Reviewed-on: https://go-review.googlesource.com/c/go/+/288496 Trust: Cherry Zhang <cherryyz@google.com> Trust: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-02cmd/link: fix off-by-1 error in findShlibSectionCherry Zhang
We want to find a section that contains addr. sect.Addr+sect.Size is the exclusive upper bound. Change-Id: If2cd6bdd6e03174680e066189b0f4bf9e2ba6630 Reviewed-on: https://go-review.googlesource.com/c/go/+/288592 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-01test: fix incorrectly laid out instructions in issue11656.goTom Thorogood
CL 279423 introduced a regression in this test as it incorrectly laid out various instructions. In the case of arm, the second instruction was overwriting the first. In the case of 386, amd64 and s390x, the instructions were being appended to the end of the slice after 64 zero bytes. This was causing test failures on "linux/s390x on z13". Fixes #44028 Change-Id: Id136212dabdae27db7e91904b0df6a3a9d2f4af4 Reviewed-on: https://go-review.googlesource.com/c/go/+/288278 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-02-01doc/go1.16: document that on OpenBSD syscalls are now made through libcCherry Zhang
Updates #36435, #40700. Change-Id: I1e2ded111ad58066cc9f2c9d00e719497b0f34d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/287634 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
2021-02-01cmd/link: disable TestPIESize if CGO isn't enabledNehal J Wani
With CGO disabled, the test throws the following error: elf_test.go:291: # command-line-arguments loadinternal: cannot find runtime/cgo Change-Id: Iaeb183562ab637c714240b49e73078bdb791b35b GitHub-Last-Rev: f8fe9afad5611411966413d17cb5874f7b0018a0 GitHub-Pull-Request: golang/go#43911 Reviewed-on: https://go-review.googlesource.com/c/go/+/286632 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: Matthew Dempsky <mdempsky@google.com>
2021-02-01doc/go1.16: minor markup fixesToshihiro Shiino
Add missing <code> tags. Remove unnecessary <br> tag. For #40700 Change-Id: I03d3ce1c89a9ae3d3195dcd2bb8b1a61f011e1ed Reviewed-on: https://go-review.googlesource.com/c/go/+/288275 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2021-01-29embed: update docs for proposal tweaksIan Lance Taylor
//go:embed variables can be type aliases. //go:embed variables can't be local to a function. For #43216 For #43602 Fixes #43978 Change-Id: Ib1d104dfa32b97c91d8bfc5ed5d461ca14da188f Reviewed-on: https://go-review.googlesource.com/c/go/+/288072 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-01-29runtime: document pointer write atomicity for memclrNoHeapPointersCherry Zhang
memclrNoHeapPointers is the underlying implementation of typedmemclr and memclrHasPointers, so it still needs to write pointer-aligned words atomically. Document this requirement. Updates #41428. Change-Id: Ice00dee5de7a96a50e51ff019fcef069e8a8406a Reviewed-on: https://go-review.googlesource.com/c/go/+/287692 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2021-01-28syscall: generate readlen/writelen for openbsd libcJoel Sing
Rather than hand rolling readlen and writelen, move it to being generated via mksyscall.pl, as is done for most other functions. Updates #36435 Change-Id: I649aed7b182b41c8639686feae25ce19dab812c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/287532 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-28cmd/go: revert TestScript/build_trimpath to use ioutil.ReadFileBryan C. Mills
This call was changed to os.ReadFile in CL 266365, but the test also builds that source file using gccgo if present, and released versions of gccgo do not yet support ioutil.ReadFile. Manually tested with gccgo gccgo 10.2.1 (see #35786). Fixes #43974. Updates #42026. Change-Id: Ic4ca0848d3ca324e2ab10fd14ad867f21e0898e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/287613 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-28runtime: correct syscall10/syscall10X on openbsd/amd64Joel Sing
The syscall10/syscall10X implementation uses an incorrect stack offset for arguments a7 to a10. Correct this so that the syscall arguments work as intended. Updates #36435 Fixes #43927 Change-Id: Ia7ae6cc8c89f50acfd951c0f271f3b3309934499 Reviewed-on: https://go-review.googlesource.com/c/go/+/287252 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-01-28doc/go1.16: document go/build/constraint packageIan Lance Taylor
For #40700 For #41184 Fixes #43957 Change-Id: Ia346f4cf160431b721efeba7dc5f1fb8814efd95 Reviewed-on: https://go-review.googlesource.com/c/go/+/287472 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-28runtime,syscall: convert syscall on openbsd/arm64 to libcJoel Sing
Convert the syscall package on openbsd/arm64 to use libc rather than performing direct system calls. Updates #36435 Change-Id: I7e1da8537cea9ed9bf2676f181e56ae99383333f Reviewed-on: https://go-review.googlesource.com/c/go/+/286815 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-27[release-branch.go1.16] go1.16rc1go1.16rc1Alexander Rakoczy
Change-Id: I978f6df491a19a9c45ab906dbc5194b8665bf4a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/287352 Run-TryBot: Alexander Rakoczy <alex@golang.org> Trust: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-27api/go1.16: add go/build/constraint APIsAlexander Rakoczy
These APIs were added in CL 240604 as part of an approved proposal. It was submitted after the initial api/go1.16.txt creation. For #41184 For #43407 Change-Id: Ifb54df2b61c554c32bd9d17afbb74f4e42e0b228 Reviewed-on: https://go-review.googlesource.com/c/go/+/287412 Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>