Keith Randall [Fri, 23 Jun 2023 22:29:36 +0000 (15:29 -0700)]
cmd/compile: fix min/max builtin code generation
Our large-function phi placement algorithm is incompatible with phi
opcodes already existing in the SSA representation. Instead, use simple
variable assignments and have the phi placement algorithm place the phis
we need for min/max.
Turns out the small-function phi placement algorithm doesn't have this
sensitivity, so this bug only occurs in large functions (>500 basic blocks).
Maybe we should document/check that no phis are present when we start
phi placement (regardless of size). Leaving for a potential separate CL.
We should probably also fix the placement algorithm to handle existing
phis correctly. But this CL is probably a lot smaller/safer than
messing with phi placement.
Fixes #60982
Change-Id: I59ba7f506c72b22bc1485099a335d96315ebef67
Reviewed-on: https://go-review.googlesource.com/c/go/+/505756 Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Ian Lance Taylor [Fri, 23 Jun 2023 21:23:31 +0000 (14:23 -0700)]
slices: clarify MinFunc/MaxFunc result for equal elements
They should return the first of equal elements. No such clarification
is required for Min/Max as for them equal elements are indistinguishable.
For #60091
Change-Id: Iad58115d482add852c811e993131702b5b3bec5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/505796
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Eli Bendersky <eliben@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Roland Shoemaker [Fri, 23 Jun 2023 19:07:19 +0000 (12:07 -0700)]
crypto/x509: rename duplicated test
Rename the old TestPlatformVerifier to TestPlatformVerifierLegacy, and
add TODO about removing it once the synthetic root is widely deployed on
builders.
Updates #52108
Change-Id: I6cdba268e4738804c7f76ea18c354470b3e0318c
Reviewed-on: https://go-review.googlesource.com/c/go/+/505755
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Jelle van den Hooff [Thu, 22 Jun 2023 01:28:05 +0000 (18:28 -0700)]
runtime: set raceignore to zero when starting a new goroutine
When reusing a g struct the runtime did not reset
g.raceignore. Initialize raceignore to zero when initially
setting racectx.
A goroutine can end with a non-zero raceignore if it exits
after calling runtime.RaceDisable without a matching
runtime.RaceEnable. If that goroutine's g is later reused
the race detector is in a weird state: the underlying
g.racectx is active, yet g.raceignore is non-zero, and
raceacquire/racerelease which check g.raceignore become
no-ops. This causes the race detector to report races when
there are none.
Fixes #60934
Change-Id: Ib8e412f11badbaf69a480f03740da70891f4093f
Reviewed-on: https://go-review.googlesource.com/c/go/+/505055 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Cuong Manh Le [Thu, 22 Jun 2023 18:04:29 +0000 (01:04 +0700)]
cmd/compile: scanning closures body when visiting wrapper function
CL 410344 fixed missing method value wrapper, by visiting body of
wrapper function after applying inlining pass.
CL 492017 allow more inlining of functions that construct closures,
which ends up making the wrapper function now inlineable, but can
contain closure nodes that couldn't be inlined. These closures body may
contain OMETHVALUE nodes that we never seen, thus we need to scan
closures body for finding them.
Fixes #60945
Change-Id: Ia1e31420bb172ff87d7321d2da2989ef23e6ebb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/505255
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Bryan C. Mills [Thu, 22 Jun 2023 15:04:45 +0000 (11:04 -0400)]
internal/platform,cmd/dist: export the list of supported platforms
Also switch internal/platform to commit the generated code instead of
regenerating it in cmd/dist. Nothing in the generated code depends on
the target configuration, and committing the source file makes it
more amenable to searching and indexing (particularly on
https://cs.opensource.google/go/go).
Than McIntosh [Thu, 15 Jun 2023 13:14:03 +0000 (09:14 -0400)]
cmd/{go,cover}: enable response file args for cmd/cover
Change the cover command to accept arguments via response files, using
the same mechanism employed for the compiler and the assembler. This
is needed now that the cover tool accepts a list of all source files
in a package, as opposed to just a single source file, and as a result
can run into system-dependent command line length limits.
Fixes #60785.
Change-Id: I67dbc96ad9fc5c6f43d5c1e4e903e4b8589b154f
Reviewed-on: https://go-review.googlesource.com/c/go/+/503735
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Roland Shoemaker [Wed, 21 Jun 2023 21:43:05 +0000 (14:43 -0700)]
crypto/x509: tolerate multiple matching chains in testVerify
Due to the semantics of roots, a root store may contain two valid roots
that have the same subject (but different SPKIs) at the asme time. As
such in testVerify it is possible that when we verify a certificate we
may get two chains that has the same stringified representation.
Rather than doing something fancy to include keys (which is just overly
complicated), tolerate multiple matches.
Fixes #60925
Change-Id: I5f51f7635801762865a536bcb20ec75f217a36ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/505035 Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Ian Lance Taylor [Mon, 19 Jun 2023 22:35:50 +0000 (15:35 -0700)]
net/mail: permit more characters in mail headers
We parse mail messages using net/textproto. For #53188, we tightened
up the bytes permitted by net/textproto to match RFC 7230.
However, this package uses RFC 5322 which is more permissive.
Restore the permisiveness we used to have, so that older code
continues to work.
Fixes #58862
Fixes #60332
Change-Id: I5437f5e18a756f6ca61c13c4d8ba727be73eff9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/504416
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Wed, 21 Jun 2023 20:52:42 +0000 (13:52 -0700)]
test: add test that caused a gofrontend crash
Change-Id: Idd872c5b90dbca564ed8a37bb3683e642142ae63
Reviewed-on: https://go-review.googlesource.com/c/go/+/505015 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Wed, 21 Jun 2023 20:21:00 +0000 (13:21 -0700)]
doc/go1.21: correct GOOS to GOARCH (another location)
Change-Id: Ie71bc41bd7f1aecf6ce69a8b310668fdd03da42b
Reviewed-on: https://go-review.googlesource.com/c/go/+/504880
TryBot-Bypass: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Rhys Hiltner <rhys@justin.tv>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
Ian Lance Taylor [Wed, 21 Jun 2023 19:44:48 +0000 (12:44 -0700)]
doc/go1.21: correct GOOS to GOARCH
For #57752
Fixes #60924
Change-Id: Ie1e16c041885abb51dd6c2f0b7dfa03091cfb338
Reviewed-on: https://go-review.googlesource.com/c/go/+/504879 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Change the top 5 not to run builds at all, so they don't
have to use -a or clear the go build cache.
mod_get_direct should be replaced with a vcs-test test.
mod_invalid_version should be replaced with a vcs-test test.
get_legacy should be deleted eventually.
Ian Lance Taylor [Mon, 12 Jun 2023 22:57:00 +0000 (15:57 -0700)]
cmd/go: add comment for intentional misspelling
Try to avoid fixes from automatic spell checkers.
Change-Id: I1d134fb2721decffa865a3f4d78bca4fce8e8fee
Reviewed-on: https://go-review.googlesource.com/c/go/+/502658 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@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>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Russ Cox [Fri, 16 Jun 2023 20:30:52 +0000 (16:30 -0400)]
cmd/go: do not index std as a module in modcache
We do not index std as a whole module ever.
When working in the main Go repo, files in package change often,
so we don't want to pay the cost of reindexing all of std when what
we really need is just to reindex strings. Per-package indexing
works better for that case.
When using a released Go toolchain, we don't have to worry about
the whole module changing, but if we switch to whole-module indexing
at that point, we have the potential for bugs that only happen in
released toolchains. Probably not worth the risk.
For similar reasons, we don't index the current work module as
a whole module (individual packages are changing), so we use the heuristic
that we only do whole-module indexing in the module cache.
The new toolchain modules live in the module cache, though, and
our heuristic was causing whole-module indexing for them.
As predicted, enabling whole-module indexing for std when it's
completely untested does in fact lead to bugs (a very minor one).
This CL turns off whole-module indexing for std even when it is
in the module cache, to bring toolchain module behavior back in
line with the other ways to run toolchains.
Russ Cox [Fri, 16 Jun 2023 17:08:23 +0000 (13:08 -0400)]
cmd/go: disable sumdb less often for toolchain downloads
There is a chicken and egg problem with always requiring
the checksum database for toolchain module downloads, since the
checksum database populates its entry by doing its own module
download.
Don't require the checksum database for GOPROXY=file:/// (for local testing)
and when running on the Go module mirror.
David Chase [Thu, 15 Jun 2023 17:56:02 +0000 (13:56 -0400)]
internal/bisect: add 'q' hash option for quiet hash behavior switching
This is intended for the specific case of 'fmahash=qn' where someone
wants to disable fma without all the hash-search-handshake output.
There are cases where arm64, ppc64, and s390x users might want to do
this.
Olivier Mengué [Mon, 19 Jun 2023 17:17:46 +0000 (19:17 +0200)]
runtime/trace: add godoc links
Change-Id: I6db8ce8d7e0a1cb3d955493fa49eb7dff372eb38
Reviewed-on: https://go-review.googlesource.com/c/go/+/504375
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Moritz Poldrack [Fri, 16 Jun 2023 21:12:25 +0000 (21:12 +0000)]
os/exec: document a method to check if a process is alive
Fixes #34396
Change-Id: I35c4e3447f84e349adf7edba92ccb19b324bfe14
GitHub-Last-Rev: 4f06764109ddd9bdfbe4841fc1bebebe026eeb29
GitHub-Pull-Request: golang/go#60763
Reviewed-on: https://go-review.googlesource.com/c/go/+/502815
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@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>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Bryan C. Mills [Fri, 16 Jun 2023 18:46:37 +0000 (14:46 -0400)]
path/filepath: avoid assuming that GOROOT/test is present
GOROOT/test is pruned out by cmd/distpack. It isn't really needed for
the test anyway; the test can instead use the "src/unicode" subdirectory,
which is even within the same module.
This test was previously adjusted in CL 13467045 and CL 31859.
Unlike in previous iterations of the test, the directories used in
this revision are covered by the Go 1 compatibility policy and thus
unlikely to disappear.
Al Cutter [Thu, 15 Jun 2023 15:23:12 +0000 (15:23 +0000)]
net/http: check RemoteAddr isn't nil before dereferencing
RemoteAddr can return nil in some cases, this fix prevents a panic.
I chatted with @neild about this beforehand, but what's happening in our
case is that a connection comes in to the HTTP server which is then
immediately closed (we discovered this issue by accident using nmap).
The network implementation that we're using (it happens to be gVisor
via its gonet adaptor) is returning nil from RemoteAddr(), presumably
as there is no remote at that point.
But, ultimately, since RemoteAddr returns an interface it is always
possible for it to return nil, and indeed conn.RemoteAddr in this file
does exactly that if the conn is not ok.
Change-Id: Ibe67ae6e30b68e2776df5ee2911bf5f1dc539641
GitHub-Last-Rev: ff3505d1d0b00ca16c68ec2a05f542978b79b170
GitHub-Pull-Request: golang/go#60823
Reviewed-on: https://go-review.googlesource.com/c/go/+/503656
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Dmitri Shuralyov [Thu, 15 Jun 2023 05:39:04 +0000 (01:39 -0400)]
net/http: close req.Body only when it's non-nil on js
The main change here is fixing the panic where it was called even when
req.Body was nil. It might also work better to keep the req.Body.Close
calls closer after req.Body is read, so do that too.
Calling readableStreamPull.Release on a js.Func with a zero value
is currently a no-op, but it seems better to avoid it anyway.
Also remove readableStreamStart, readableStreamCancel while here.
They were used in the initial but not final patch set of CL 458395.
Fixes #60809.
Change-Id: I6ff2e3b6ec2cd4b0c9c67939903e32908312db8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/503676 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Achille Roussel [Wed, 14 Jun 2023 04:39:54 +0000 (21:39 -0700)]
testing/fstest: fix the Glob test when dir entries are out of order
This change adds a test highlighting an issue with the fstest.TestFS
test suite which occurred when the fs.FS implementation would expose
directories returning unordered directory entries from their ReadDir
method.
--- FAIL: TestShuffledFS (0.00s)
testfs_test.go:76: testing fs.Sub(fsys, tmp): TestFS found errors:
.: Glob(`*e*`): wrong output:
extra: one
missing: one
The issue came from having the wrong variable passed to the checkGlob
method. There are two variables named list and list2, the latter is
sorted, and the checkGlob method expects a sorted list but was passed
list instead of list2.
Change-Id: I5e49dccf14077e7d1fee51687eb6a5eeb0330c16
Reviewed-on: https://go-review.googlesource.com/c/go/+/503175
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Thu, 8 Jun 2023 18:40:31 +0000 (18:40 +0000)]
reflect: fix ArenaNew to match documentation
Currently ArenaNew expects the type passed in to be a *T and it returns
a *T. This does not match the function's documentation.
Since this is an experiment, change ArenaNew to match the documentation.
This more closely aligns ArenaNew with arena.New. (Takes a type T,
returns a *T value.)
Note that this is a breaking change. However, as far as pkg.go.dev can
tell, there's exactly one package using it in the open source world.
Also, add smoke test for the exported API, which is just a wrapper
around the internal API. Clearly there's enough room for error here that
it should be tested, but we don't need thorough tests at this layer
because that already exists in the runtime. We just need to make sure it
basically works.
Fixes #60528.
Change-Id: I673cc4609378380ef80648b0c2eb2928e73f49c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/501860
Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Dmitri Shuralyov [Fri, 16 Jun 2023 13:03:11 +0000 (09:03 -0400)]
cmd/distpack: make go_$GOOS_$GOARCH_exec programs executable
The go command recognizes when a program named go_$GOOS_$GOARCH_exec
is in PATH. There are two such programs living in GOROOT/misc/wasm.
Like GOROOT/bin/{go,gofmt} and GOROOT/pkg/tool/**, these programs
need to have the executable bit set to do their job, so set it.
Comparing a distpack produced before and after this change shows that
the pack.go file is modified, the two go_{js,wasip1}_wasm_exec programs
have the new file mode, and there are no other changes, as expected.
The mode change is relevant to the binary and source distributions only.
No change to the module zip since it doesn't include GOROOT/misc at all,
so no effect on previously created toolchain modules whose checksums
are already recorded in the Go checksum database and cannot be changed.
(Other than by changing their "v0.0.1" version, but that's expensive.)
Fixes #60843.
Change-Id: I799b6aacff59c0785cb7743cbd17dda5a9ef91be
Reviewed-on: https://go-review.googlesource.com/c/go/+/503975 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Cherry Mui [Thu, 15 Jun 2023 22:16:51 +0000 (18:16 -0400)]
runtime: use 1-byte load for address checking in racecallatomic
In racecallatomic, we do a load before calling into TSAN, so if
the address is invalid we fault on the Go stack. We currently use
a 8-byte load instruction, regardless of the data size that the
atomic operation is performed on. So if, say, we are doing a
LoadUint32 at an address that is the last 4 bytes of a memory
mapping, we may fault unexpectedly. Do a 1-byte load instead.
(Ideally we should do a load with the right size, so we fault
correctly if we're given an unaligned address for a wide load
across a page boundary. Leave that for another CL.)
Fix AMD64, ARM64, and PPC64. The code already uses 1-byte load
on S390X.
Should fix #60825.
Change-Id: I3dee93eb08ba180c85e86a9d2e71b5b520e8dcf0
Reviewed-on: https://go-review.googlesource.com/c/go/+/503937
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: David Chase <drchase@google.com>
Than McIntosh [Tue, 13 Jun 2023 20:13:01 +0000 (16:13 -0400)]
cmd/go: fix build config for 'go list -cover'
When 'go list -cover' is run in a way that triggers package builds
(for example, -export), ensure that the build step actually includes
coverage instrumentation as part of the config. Without this we will
wind up with incorrect build IDs.
Dmitri Shuralyov [Thu, 15 Jun 2023 06:08:47 +0000 (02:08 -0400)]
net/http: only disable Fetch API in tests
The Fetch API was meant to only be disabled in tests.
Since wasm_exec.js defines a global 'process' object,
it ended up being disabled anywhere that script is used.
Make the heuristic stricter so that it's less likely to
trigger anywhere but when testing js/wasm using Node.js.
For #57613.
Fixes #60808.
Change-Id: Ief8def802b466ef4faad16daccefcfd72e4398b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/503675
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Ian Lance Taylor [Tue, 6 Jun 2023 21:31:21 +0000 (14:31 -0700)]
math: document that Min/Max differ from min/max
For #59488
Fixes #60616
Change-Id: Idf9f42d7d868999664652dd7b478684a474f1d96
Reviewed-on: https://go-review.googlesource.com/c/go/+/501355 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Cuong Manh Le [Thu, 8 Jun 2023 02:58:22 +0000 (09:58 +0700)]
cmd/compile: do not report division by error during typecheck
types2 have already errored about any spec-required overflows, and
division by zero. CL 469595 unintentionally fixed typecheck not to error
about overflows, but zero division is still be checked during tcArith.
This causes unsafe operations with variable size failed to compile,
instead of raising runtime error.
Fixes #60601
Change-Id: I7bea2821099556835c920713397f7c5d8a4025ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/501735
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Wed, 14 Jun 2023 23:17:31 +0000 (16:17 -0700)]
text/template: set variables correctly in range assignment
I unintentionally flipped them in CL 446795.
For #56490
Fixes #60801
Change-Id: I57586bec052e1b2cc61513870ce24dd6ce17e56b
Reviewed-on: https://go-review.googlesource.com/c/go/+/503575 Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
eric fang [Tue, 13 Jun 2023 10:02:33 +0000 (10:02 +0000)]
cmd/asm: fix encoding errors for FMOVD and FMOVS instructions on arm64
The encoding of instructions "FMOVD F1, ZR" and "FMOVS F1, ZR" is wrong,
the assembler encodes them as "FMOVD F1, F31" and "FMOVS F1, F31". This
CL fixes the bug.
Change-Id: I2d31520b58f9950ce2534a04f4a3275bf103a673
Reviewed-on: https://go-review.googlesource.com/c/go/+/503135
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Wed, 14 Jun 2023 21:26:59 +0000 (14:26 -0700)]
cmd/go: check for errors reading gccgo package list
Previously if there was something invalid about the package list
cmd/go would crash rather than reporting a useful error.
For #60798
Change-Id: I502facf41442ab49217405b5b1874fff52a6d416
Reviewed-on: https://go-review.googlesource.com/c/go/+/503496
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Bryan C. Mills [Wed, 14 Jun 2023 21:16:59 +0000 (17:16 -0400)]
cmd/go: use gover.Local for $goversion in TestScript
Previously we used the highest Go build tag found in the build
configuration, which matches gover.Local for development toolchains
(it is always a bare language version), but is too low for releases.
Roland Shoemaker [Tue, 25 Apr 2023 20:15:04 +0000 (13:15 -0700)]
crypto/x509: use synthetic root for platform testing
Rather than using the external network and real-world chains for testing
the integrations with platform verifiers, use a synthetic test root.
This changes adds a constrained root and key pair to the tree, and adds
a test suite that verifies certificates issued from that root. These
tests are only executed if the root is detected in the trust store. For
reference, the script used to generate the root and key is attached to
the bottom of this commit message.
This change leaves the existing windows/darwin TestPlatformVerifier
tests in place, since the trybots do not currently have the test root in
place, and as such cannot run the suite. Once the builder images have
the root integrated, we can remove the old flaky tests, and the trybots
will begin running the new suite automatically.
now := time.Now()
tmpl := &x509.Certificate{
SerialNumber: big.NewInt(9009),
Subject: pkix.Name{
CommonName: "Go platform verifier testing root",
},
NotBefore: now.Add(-time.Hour),
NotAfter: now.Add(time.Hour * 24 * 365 * 5),
IsCA: true,
BasicConstraintsValid: true,
PermittedDNSDomainsCritical: true,
// PermittedDNSDomains restricts the names in certificates issued from this root to *.testing.golang.invalid.
// The .invalid TLD is, per RFC 2606, reserved for testing, and as such anything issued for this certificate
// should never be valid in the real world.
PermittedDNSDomains: []string{"testing.golang.invalid"},
// ExcludedIPRanges prevents any certificate issued from this root that contains an IP address in both the full
// IPv4 and IPv6 ranges from being considered valid.
ExcludedIPRanges: []*net.IPNet{{IP: make([]byte, 4), Mask: make([]byte, 4)}, {IP: make([]byte, 16), Mask: make([]byte, 16)}},
KeyUsage: x509.KeyUsageCertSign,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
}
Ian Lance Taylor [Tue, 13 Jun 2023 16:46:50 +0000 (09:46 -0700)]
slices: consistently use S ~[]E
Make all functions use a constraint S ~[]E even if they don't return
the slice type. This makes explicitly instantiating the functions more
consistent: you don't have to remember which take ~[]E and which do not.
It also permits inferring the type when passing one of these functions
to some other function that is using a named slice type.
Fixes #60546
Change-Id: Ib3435255d0177fdbf03455ae527d08599b1ce012
Reviewed-on: https://go-review.googlesource.com/c/go/+/502955 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Axel Wagner <axel.wagner.hh@googlemail.com> Reviewed-by: Eli Bendersky <eliben@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Robert Griesemer [Tue, 13 Jun 2023 23:49:58 +0000 (16:49 -0700)]
spec: explain in which situations function type arguments can be omitted
Change-Id: I9f008dba7ba6e30f0e62647482a3ed0b51bc1ad0
Reviewed-on: https://go-review.googlesource.com/c/go/+/502997 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Achille Roussel [Sat, 10 Jun 2023 18:31:43 +0000 (11:31 -0700)]
net: fix panic when calling net.Listen or net.Dial on wasip1
Address a panic that was caused by net.Dial/net.Listen entering the fake
network stack and assuming that the addresses would be of type *TCPAddr,
where in fact they could have been *UDPAddr or *UnixAddr as well.
The fix consist in implementing the fake network facility for udp and
unix addresses, preventing the assumed type assertion to TCPAddr from
triggering a panic. New tests are added to verify that using the fake
network from the exported functions of the net package satisfies the
minimal requirement of being able to create a listener and establish a
connection for all the supported network types.
Fixes #60012
Fixes #60739
Change-Id: I2688f1a0a7c6c9894ad3d137a5d311192c77a9b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/502315 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Jes Cok [Tue, 13 Jun 2023 14:13:01 +0000 (14:13 +0000)]
internal/xcoff: remove blank lines after final return statements
Change-Id: I869ebcd9a134d0010e419dc51b6f91eddeaa0bbd
GitHub-Last-Rev: 0fc44edaeafcc2042e0fe57c8c41b4f60d4c478c
GitHub-Pull-Request: golang/go#60764
Reviewed-on: https://go-review.googlesource.com/c/go/+/502835 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: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Achille Roussel [Sat, 10 Jun 2023 20:13:05 +0000 (13:13 -0700)]
net: ensure net.Addr values match the connection type on wasip1
net.FileListener returns values of type *net.TCPListener, which can be
asserted by the application. The (*net.TCPListener).Addr method
documents that the underlying type of its return value is *net.TCPAddr,
which is fixed by this change.
Change-Id: Ife9906716d1b512092024ba50797bf7831536b75
Reviewed-on: https://go-review.googlesource.com/c/go/+/502335 Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Robert Griesemer [Tue, 13 Jun 2023 20:43:21 +0000 (13:43 -0700)]
go/types, types2: fix Hilbert test for stand-alone run
When run as a stand-alone test (without other tests running before),
the builtin function 'assert' (only available for testing) is missing.
Make sure it's declared.
This change only affects this test, when run stand-alone, as in:
go test -run Hilbert
Fixes #60774.
Change-Id: Ib07d97ba2670b839e8ad11ef50d0e6581bb3d79d
Reviewed-on: https://go-review.googlesource.com/c/go/+/502996
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Russ Cox [Tue, 6 Jun 2023 12:18:21 +0000 (08:18 -0400)]
cmd/dist: more robust cleanup
Identify generated files by name prefix (z*) and content
(^// Code generated by go tool dist)
instead of having a fixed list. This will be more robust
against doing make.bash and then rewinding git and
then doing make.bash again.
Russ Cox [Tue, 13 Jun 2023 02:56:23 +0000 (22:56 -0400)]
cmd/internal/obj: make aix/ppc64 builds reproducible
sort.Slice was being used to sort some newly added entries by name
to make the ctxt.Data slice reproducible, but some existing entries
have the same name, and the effect was to take the non-determinism
of the tail entries and scatter it into the earlier, deterministic section
when multiple entries had the same name.
The specific entries with the same name are type SDWARFVAR, which
all have an empty name but different relocations. If they are shuffled,
then the relocation symbols are visited in a different order, which
enters them into the string table in a different order, which results in
different object files, different object file hashes, and different build IDs
for the final executables.
Use sort.SliceStable to avoid reordering entries we don't mean to reorder.
Also add a simple test for scheduling-related non-determinism.
I debugged this originally using 'go install -race cmd/compile',
but that was slow and turned out not to be terribly reliable.
Using a few different GOMAXPROCS settings turns out to be a much more
effective (and faster) way to scramble scheduling decisions.
Eli Bendersky [Mon, 12 Jun 2023 16:00:26 +0000 (09:00 -0700)]
sort: comments directing new code to use the slices package when applicable
Change-Id: I0d4e902736fb3a75d128a088901055bece6c1a71
Reviewed-on: https://go-review.googlesource.com/c/go/+/502555
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eli Bendersky <eliben@google.com>
Auto-Submit: Eli Bendersky <eliben@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
Robert Griesemer [Mon, 12 Jun 2023 21:58:32 +0000 (14:58 -0700)]
spec: de-emphasize string(int) conversions
Fixes #60731.
Change-Id: I71fad1c8385b13d036bb0ce7ae6bd21e0f596e51
Reviewed-on: https://go-review.googlesource.com/c/go/+/502657 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Robert Griesemer [Wed, 7 Jun 2023 23:56:28 +0000 (16:56 -0700)]
spec: document new program initialization process
For #57411.
Change-Id: I94982d939d16ad17174f801cc167cc10ddc8da30
Reviewed-on: https://go-review.googlesource.com/c/go/+/501696 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Filippo Valsorda [Mon, 12 Jun 2023 16:58:50 +0000 (18:58 +0200)]
crypto/ecdsa: properly truncate P-521 hashes
Before, if a hash was exactly 66 bytes long, we weren't truncating it
for use with P-521, because the byte length was not overflowing.
However, the bit length could still overflow.
Eli Bendersky [Mon, 12 Jun 2023 16:05:33 +0000 (09:05 -0700)]
slices: add benchmark for IsSorted vs. IntsAreSorted
We'd like to mention in a comment that users should prefer
slices.IsSorted over sort.IntsAreSorted and similar
functions. Create a benchmark that shows this.
Russ Cox [Mon, 12 Jun 2023 20:11:35 +0000 (16:11 -0400)]
cmd/link: fix log formats for log.Fatal calls
link contains many calls to log.Fatal, but it uses the default log output
format, which is configured for server programs, not command-line tools.
Set it up for command-line tools instead.
Changes errors like
2023/06/12 14:32:24 reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi"
to
link: reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi"
Change-Id: I3565960408c03f2f499a7517ec18c01870eb166c
Reviewed-on: https://go-review.googlesource.com/c/go/+/502698
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Achille Roussel [Sat, 10 Jun 2023 19:44:21 +0000 (12:44 -0700)]
net: test net.FileConn and net.FileListener with UDP sockets on wasip1
The WASI specification has file types for both stream and datagram
sockets. This change refactors the internal implementation of the
net.FileConn and net.FileListener functions to avoid returning a
misleading ENOTSOCK when calling net.FileConn with a file referencing
a datagram socket and instead properly construct net.UDPConn values
or return EOPNOTSUPP otherwise.
Change-Id: I594f700847254895cd6ce172979fd89c4b851940
Reviewed-on: https://go-review.googlesource.com/c/go/+/502316 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Russ Cox [Mon, 12 Jun 2023 20:38:24 +0000 (16:38 -0400)]
cmd/dist: do not use user build cache in versioned trees
There is no guarantee that the user build cache will have
correct data if we are using a versioned build (with a VERSION file),
because that overrides the use of tool build IDs for staleness.
An earlier build might have run with a buggy compiler, and we don't
want those files lying around.
Bryan C. Mills [Mon, 12 Jun 2023 19:26:21 +0000 (15:26 -0400)]
cmd/go/internal/modload: address comment and test issues from CL 496635
Michael noticed some minor issues in backports of CL 496635.
Those issues have been addressed in the backport CLs; this change
applies them to the main branch as well.
Michael Matloob [Mon, 12 Jun 2023 16:33:30 +0000 (12:33 -0400)]
go/build: check for invalid import paths again
The go parser previously checked for invalid import paths, go/build,
seeing the parse error would put files with invalid import paths into
InvalidGoFiles. golang.org/cl/424855 removed that check from the
parser, which meant files with invalid import paths not have any parse
errors on them and not be put into InvalidGoFiles. Do a check for
invalid import paths in go/build soon after parsing so we can make
sure files with invalid import paths go into InvalidGoFiles.
This fixes an issue where the Go command assumed that if a file wasn't
invalid it had non empty import paths, leading to a panic.
Fixes #60230
Fixes #60686
Change-Id: I33c1dc9304649536834939cef7c689940236ee20
Reviewed-on: https://go-review.googlesource.com/c/go/+/502615 Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Robert Griesemer [Fri, 9 Jun 2023 00:04:06 +0000 (17:04 -0700)]
go/types, types2: use correct reverse inference approach
To infer type arguments in an assignment of the form
var target func(t1, t2, ...) = g
where g is a generic function
func g[P1, P2, ...](p1, p2, ...)
the type checker used the synthetic function call
g(t1, t2, ...)
But because each argument (of type) t1, t2, ... is assigned to its
corresponding parameter p1, p2, ..., type inference uses assignment
rules ("inexact match") for unification.
As a result, types such as mystring and string match even though
they should not (they are not identical), yet function parameter
types must be identical to match.
This CL fixes this by constructing the synthetic call
g'(func(t1, t2, ...))
where g' is the generic function
func g'[P1, P2, ...](func(p1, p2, ...))
This mimics the function assignment directly by representing it as
a single argument passing (of a function-typed argument). Function
parameter types must now be identical to unify.
As an added benefit, the implementation is simpler.
As a consequence, when such an assignment is invalid because the
function types cannot possibly match, we now correctly get an
inference error. Without this change, in some cases unification
would succeed, only to lead to an assignment error afterwards.
While at it, update the date in the copyright notice of
testdata/manual.go so we don't need to fix it each time we copy
code from a test case in manual.go into a issueXXXXX.go file.
Fixes #60688.
Change-Id: I716247f426ef33d76c7849b0c33c59124e55b859
Reviewed-on: https://go-review.googlesource.com/c/go/+/501938 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Robert Griesemer [Tue, 6 Jun 2023 21:30:31 +0000 (14:30 -0700)]
go/types, types2: use inexact unification when unifying against core types
Follow-up on CL 498955 which introduced a unification mode, to be used
to control the precision of unification of element types (CL 498895):
When unifying against core types of unbound type parameters, we must
use inexact unification at the top (irrespective of the unification mode),
otherwise it may fail when unifying against a defined type (core types
are always underlying types).
No specific test case (I have not been able to create one yet).
Change-Id: Ie15e98f4b9e9fb60d6857d34b03d350ebbf0375e
Reviewed-on: https://go-review.googlesource.com/c/go/+/501302
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Bryan C. Mills [Thu, 8 Jun 2023 21:55:55 +0000 (17:55 -0400)]
cmd/go: omit checksums for go.mod files needed for go version lines more often in pre-1.21 modules
This updates the logic from CL 489075 to avoid trying to save extra
sums if they aren't already expected to be present
and cfg.BuildMod != "mod" (as in the case of "go list -m -u all" with
a go.mod file that specifies go < 1.21).
Ian Lance Taylor [Sun, 11 Jun 2023 00:42:54 +0000 (17:42 -0700)]
net/url: correct field name in Redacted doc comment
Fixes #60716
Change-Id: I86037784d6c12fd22bd03c3efabef379fa0646aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/502355
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@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> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Dmitri Shuralyov [Sun, 11 Jun 2023 01:06:25 +0000 (21:06 -0400)]
doc/go1.21: add heading for cmp package
For #59488.
For #58645.
Change-Id: Ia9b76d49825dd74f7e52d829ec6d47e6c2addd76
Reviewed-on: https://go-review.googlesource.com/c/go/+/501825 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
Ian Lance Taylor [Sat, 10 Jun 2023 02:59:37 +0000 (19:59 -0700)]
cmp, builtin: document NaN behavior
Add notes for cmp.Ordered and builtin.{min,max}.
Fixes #60648
Change-Id: I81806af2d9a0613befde3f2bbfbc2720f0726912
Reviewed-on: https://go-review.googlesource.com/c/go/+/502235
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Tue, 6 Jun 2023 17:57:50 +0000 (10:57 -0700)]
context: fix doc tipo (s/timout/timeout)
Change-Id: Ib02b35887896eab418ba9dde764754538cb23b4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/501277 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Ian Lance Taylor <iant@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>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Jes Cok [Fri, 9 Jun 2023 11:41:39 +0000 (11:41 +0000)]
runtime: fix typos
Change-Id: If13f4d4bc545f78e3eb8c23cf2e63f0eb273d71f
GitHub-Last-Rev: 32ca70f52a5c3dd66f18535c5e595e66afb3903c
GitHub-Pull-Request: golang/go#60703
Reviewed-on: https://go-review.googlesource.com/c/go/+/502055 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
chenguoqi [Thu, 8 Jun 2023 06:04:26 +0000 (14:04 +0800)]
syscall: implement Ptrace{Set,Get}Regs using PTRACE_{GET,SET}REGSET on all linux platforms
In the ptrace system call, most of the newer architectures (e.g. arm64,riscv64,loong64)
do not provide support for the command PTRACE_{GET, SET}REGS.
The Linux kernel 2.6.33-rc7[1] introduces support for the command PTRACE_{GET,SET}REGSET,
which exports different types of register sets depending on the NT_* types, completely
overriding the functionality provided by PTRACE_{GET,SET}REGS.
Change-Id: I8c2671d64a7ecd654834740f4f1e1e50c00edcae
Reviewed-on: https://go-review.googlesource.com/c/go/+/501756
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>