aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-06[release-branch.go1.19] go1.19rc1go1.19rc1Gopher Robot
Change-Id: I85a6dcfda4fd6b871959e0ba8498a5b85c3c557e Reviewed-on: https://go-review.googlesource.com/c/go/+/416314 Run-TryBot: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-07-06[release-branch.go1.19] update codereview.cfg for release-branch.go1.19Heschi Kreinick
Following go.dev/cl/334376. Change-Id: I7e5e1b89243d1980274d27be5362acf8034998ef Reviewed-on: https://go-review.googlesource.com/c/go/+/416176 Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-06cmd/compile: rework induction variable detectorKeith Randall
Induction variable detection is still not quite right. I've added another failing test. Redo the overflow/underflow detector so it is more obviously correct. Update #53600 Fixes #53653 Fixes #53663 Change-Id: Id95228e282fdbf6bd80b26e1c41d62e935ba08ff Reviewed-on: https://go-review.googlesource.com/c/go/+/415874 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-07-06os/exec: clarify that Wait must be calledIan Lance Taylor
Fixes #52580 Change-Id: Ib2dd8a793b9c6fcb083abb3f7c346f6279adefc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/414056 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-06cmd/internal/notsha256: add purego tag as neededIan Lance Taylor
This permits building the package with gccgo, when using gccgo as a bootstrap compiler. Fixes #53662 Change-Id: Ic7ae9323ec5954e9306a32e1160e9aa1ed3aa202 Reviewed-on: https://go-review.googlesource.com/c/go/+/415935 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-07-06cmd/dist: use purego tag when building the bootstrap binariesIan Lance Taylor
This is in addition to the current math_big_pure_go tag. Using purego ensures that we can build the cmd binaries with gccgo. For #53662 Change-Id: Ib82f8bf10659b5f94935f2b427ae8b2da875cd3b Reviewed-on: https://go-review.googlesource.com/c/go/+/415934 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-07-06misc/cgo/test: make TestSetgidStress cheaperCherry Mui
TestSetgidStress spawns 1000 threads, which can be expensive on some platforms or slow builders. Run with 50 threads in short mode instead. This makes the failure less reproducible even with buggy code. But one can manually stress test it (e.g. when a flaky failure appear on the builder). Fixes #53641. Change-Id: I33b5ea5ecaa8c7a56f59c16f9171657ee295db47 Reviewed-on: https://go-review.googlesource.com/c/go/+/415677 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-07-06test: recognize new gofrontend error messageIan Lance Taylor
The new gofrontend message matches other gofrontend error messages, so adjust the test to accept it. For #27938 For #51237 Change-Id: I29b536f83a0cf22b1dbdae9abc2f5f6cf21d522d Reviewed-on: https://go-review.googlesource.com/c/go/+/416014 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-07-05cmd/compile: drop "buildcfg" from no instrument packagesMichael Pratt
Package buildcfg was added to this list by CL 403851, but package buildcfg does not exist. This was probably intended to refer to internal/buildcfg, but internal/buildcfg is only used by the compiler so it is not clear why it couldn't be instrumented. For #44853. Change-Id: Iad2517358be79c3eabf240376156bcff0c4bcefc Reviewed-on: https://go-review.googlesource.com/c/go/+/414516 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com>
2022-07-05cmd/go: make module@nonexistentversion failures reusableRuss Cox
CL 411398 added the -reuse flag for reusing cached JSON output when the remote Git repository has not changed. One case that was not yet cached is a lookup of a nonexistent version. This CL adds caching of failed lookups of nonexistent versions, by saving a checksum of all the heads and tags refs on the remote server (we never consider other kinds of refs). If none of those have changed, then we don't need to download the full server. Fixes #53644. Change-Id: I428bbc8ec8475bd7d03788934d643e1e2be3add0 Reviewed-on: https://go-review.googlesource.com/c/go/+/415678 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-05cmd/go: add -reuse flag to make proxy invocations more efficientRuss Cox
The go list -m and go mod download commands now have a -reuse flag, which is passed the name of a file containing the JSON output from a previous run of the same command. (It is up to the caller to ensure that flags such as -versions or -retracted, which affect the output, are consistent between the old and new run.) The new run uses the old JSON to evaluate whether the answer is unchanged since the old run. If so, it reuses that information, avoiding a costly 'git fetch', and sets a new Reuse: true field in its own JSON output. This dance with saving the JSON output and passing it back to -reuse is not necessary on most systems, because the go command caches version control checkouts in the module cache. That cache means that a new 'git fetch' would only download the commits that are new since the previous one (often none at all). The dance becomes important only on systems that do not preserve the module cache, for example by running 'go clean -modcache' aggressively or by running in some environment that starts with an empty file system. For #53644. Change-Id: I447960abf8055f83cc6dbc699a9fde9931130004 Reviewed-on: https://go-review.googlesource.com/c/go/+/411398 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-05cmd/go: record origin metadata during module downloadRuss Cox
This change adds an "Origin" JSON key to the output of go list -json -m and go mod download -json. The associated value is a JSON object with metadata about the source control system. For Git, that metadata is sufficient to evaluate whether the remote server has changed in any interesting way that might invalidate the cached data. In most cases, it will not have, and a fetch could then avoid downloading a full repo from the server. This origin metadata is also now recorded in the .info file for a given module@version, for informational and debugging purposes. This change only adds the metadata. It does not use it to optimize away unnecessary git fetch operations. (That's the next change.) For #53644. Change-Id: I4a1712a2386d1d8ab4e02ffdf0f72ba75d556115 Reviewed-on: https://go-review.googlesource.com/c/go/+/411397 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-04build/constraint: update doc to mention a feature added in Go 1.17Cristian Greco
The pkg documentation mentions that the "//go:build" syntax "will be" added in Go 1.17. In fact, it has been added in that Go release, so the documentation can now be updated. Change-Id: I72f24063c3be62d97ca78bf724d56599f5f19460 GitHub-Last-Rev: 4371886f6ce9f2c2a370df047a5baa1f122c681f GitHub-Pull-Request: golang/go#53647 Reviewed-on: https://go-review.googlesource.com/c/go/+/415774 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-07-04runtime: pass correct string to exits on Plan 9Ori Bernstein
In CL 405901 the definition of exit in the Plan 9 go runtime was changed like so: - status = append(itoa(tmp[:len(tmp)-1], uint64(e)), 0) + sl := itoa(tmp[:len(tmp)-1], uint64(e)) + // Don't append, rely on the existing data being zero. + status = tmp[:len(sl)+1] However, itoa only puts the converted number "somewhere" in the buffer. Specifically, it builds it from the end of the buffer towards the start, meaning the first byte of the buffer is a 0 byte, and the resulting string that's passed to exits is empty, leading to a falsely successful exit. This change uses the returned value from itoa, rather than the buffer that was passed in, so that we start from the correct location in the string. Fixes #53669 Change-Id: I63f0c7641fc6f55250857dc17a1eeb12ae0c2e10 Reviewed-on: https://go-review.googlesource.com/c/go/+/415680 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-01net/http: omit invalid header value from error messageAlexander Yastrebov
Updates #43631 Change-Id: I0fe3aafdf7ef889fed1a830128721393f8d020e6 GitHub-Last-Rev: c359542d741b17f4e2cb0d50982bf341246233b0 GitHub-Pull-Request: golang/go#48979 Reviewed-on: https://go-review.googlesource.com/c/go/+/355929 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-01cmd/go, go/build: clarify build constraint docsIan Lance Taylor
Clarify that the //go:build line is an expression of constraints, not a constraint itself. Fixes #53308 Change-Id: Ib67243c6ee5cfe3b688c12b943b5e7496f686035 Reviewed-on: https://go-review.googlesource.com/c/go/+/411697 Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-07-01flag: highlight support for double dashes in docsSebastian Gassner
Updating examples, to show that double dashes are also permitted. This has been easy to miss previously. Change-Id: Ib67b4e39fea90ef4cb9e894709c53baedfc18fc2 GitHub-Last-Rev: f7df57b646d6412c1346e85c3a7353a8df41afc6 GitHub-Pull-Request: golang/go#53628 Reviewed-on: https://go-review.googlesource.com/c/go/+/415374 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-07-01go/types, types2: document that exported predicates are unspecified for ↵Robert Griesemer
invalid type arguments Per discussion on the issue. For #53595. Change-Id: Iefd161e5c7e792d454652cbe831a0c2d769f748e Reviewed-on: https://go-review.googlesource.com/c/go/+/415574 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-30go/types, types2: re-enable a couple of commented out testsRobert Griesemer
Change-Id: Ibb27012b18fc0f0f9f9ef74cc120e7ef981e6d43 Reviewed-on: https://go-review.googlesource.com/c/go/+/415156 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com>
2022-06-30go/doc/comment: support links in lists in commentsBen Sarah Golightly
The proposed (#51082) new go doc comment additions supports lists, links, and doc links, but does not support links and doc links inside lists, so implemnent this. Fixes #53610 Change-Id: I4fa17d204fc9efa8f3633133e4a49e56cf1aa9bc Reviewed-on: https://go-review.googlesource.com/c/go/+/415174 Reviewed-by: Ben Golightly <golightly.ben@googlemail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-06-30os: fix a typo in path_windows.goAndreasHGK
I believe the path_windows.go file has a typo, which is fixed in this PR Change-Id: Ibf1a7189a6312dbb3b1e6b512beeb6d99da5b5bc GitHub-Last-Rev: cedac7eaa07d26667e6800c5ac96239d5ccf6ba8 GitHub-Pull-Request: golang/go#53629 Reviewed-on: https://go-review.googlesource.com/c/go/+/415434 Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-06-30os: simplify deadline fluctuation testsIan Lance Taylor
This applies the net package CL 365334, CL 366176, CL 372215 to the os package. CL 365334: These tests were checking for fairly narrow timing windows, but were running in parallel and heavily dependent on timer and goroutine scheduling. This change eliminates unnecessary goroutines, runs the tests sequentially (dramatically shortening the timeouts to reduce the penalty of doing so), and uses timestamp comparison instead of background timers to hopefully gain some robustness from monotonic timestamps. Many of the other tests from this package would benefit from similar simplifications, which we can apply if and when we notice flaky failures or want to improve the latency of running the test. CL 366176: It appears that at least the OpenBSD kernel gets sloppier the longer the timeout we give it, up to an observed overhead of around 25%. Let's give it a little more than that (33%) in the comparison, and also increase the growth curve to match the actual observed times instead of exponential initial growth. CL 372215: Decrease the slop everywhere else, since NetBSD and OpenBSD seem to be the only ones that miss by that much. For #36108 For #50189 Fixes #50725 (we hope) Change-Id: I0854d27af67ca9fcf0f9d9e4ff67acff4c2effc8 Reviewed-on: https://go-review.googlesource.com/c/go/+/415234 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-30cmd/go/internal/modindex: remove spurious field from index_format documentationBryan C. Mills
The 'path' field was removed in an earlier revision to the format. While auditing the format, I also cleaned up a couple of minor typographical issues. For #53586. Change-Id: I4cd1ce9e970023441c11244428ed2971be1d8138 Reviewed-on: https://go-review.googlesource.com/c/go/+/415514 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-30cmd/go: include module root in package index keyBryan C. Mills
The package index format includes the directory relative to the module root. The module root for a given directory can change even if the contents of the directory itself do not (by adding or removing a go.mod file in some parent directory). Thus, we need to invalidate the index for a package when its module root location changes. Fixes #53586 (I think). Change-Id: I2d9f4de80e16bce75b3106a2bad4a11d8378d037 Reviewed-on: https://go-review.googlesource.com/c/go/+/415475 Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-30cmd/go: add a 'sleep' command for script testsBryan C. Mills
Due to mtime skew we don't index mutable packages with an mtime younger than 2 seconds. In order to test indexed packages reliably, we want to be able to sleep long enough for the files in the package to be cached. (As an alternative we could instead use os.Chtimes to fake old enough timestamps, but sleeping keeps the tests more realistic.) For #53586. Change-Id: I1873f47c55a72d928451593b8c989f0092a557db Reviewed-on: https://go-review.googlesource.com/c/go/+/415474 Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-30cmd/compile: fix prove pass when upper condition is <= maxintKeith Randall
When the terminating condition is <= X, we need to make sure that X+step doesn't overflow. Fixes #53600 Change-Id: I36e5384d05b4d7168e48db6094200fcae409bfe5 Reviewed-on: https://go-review.googlesource.com/c/go/+/415219 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org>
2022-06-30spec: retitle section on "Assignments" to "Assignment statements"Robert Griesemer
This permits a clear distinction between an individual assignment and an assignment statement which may assign more than one value. It also makes this section title consistent with all other section titles about statements. Adjust internal links and prose where appropriate. (Note that the spec already referred to assignment statements in a couple of places, even before this change.) Add an introductory paragraph to the section on assignment statements. Preparation for adding a section on value vs reference types (issue #5083). Change-Id: Ie140ac296e653c67da2a5a203b63352b3dc4f9f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/413615 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-30test: add regress test for #53619Matthew Dempsky
Works with cmd/compile, but fails with gccgo currently. Updates #53619. Change-Id: I787faa9584cc33bd851c9cc8f146c91f4eb36fc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/415238 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-06-29debug/pe: add IMAGE_FILE_MACHINE_LOONGARCH{64,32}Guoqi Chen
Related: https://github.com/MicrosoftDocs/win32/pull/1067 Change-Id: I946253f217a5c616ae4a19be44634000cba5020e Reviewed-on: https://go-review.googlesource.com/c/go/+/411616 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-06-29net/http: preserve nil values in Header.CloneDamien Neil
ReverseProxy makes a distinction between nil and zero-length header values. Avoid losing nil-ness when cloning a request. Thanks to Christian Mehlmauer for discovering this. Fixes #53423 Fixes CVE-2022-32148 Change-Id: Ice369cdb4712e2d62e25bb881b080847aa4801f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/412857 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2022-06-29cmd/internal/obj/arm64: save LR and SP in one instruction for small framesCherry Mui
When we create a thread with signals blocked. But glibc's pthread_sigmask doesn't really allow us to block SIGSETXID. So we may get a signal early on before the signal stack is set. If we get a signal on the current stack, it will clobber anything below the SP. This CL makes it to save LR and decrement SP in a single MOVD.W instruction for small frames, so we don't write below the SP. We used to use a single MOVD.W instruction before CL 379075. CL 379075 changed to use an STP instruction to save the LR and FP, then decrementing the SP. This CL changes it back, just this part (epilogues and large frame prologues are unchanged). For small frames, it is the same number of instructions either way. This decreases the size of a "small" frame from 0x1f0 to 0xf0. For frame sizes in between, it could benefit from using an STP instruction instead of using the prologue for the "large" frame case. We don't bother it for now as this is a stop-gap solution anyway. This only addresses the issue with small frames. Luckily, all functions from thread entry to setting up the signal stack have samll frames. Other possible ideas: - Expand the unwind info metadata, separate SP delta and the location of the return address, so we can express "SP is decremented but the return address is in the LR register". Then we can always create the frame first then write the LR, without writing anything below the SP (except the frame pointer at SP-8, which is minor because it doesn't really affect program execution). - Set up the signal stack immediately in mstart in assembly. For Go 1.19 we do this simple fix. We plan to do the metadata fix in Go 1.20 ( #53609 ). Other LR architectures are addressed in CL 413428. Fix #53374. Change-Id: I9d6582ab14ccb06ac61ad43852943d9555e22ae5 Reviewed-on: https://go-review.googlesource.com/c/go/+/412474 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Eric Fang <eric.fang@arm.com>
2022-06-29go/token: use atomics not Mutex for last file cacheAlan Donovan
Previously, FileSet would cache the last *File found by a lookup, using a full (exclusive) mutex within FileSet.File, turning a logical read operation into an update. This was one of the largest sources of contention in gopls. This change uses atomic load/store on the 'last' field without a mutex. Also, in FileSet.AddFile, allocate the File outside the critical section; all the other operations are typically cheap. Fixes #53507 Change-Id: Ice8641650d8495b25b0428e9b9320837ff2ca7e1 Reviewed-on: https://go-review.googlesource.com/c/go/+/411909 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-29net/http: don't strip whitespace from Transfer-Encoding headersDamien Neil
Do not accept "Transfer-Encoding: \rchunked" as a valid TE header setting chunked encoding. Thanks to Zeyu Zhang (https://www.zeyu2001.com/) for identifying the issue. Fixes #53188 Fixes CVE-2022-1705 Change-Id: I1a16631425159267f2eca68056b057192a7edf6c Reviewed-on: https://go-review.googlesource.com/c/go/+/409874 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2022-06-29runtime: add race annotations to cbs.lockMichael Pratt
cbs.lock protects a map. The map implementation is race instrumented regardless of which package is it called from. lock/unlock are not automatically race instrumented, so we can trigger race false positives without manually annotating our lock acquire and release. compileCallback is used during initialization before the P is available, at which point raceacquire will crash during a racecallback to get the race proc. Thus we skip instrumentation until scheduler initialization is complete. Fixes #50249. Change-Id: Ie49227c9e9210ffbf0aee65f86f2b7b6a2f64638 Reviewed-on: https://go-review.googlesource.com/c/go/+/414518 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com>
2022-06-29crypto/x509/pkix: move crl deprecation messageRoland Shoemaker
There was a deprecation message on RevokedCertificate which was intended to be on CertificateList. Change-Id: Ia378935afc75c36702e64cf33ea5c8a24c1488ca Reviewed-on: https://go-review.googlesource.com/c/go/+/414754 Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Tatiana Bradley <tatiana@golang.org>
2022-06-29cmd/internal/obj/mips,s390x,riscv: save LR after decrementing SPCherry Mui
Following CL 412474, for the rest of the LR architectures. On MIPS(32/64), S390X, and RISCV, there is no single instruction that saves the LR and decrements the SP, so we need to insert an instruction to save the LR after decrementing the SP. On ARM(32) and PPC64 we already use a single instruction to save the LR and decrement the SP. Updates #53374. Change-Id: I5a2e211026d95edb0e0f7d084ddb784f8077b86d Reviewed-on: https://go-review.googlesource.com/c/go/+/413428 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-06-29runtime: add race annotations to metricsSemaMichael Pratt
metricsSema protects the metrics map. The map implementation is race instrumented regardless of which package is it called from. semacquire/semrelease are not automatically race instrumented, so we can trigger race false positives without manually annotating our lock acquire and release. See similar instrumentation on trace.shutdownSema and reflectOffs.lock. Fixes #53542. Change-Id: Ia3fd239ac860e037d09c7cb9c4ad267391e70705 Reviewed-on: https://go-review.googlesource.com/c/go/+/414517 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-29crypto/x509: improve RevocationList documentationRoland Shoemaker
Adds documentation for a handful of RevocationList fields. Updates #50674 Change-Id: I26b838553d870b631deaf8b9a5b4d0b251fdef20 Reviewed-on: https://go-review.googlesource.com/c/go/+/414635 Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2022-06-28cmd/internal/obj/arm64: fix BITCON constant printing erroreric fang
For some 32-bit instructions whose first operand is a constant, we copy the lower 32 bits of the constant into the upper 32 bits in progedit, which leads to the wrong value being printed in -S output. The purpose of this is that we don't need to distinguish between 32-bit and 64-bit constants when checking C_BITCON, this CL puts the modified value in a temporary variable, so that the constant operand of the instruction will not be modified. Fixes #53551 Change-Id: I40ee9223b4187bff1c0a1bab7eb508fcb30325f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/414374 Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2022-06-28cmd/go: pass --no-decorate when listing git tags for a commithidu
This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Fixes #51312. Change-Id: Ic47b0f604c0c3a404ec50d6e09f4e138045ac2f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/387835 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-06-28os/exec: on Windows, suppress ErrDot if the implicit path matches the ↵Bryan C. Mills
explicit one If the current directory is also listed explicitly in %PATH%, this changes the behavior of LookPath to prefer the explicit name for it (and thereby avoid ErrDot). However, in order to avoid running a different executable from what would have been run by previous Go versions, we still return the implicit path (and ErrDot) if it refers to a different file entirely. Fixes #53536. Updates #43724. Change-Id: I7ab01074e21a0e8b07a176e3bc6d3b8cf0c873cd Reviewed-on: https://go-review.googlesource.com/c/go/+/414054 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-28cmd/compile: fix generic inter-inter comparisons from value switch statementsCuong Manh Le
If value is a non-empty interface and has shape, we still need to convert it to an interface{} first. Fixes #53477 Change-Id: I516063ba4429a6cc24c483758387ec13815fc63e Reviewed-on: https://go-review.googlesource.com/c/go/+/414834 Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-06-28cmd/go/internal/modfetch: cache latest revinfo in Versions funcBaokun Lee
The responses have been cached by the web2 package before removed it in CL 170879. This change add latest revinfo cache in Versions func. Fixes #51391 Change-Id: I73597e0a6b4938238e69d85e1cbbaa9007776db3 Reviewed-on: https://go-review.googlesource.com/c/go/+/403335 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Lee Baokun <bk@golangcn.org> Reviewed-by: David Chase <drchase@google.com>
2022-06-28test: add more tests for const decls with ommitted RHS expressionsRobert Griesemer
Add analogous tests to go/types and types2 test suites. Make sure "assert" built-in is available in type-checker tests. For #49157. For #53585. Change-Id: I092901ecb43eb4833c09bd8f5e38efbe0285babe Reviewed-on: https://go-review.googlesource.com/c/go/+/414795 Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-28test: add test that gofrontend failed to compileIan Lance Taylor
For #51475 Change-Id: Ie1b27304687225194a323dc8305e5d62578fff4f Reviewed-on: https://go-review.googlesource.com/c/go/+/414755 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-28runtime: clean up unused function gosave on loong64Guoqi Chen
Change-Id: I28960a33d251a36e5e364fa6e27c5b2e13349f6b Reviewed-on: https://go-review.googlesource.com/c/go/+/409354 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: David Chase <drchase@google.com>
2022-06-28cmd/go: omit build metadata that may contain system paths when -trimpath is setBryan C. Mills
CGO flag variables often include system paths for header files and compiled libraries. The point of -trimpath is to avoid dependending on system paths, so stamping these variables is counterproductive. Moreover, the point of stamping build information is to improve reproducibility. Since we don't also stamp the versions of C compilers, headers, and libraries used in a cgo build, only the most trivial cgo programs can be faithfully reproduced from the stamped information. Likewise, the -ldflags flag may include system-specific paths, particularly if external linking is in use. For now, we omit -ldflags entirely; however, in the future we may instead want to parse and redact the individual flags. Fixes #52372. Change-Id: I73318a01cce4371d66955b3261fc7ee58d4b33dd Reviewed-on: https://go-review.googlesource.com/c/go/+/409174 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com>
2022-06-28api: correct debug/pe issue number for Go 1.19 changesRuss Cox
It was #51868 not #51686. For #53310. Change-Id: I2cf28ca4de65e7030fdbd05e7f32fe42c8f3ca0a Reviewed-on: https://go-review.googlesource.com/c/go/+/414515 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-28cmd/go/internal/modload: fix doc commentRuss Cox
Change-Id: Ib7f47c7fc2fa5db3adbe51612b1e7a9bb49647b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/411105 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-28go/printer: report allocs and set bytesDaniel Martí
We now get more than just time/op. name time/op Print-16 6.29ms ± 3% name speed Print-16 8.25MB/s ± 3% name alloc/op Print-16 483kB ± 0% name allocs/op Print-16 17.8k ± 0% Change-Id: I6b5e9a30a826ff8603724bd5983e6b7f5ec12708 Reviewed-on: https://go-review.googlesource.com/c/go/+/412554 Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Ian Lance Taylor <iant@google.com>