]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 months agocmd/compile: add missing colon in debug log
Michael Pratt [Tue, 6 Feb 2024 20:37:51 +0000 (15:37 -0500)]
cmd/compile: add missing colon in debug log

Change-Id: Id76f4688a2ac45c1616d5c03274eec5d2108e555
Reviewed-on: https://go-review.googlesource.com/c/go/+/562156
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
14 months agodog/go1.22: tweak coverage testing notes
Than McIntosh [Mon, 5 Feb 2024 16:58:35 +0000 (11:58 -0500)]
dog/go1.22: tweak coverage testing notes

Clarify the section in the "go" command notes that deals with the
changes to "go test -cover" for packages without tests, adding a note
that if a package has not tests and no executable code, you still get
a "package has no test files" diagnostic.

Fixes #65262.

Change-Id: Ie960871f9d5c1a1965090738644eace28fc3e156
Reviewed-on: https://go-review.googlesource.com/c/go/+/561337
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chris Hines <chris.cs.guy@gmail.com>
14 months agoarchive/zip: reduce memory held by Writer.Copy
Jonathan Amsterdam [Sat, 3 Feb 2024 16:48:50 +0000 (11:48 -0500)]
archive/zip: reduce memory held by Writer.Copy

Make a copy of the argument File's FileHeader, and pass a pointer
to the copy to CreateRaw.

Passing the pointer directly causes the entire `File` to be referenced
by the receiver. The `File` includes a reference to the `ReaderAt`
underlying the `Reader`, so all its memory, which may be the entire
contents of the archive, is prevented from being garbage-collected.

Also, explain the issue in the doc comment for CreateRaw. We
cannot change its behavior because someone may depend on the
preserving the identity of its argument pointer.

For #65499.

Change-Id: Ieb4963a0ea30539d597547d3511accbd8c6b5c5a
Reviewed-on: https://go-review.googlesource.com/c/go/+/560238
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
14 months agocmd/compile: delete unused code and fix typo in comment
Jun10ng [Mon, 5 Feb 2024 17:12:17 +0000 (17:12 +0000)]
cmd/compile: delete unused code and fix typo in comment

Change-Id: Ia1f1c7d5563a74950c47cf3ebdcb600b34c83e85
GitHub-Last-Rev: bd58214e5e66e32c0055936820b8f0adf7f388c6
GitHub-Pull-Request: golang/go#65527
Reviewed-on: https://go-review.googlesource.com/c/go/+/561355
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

14 months agodoc/next: add release note file for api/next file
Jonathan Amsterdam [Mon, 5 Feb 2024 18:44:05 +0000 (13:44 -0500)]
doc/next: add release note file for api/next file

Change-Id: I3003968d9d7e543c25d4b0ab1d1cd924a1efd3ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/561456
Auto-Submit: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

14 months agogo/types, types2: bail early if we want a type but don't have one
Robert Griesemer [Tue, 30 Jan 2024 00:34:16 +0000 (16:34 -0800)]
go/types, types2: bail early if we want a type but don't have one

If we do know whether we need a type or not, make use of the
information when we know that we don't have a type and bail out.

Fixes the issue at hand and also improves some other error messages
which now report that we don't have a type instead of reporting a cycle.

For #65344.

Change-Id: I11182efd452c485d89e6c09ead8a647ea05d7318
Reviewed-on: https://go-review.googlesource.com/c/go/+/559335
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
14 months agogo/types, types2: ensure that Alias.actual is set in NewAlias
Rob Findley [Fri, 2 Feb 2024 23:26:06 +0000 (18:26 -0500)]
go/types, types2: ensure that Alias.actual is set in NewAlias

Types returned by the go/types API must be immutable (or at least
concurrency safe), but NewAlias returned an alias without actual set.

Ensure that actual is set by unaliasing. Also make some superficial
simplifications to unalias, and avoid indirection where unnecessary.

Fixes golang/go#65455

Change-Id: Ic9a020da5accf9032056a924b65c9e9e08cb2e0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/560915
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
14 months agocmd/compile: consistently use s.pp in genssa
Michael Pratt [Fri, 2 Feb 2024 18:30:15 +0000 (13:30 -0500)]
cmd/compile: consistently use s.pp in genssa

In genssa, s.pp == pp, so using either is equivalent, but use is
inconsistent. About half of the uses use s.pp and the other half use pp.

This gets confusing, especially when two different uses are right next
to each other, because it implies that these might be different.

Pick one and use it consistently.

Change-Id: Ifb1bb9332138d8cb62a45c212fcd7139f8511901
Reviewed-on: https://go-review.googlesource.com/c/go/+/560780
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

14 months agocmd/relnote: fix API relnote check
Jonathan Amsterdam [Thu, 1 Feb 2024 21:00:51 +0000 (16:00 -0500)]
cmd/relnote: fix API relnote check

Fix the check for release note files that correspond to API files
to look in the right directory, doc/next/*stdlib/*minor. Previously
the test looked in doc/next.

Improve the error messages when the test fails to explain the problem
better and refer to further documentation.

(These changes are actually in the x/build repo; this CL vendors
the latest version.)

Lastly, re-enable the check.

For #64169.

Change-Id: I8bba845e9bd12afbe269ce42d6d4b17b1e3c0252
Reviewed-on: https://go-review.googlesource.com/c/go/+/560516
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

14 months agoruntime/internal/atomic: add loong64 operators for And/Or
Mauri de Souza Meneguzzo [Wed, 24 Jan 2024 10:19:30 +0000 (10:19 +0000)]
runtime/internal/atomic: add loong64 operators for And/Or

These primitives will be used by the new And/Or sync/atomic apis.

For #61395

Change-Id: I64b2e599e4f91412e0342aa01f5fd53271e9a333
GitHub-Last-Rev: 9755db5406b84dd84fa5432382bfabc801a34ed3
GitHub-Pull-Request: golang/go#63314
Reviewed-on: https://go-review.googlesource.com/c/go/+/531895
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
14 months agocmd/go: fix tests that fail when running a cross-compiled GOARCH
Bryan C. Mills [Thu, 1 Feb 2024 20:56:05 +0000 (15:56 -0500)]
cmd/go: fix tests that fail when running a cross-compiled GOARCH

In CL 356611 I changed cmd/go to run most of its tests (instead of
skipping them all) when cross-compiled, such as with GOARCH=386 on an
amd64 host. Unfortunately, since we don't have a CI builder that runs
long tests in a cross-compiled configuration, some of the tests have
rotted since then.

This fixes 'GOARCH=386 go test cmd/go' on my workstation.

For #64963.
Updates #53936.

Change-Id: If7f4bc8e8d1ace7d36010d7a1b652fc7b2ceb276
Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/560782
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
15 months agogo/internal/gccgoimporter: recognize "any" as a builtin type
Ian Lance Taylor [Mon, 23 Oct 2023 21:32:44 +0000 (14:32 -0700)]
go/internal/gccgoimporter: recognize "any" as a builtin type

In CL 536715 we're changing the gofrontend export data to report
"any" as a builtin type. This permits us to distinguish the builtin
type from some other package-level type "any". That requires an update
to this code.

Change-Id: I91d75a056a155fa9892c4b25ab396cb4d39cc8e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/537195
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agocmd/compile: avoid reading entire PGO profile just to check the header
Michael Pratt [Wed, 31 Jan 2024 22:56:47 +0000 (17:56 -0500)]
cmd/compile: avoid reading entire PGO profile just to check the header

isPreProfileFile reads the entire file into memory just to check the
first few bytes, and then throws it all away. We can avoid this by just
peeking at the beginning.

For #58102.

Change-Id: Id2c2844e5e44a2f3a9c7cdb9a027d94d26bdf71d
Reviewed-on: https://go-review.googlesource.com/c/go/+/560035
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

15 months agoruntime: initialize crashFD to -1
Michael Pratt [Fri, 2 Feb 2024 18:00:02 +0000 (13:00 -0500)]
runtime: initialize crashFD to -1

crashFD defaults to the zero value of (surprise!) zero. Zero is a valid
FD, so on the first call to SetCrashOutput we actually close FD 0 since
it is a "valid" FD.

Initialize crashFD to -1, the sentinel for "no FD".

Change-Id: I3b108c60603f2b83b867cbe079f035c159b6a6ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/560776
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agolib/time: update to 2024a/2024a
Dmitri Shuralyov [Thu, 1 Feb 2024 21:55:50 +0000 (16:55 -0500)]
lib/time: update to 2024a/2024a

Commit generated by update.bash.

For #22487.

Change-Id: I1c46ec1f3a84e385f8eab2c4c9a14d3513a85a44
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/560517
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
15 months agoruntime/debug: add Example of SetCrashOutput in a crash monitor
Alan Donovan [Fri, 8 Dec 2023 22:03:46 +0000 (17:03 -0500)]
runtime/debug: add Example of SetCrashOutput in a crash monitor

Updates #42888

Change-Id: I72e408301e17b1579bbea189bed6b1a0154bd55f
Reviewed-on: https://go-review.googlesource.com/c/go/+/548121
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/compile/internal: fix function names
cui fliter [Fri, 2 Feb 2024 09:30:03 +0000 (17:30 +0800)]
cmd/compile/internal: fix function names

Change-Id: Id9103aa4bda221f5eb34a0ede8676364c574b696
Reviewed-on: https://go-review.googlesource.com/c/go/+/560616
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
15 months agocmd/link/internal/dwtest: fix inconsistent receiver name
cui fliter [Mon, 8 Jan 2024 13:55:30 +0000 (21:55 +0800)]
cmd/link/internal/dwtest: fix inconsistent receiver name

The DIEs method of Examiner is the only one with a receiver declared 'e'; all the rest have 'ex'. Fix it to be consistent.

Change-Id: I494a53cf3db5575d45831cab3cf612c20962f8fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/554575
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

15 months agoRevert "cmd/go: add telemetry counters for flag names and subcommand"
Quim Muntal [Fri, 2 Feb 2024 13:30:55 +0000 (13:30 +0000)]
Revert "cmd/go: add telemetry counters for flag names and subcommand"

This reverts CL 559519.

Reason for revert: Broke windows/386. See https://build.golang.org/log/03594b706c425bd61fb3c65495aae6dd01b4a81b.

Fixes #65447.

Change-Id: I567bca0368168dbfb256fadba37bce3cd31aceb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/560655
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
15 months agocmd/go: add telemetry counters for flag names and subcommand
Michael Matloob [Tue, 30 Jan 2024 21:47:34 +0000 (16:47 -0500)]
cmd/go: add telemetry counters for flag names and subcommand

For #58894

Change-Id: I6b5d5b14be9858f5855eeac0110aa44e762cee03
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/559519
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agocmd: update golang.org/x/telemetry to 1cb064e and vendor it
Michael Matloob [Wed, 31 Jan 2024 16:17:58 +0000 (11:17 -0500)]
cmd: update golang.org/x/telemetry to 1cb064e and vendor it

This brings in CL 559505 which adds a stub for counter.CountFlags so
it can be depended on and still build on Go 1.18 and earlier. This
will allow the go command to use counter.CountFlags and still be able
to build as the bootstrap command with an earlier version of Go.

For #58894

Change-Id: I31d5b96bd47eef2e407ef97e6146adece403f2c0
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/559795
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/go: fix build config before creating actions for 'go list -cover'
Ehden Sinai [Thu, 1 Feb 2024 18:38:56 +0000 (13:38 -0500)]
cmd/go: fix build config before creating actions for 'go list -cover'

When -covermode is set to atomic, instrumented packages need to import
sync/atomic. If this is not already imported by a package being
instrumented, the build needs to ensure that sync/atomic is compiled
whenever 'go list' is run in a way that triggers package builds.

The build config was already being made to ensure the import, but only
after the action graph had been created, so there was no guarantee that
sync/atomic would be built when needed.

Fixes #65264.

Change-Id: Ib3f1e102ce2ef554ea08330d9db69a8c98790ac5
Reviewed-on: https://go-review.googlesource.com/c/go/+/560236
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
15 months agoruntime: traceAcquire and traceRelease across all P steals
Michael Anthony Knyszek [Thu, 1 Feb 2024 05:32:03 +0000 (05:32 +0000)]
runtime: traceAcquire and traceRelease across all P steals

Currently there are a few places where a P can get stolen where the
runtime doesn't traceAcquire and traceRelease across the steal itself.
What can happen then is the following scenario:
- Thread 1 enters a syscall and writes an event about it.
- Thread 2 steals Thread 1's P.
- Thread 1 exits the syscall and writes one or more events about it.
- Tracing ends (trace.gen is set to 0).
- Thread 2 checks to see if it should write an event for the P it just
  stole, sees that tracing is disabled, and doesn't.

This results in broken traces, because there's a missing ProcSteal
event. The parser always waits for a ProcSteal to advance a
GoSyscallEndBlocked event, and in this case, it never comes.

Fixes #65181.

Change-Id: I437629499bb7669bf7fe2fc6fc4f64c53002916b
Reviewed-on: https://go-review.googlesource.com/c/go/+/560235
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoruntime: clear trace map without write barriers
Michael Anthony Knyszek [Thu, 1 Feb 2024 05:10:32 +0000 (05:10 +0000)]
runtime: clear trace map without write barriers

Currently the trace map is cleared with an assignment, but this ends up
invoking write barriers. Theoretically, write barriers could try to
write a trace event and eventually try to acquire the same lock. The
static lock ranking expresses this constraint.

This change replaces the assignment with a call to memclrNoHeapPointer
to clear the map, removing the write barriers.

Note that technically this problem is purely theoretical. The way the
trace maps are used today is such that reset is only ever called when
the tracer is no longer writing events that could emit data into a map.
Furthermore, reset is never called from an event-writing context.

Therefore another way to resolve this is to simply not hold the trace
map lock over the reset operation. However, this makes the trace map
implementation less robust because it needs to be used in a very
specific way. Furthermore, the rest of the trace map code avoids write
barriers already since its internal structures are all notinheap, so
it's actually more consistent to just avoid write barriers in the reset
method.

Fixes #56554.

Change-Id: Icd86472e75e25161b2c10c1c8aaae2c2fed4f67f
Reviewed-on: https://go-review.googlesource.com/c/go/+/560216
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoruntime: model wakeableSleep.lock in the race detector
Michael Anthony Knyszek [Thu, 1 Feb 2024 04:47:22 +0000 (04:47 +0000)]
runtime: model wakeableSleep.lock in the race detector

Currently the flight recorder tests are failing in race mode because the
race detector doesn't see s.lock, leading to false positives. This has
also appeared in the trace tests. Model the lock in the race detector.

Fixes #65207.
Fixes #65283.

Change-Id: I1e9a5c9606536f55fdfc46b5f8443e9c7213c23d
Reviewed-on: https://go-review.googlesource.com/c/go/+/560215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
15 months agoruntime: fix trace EvGoStop Gosched reason to match function
Michael Anthony Knyszek [Thu, 21 Dec 2023 20:26:38 +0000 (20:26 +0000)]
runtime: fix trace EvGoStop Gosched reason to match function

Currently the stop reason for runtime.Gosched is labeled
"runtime.GoSched" which doesn't actually match the function name. Fix
the label to match the function name.

This change doesn't regenerate the internal/trace/v2 tests, because
regenerating the tests breaks summarization tests in internal/trace that
rely on very specific details in the example traces that aren't
guaranteed. Also, go122-gc-trace.test isn't generated at all, as it
turns out. I'll fix this all up in a follow-up CL. For now, just replace
runtime.GoSched with runtime.Gosched in the traces so we don't have a
problem later if a test wants to look for that string.

This change does regenerate the cmd/trace/v2 test, but it turns out the
cmd/trace/v2 tests are way too strict about network unblock events, and
3 usually pop up instead of 1 or 2, which is what the test expects.
AFAICT this looks plausible to me, so just lift the restriction on
"up to 2" events entirely.

Change-Id: Id7350132be19119c743c259f2f5250903bf41a04
Reviewed-on: https://go-review.googlesource.com/c/go/+/552275
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
15 months agocmd/go: limit GOMAXPROCS in TestScript/test_fuzz_.*
Bryan C. Mills [Thu, 1 Feb 2024 18:53:46 +0000 (13:53 -0500)]
cmd/go: limit GOMAXPROCS in TestScript/test_fuzz_.*

This limits the throughput and resource consumption of the fuzz
workers in the tests, which also reduces the likelihood of running out
of address space in the fuzz coordinator during the test.

(Ideally the coordinator should not be limited by address space;
this just works around the failure mode in the tests for now.)

For #65434.

Change-Id: I3086c6278d6803a3dbf17a46ed01b68cedc92ad9
Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/560515
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agosync: update doc for Map.Clear
Jes Cok [Thu, 1 Feb 2024 16:28:07 +0000 (16:28 +0000)]
sync: update doc for Map.Clear

Change-Id: I9bcc5c82321cbc93f1c7aafd1dadf4f6b862ccbd
GitHub-Last-Rev: 818b95528f6beb6178b385953b49fbfbaeb31a82
GitHub-Pull-Request: golang/go#65429
Reviewed-on: https://go-review.googlesource.com/c/go/+/560396
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoruntime: make netpollBreak entries identifiable on Windows
qmuntal [Fri, 26 Jan 2024 16:57:39 +0000 (17:57 +0100)]
runtime: make netpollBreak entries identifiable on Windows

It is currently not possible to distinguish between a netpollBreak
entry and an entry initiated by external WSA operations (as in #58870).

This CL sets a unique completion key when posting the
netpollBreak entry so that it can be identified as such.

Change-Id: I8e74a7ddc607dc215d6ed8c59d5c3cf47ec8dc62
Reviewed-on: https://go-review.googlesource.com/c/go/+/558895
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
15 months agoRevert "runtime: preempt more aggressively when panicking"
Michael Pratt [Thu, 1 Feb 2024 17:14:41 +0000 (12:14 -0500)]
Revert "runtime: preempt more aggressively when panicking"

This reverts CL 546135.

Reason for revert: Causes occasional throw during panic

For #65416.

Change-Id: I78c15637da18f85ede785363b777aa7d1dead3c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/560455
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agosync: add Map.Clear
Hiro [Wed, 3 Jan 2024 00:10:58 +0000 (00:10 +0000)]
sync: add Map.Clear

Fixes #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 17bedc864f1685178a42b59f7083677a6124f831
GitHub-Pull-Request: golang/go#61702
Reviewed-on: https://go-review.googlesource.com/c/go/+/515015
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agointernal/profile: remove legacy profile support
Michael Pratt [Wed, 6 Dec 2023 19:20:49 +0000 (14:20 -0500)]
internal/profile: remove legacy profile support

internal/profile.Parse is only used in two places: cmd/compile for
parsing PGO profiles, and net/http/pprof for parsing runtime/pprof
profiles for delta profiles. Neither case ever encounters legacy
profiles, so we can remove support entirely from the package.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest

Change-Id: Ic5f85b3fc1e1367131b6039dac9378913cbf9f2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/548035
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agocmd/preprofile: Implement a tool to preprocess the PGO profile.
Jin Lin [Wed, 24 Jan 2024 03:40:38 +0000 (19:40 -0800)]
cmd/preprofile: Implement a tool to preprocess the PGO profile.

It fixes the issue https://github.com/golang/go/issues/65220.
It also includes  https://go.dev/cl/557458 from Michael.

Change-Id: Ic6109e1b6a9045459ff4a54dea11cbfe732b01e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/557918
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agodoc/go1.22: move go/version package mention into a separate heading
Dmitri Shuralyov [Wed, 31 Jan 2024 18:30:50 +0000 (13:30 -0500)]
doc/go1.22: move go/version package mention into a separate heading

It's a new package in the standard library,
not a minor change to an existing package.

For #62039.
For #61422.

Change-Id: I7488304cd2bd6353f535cab192d015796840ba4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/559799
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
15 months agocontainer/heap: remove confusing claim of memory leak
codesoap [Wed, 31 Jan 2024 18:31:56 +0000 (18:31 +0000)]
container/heap: remove confusing claim of memory leak

The term "memory leak" was misused here, as the memory is still referenced
by the slice.

Fixes #65403

Change-Id: Id102419d4c798fb2a4ec8be86be9ec9b5cdd98e6
GitHub-Last-Rev: 3febcd0ba4ab5897bef8f2d7ded594ef09932771
GitHub-Pull-Request: golang/go#65404
Reviewed-on: https://go-review.googlesource.com/c/go/+/559775
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agogo/token: correct out-of-bounds token offsets and positions
Robert Griesemer [Wed, 31 Jan 2024 01:16:12 +0000 (17:16 -0800)]
go/token: correct out-of-bounds token offsets and positions

Per the discussion on the issue, make methods that depend on
incoming offsets or positions tolerant in the presence of
out-of-bounds values by adjusting the values as needed.

Add an internal flag debug that can be set to enable the old
(not fault-tolerant) behavior.

Fixes #57490.

Change-Id: I8a7d422b9fd1d6f0980fd4e64da2f0489056d71e
Reviewed-on: https://go-review.googlesource.com/c/go/+/559436
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
15 months agogo/version: fix package to accept go1.21.0-bigcorp
Russ Cox [Wed, 24 Jan 2024 21:29:20 +0000 (16:29 -0500)]
go/version: fix package to accept go1.21.0-bigcorp

The proposal discussion made clear that suffixes should be accepted,
so that people who use custom VERSION files can still pass runtime.Version()
to this code. But we forgot to do that in the CL. Do that.

Note that cmd/go also strips space- and tab-prefixed suffixes,
but go.dev/doc/toolchain only mentions dash, so this code only
strips dash.

Fixes #65061.

Change-Id: I6a427b78f964eb41c024890dae30223beaef13eb
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/559796
TryBot-Bypass: Russ Cox <rsc@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agoapi/README: refer to doc/README.md
Jonathan Amsterdam [Wed, 31 Jan 2024 15:36:52 +0000 (10:36 -0500)]
api/README: refer to doc/README.md

For #64169.

Change-Id: I0fc6d6a041ad48957f4aecd18b85c9098fc9b403
Reviewed-on: https://go-review.googlesource.com/c/go/+/559755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
15 months agoruntime/debug: SetCrashOutput sets the FD for fatal panics
Alan Donovan [Thu, 7 Dec 2023 23:02:40 +0000 (18:02 -0500)]
runtime/debug: SetCrashOutput sets the FD for fatal panics

This feature makes it possible to record unhandled panics
in any goroutine through a watchdog process (e.g. the same
application forked+exec'd as a child in a special mode)
that can process the panic report, for example by sending
it to a crash-reporting system such as Go telemetry
or Sentry.

Fixes #42888

Change-Id: I5aa7be8f726bbc70fc650540bd1a14ab60c62ecb
Reviewed-on: https://go-review.googlesource.com/c/go/+/547978
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
15 months agoruntime: preempt more aggressively when panicking
Cherry Mui [Thu, 30 Nov 2023 00:17:22 +0000 (19:17 -0500)]
runtime: preempt more aggressively when panicking

When we are crashing from an unrecovered panic, we freeze the
world, and print stack traces for all goroutines if GOTRACEBACK is
set to a high enough level. Freezing the world is best effort, so
there could still be goroutines that are not preempted, and so its
stack trace is unavailable and printed as "goroutine running on
other thread".

As we're crashing and not resuming execution on preempted
goroutines, we can make preemption more aggressive, preempting
cases that are not safe for resumption or stack scanning. This may
make goroutines more likely to be preempted in freezing the world
and have their stacks available.

Change-Id: Ie16269e2a05e007efa61368b695addc28d7a97ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/546135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
15 months agofmt: update docs for %03s
Russ Cox [Mon, 29 Jan 2024 17:14:55 +0000 (12:14 -0500)]
fmt: update docs for %03s

%03s zero-pads a string with spaces; always has and now always will.

Fixes #56486.

Change-Id: Ia336581ae7db1c3456699e69e14a3071f50c9f2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/559197
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agofmt: revert "don't pad strings with zeros"
Russ Cox [Mon, 29 Jan 2024 17:00:10 +0000 (12:00 -0500)]
fmt: revert "don't pad strings with zeros"

This reverts CL 555776 (commit 704401ffa06).
Scores of tests break inside Google, and there was a test for the old behavior,
so clearly we thought it was correct at one point.

An example of code that broke inside Google is:

func (pn ProjectNumber) PaddedHexString() string {
return fmt.Sprintf("%016s", strconv.FormatInt(int64(pn), 16))
}

Here is another example:

// IPv4toISO create ISO address base on a given IPv4 address.
func IPv4toISO(v4 string) (string, error) {
if net.ParseIP(v4).To4() == nil {
return "", fmt.Errorf("invalid IPv4 address")
}
s := strings.Split(v4, ".")
var ss string
for _, n := range s {
ss = ss + fmt.Sprintf("%03s", n)
}
if len(ss) != 12 {
return "", fmt.Errorf("invalid IPv4 address")
}
return fmt.Sprint("49.0001." + ss[0:4] + "." + ss[4:8] + "." + ss[8:12] + ".00"), nil
}

This is doing the weird but apparently standard conversion from
IPv4 to ISO ISIS Area 1 (see for example [1]).

Here is an example from github.com/netbirdio/netbird:

func generateNewToken() (string, string, error) {
secret, err := b.Random(PATSecretLength)
if err != nil {
return "", "", err
}

checksum := crc32.ChecksumIEEE([]byte(secret))
encodedChecksum := base62.Encode(checksum)
paddedChecksum := fmt.Sprintf("%06s", encodedChecksum)
plainToken := PATPrefix + secret + paddedChecksum
hashedToken := sha256.Sum256([]byte(plainToken))
encodedHashedToken := b64.StdEncoding.EncodeToString(hashedToken[:])
return encodedHashedToken, plainToken, nil
}

base62.Encode returns a string no leading zeros; the %06s adds leading zeros.

Are there other ways to write these examples? Yes.
Has all this code worked until now? Also yes.

The change to this behavior observed that right padding doesn't
add zeros, only left padding, but that makes sense: in numbers
without decimal points, zeros on the left preserve the value
while zeros on the right change it.

Since we agree that this case is probably not important either way,
preserve the long-time behavior of %0s.

Will document it in a followup CL: this is a clean revert.

Reopen #56486.

[1] https://community.cisco.com/t5/routing/isis-net-address-configuration/m-p/1338984/highlight/true#M127827

Change-Id: Ie7dd35227f46933ccc9bfa1eac5fa8608f6d1918
Reviewed-on: https://go-review.googlesource.com/c/go/+/559196
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agonet/textproto: reject HTTP requests with empty header keys
Andy Pan [Wed, 24 Jan 2024 03:22:14 +0000 (11:22 +0800)]
net/textproto: reject HTTP requests with empty header keys

According to RFC 7230, empty field names in HTTP header are invalid.
However, there are no specific instructions for developers to deal
with that kind of case in the specification. CL 11242 chose to skip
it and do nothing about it, which now seems like a bad idea because
it has led `net/http` to behave inconsistently with the most widely-used
HTTP implementations: Apache, Nginx, Node with llhttp, H2O, Lighttpd, etc.
in the case of empty header keys.

There is a very small chance that this CL will break a few existing HTTP clients.

Fixes #65244

Change-Id: Ie01e9a6693d27caea4d81d1539345cf42b225535
Reviewed-on: https://go-review.googlesource.com/c/go/+/558095
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agospec: clarify iteration variable type for range over integer
Robert Griesemer [Mon, 22 Jan 2024 23:46:01 +0000 (15:46 -0800)]
spec: clarify iteration variable type for range over integer

Also: report language version (plus date) in spec header.

Fixes #65137.

Change-Id: I4f1d220d5922c40a36264df2d0a7bb7cd0756bac
Reviewed-on: https://go-review.googlesource.com/c/go/+/557596
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
15 months agocmd: vendor golang.org/x/telemetry and call counter.Open in cmd/go
Michael Matloob [Mon, 29 Jan 2024 18:52:11 +0000 (13:52 -0500)]
cmd: vendor golang.org/x/telemetry and call counter.Open in cmd/go

This change vendors golang.org/x/telemetry and calls counter.Open in
cmd/go right at the beginning.

For #58894

Change-Id: Iae56328440614b213c1429972e6f68f22c2112cd
Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-windows-amd64-longtest,gotip-linux-amd64-longtest-race
Reviewed-on: https://go-review.googlesource.com/c/go/+/559199
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/link: fix TestConsistentGoKindAndRuntimeType
Alessandro Arzilli [Tue, 30 Jan 2024 16:28:35 +0000 (17:28 +0100)]
cmd/link: fix TestConsistentGoKindAndRuntimeType

Fixes TestConsistentGoKindAndRuntimeType broken by b89ad46, go.dev/cl/558275

Change-Id: Ia07a1bae3c74a1196f1d3f97136dc24a0b795fb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/559575
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agolog/slog: add missing test in value_test.go
pgxiaolianzi [Tue, 30 Jan 2024 16:05:21 +0000 (16:05 +0000)]
log/slog: add missing test in value_test.go

TestValueEqual: Added test cases for DurationValue, StringValue, and TimeValue types.

TestValueAny: Added a test case for string values.

Change-Id: I74ef15bcfcacd0bf5d990debd24846283edf1ecd
GitHub-Last-Rev: 6adb9f6f3147f0c655789b3bc86336a5c89a1b44
GitHub-Pull-Request: golang/go#65303
Reviewed-on: https://go-review.googlesource.com/c/go/+/558755
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoall: fix typos
Jes Cok [Tue, 30 Jan 2024 15:19:54 +0000 (15:19 +0000)]
all: fix typos

Found by codespell.

Change-Id: I2ebefbbbc8eacf9bc83051407519fa8fd5e4495f
GitHub-Last-Rev: 9cc550f3dbd7c85194a58fd6858507db3e2962a9
GitHub-Pull-Request: golang/go#65346
Reviewed-on: https://go-review.googlesource.com/c/go/+/559095
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
15 months agodoc/README: clarify instructions
Alan Donovan [Fri, 26 Jan 2024 16:19:22 +0000 (11:19 -0500)]
doc/README: clarify instructions

- State that new markdown files belong in doc/next.
- Give hints on correct markdown syntax.

For #64169

Change-Id: Ied70e7ac443530c910eea2992ca6e303bbc10499
Reviewed-on: https://go-review.googlesource.com/c/go/+/558855
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
15 months agoruntime: compute data and bss root work units in one loop
jeffery [Wed, 24 Jan 2024 14:45:06 +0000 (14:45 +0000)]
runtime: compute data and bss root work units in one loop

Change-Id: Ia730ca244c83db925879de206809938aeb969cdd
GitHub-Last-Rev: 711b8b8b935552eea6136242821444e83fc23d38
GitHub-Pull-Request: golang/go#64349
Reviewed-on: https://go-review.googlesource.com/c/go/+/544478
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
15 months agocmd/compile/internal/noder: preserve alias uses in export data
Matthew Dempsky [Thu, 25 Jan 2024 23:51:22 +0000 (15:51 -0800)]
cmd/compile/internal/noder: preserve alias uses in export data

This CL changes the export data format to preserve alias uses.
Previously they were stripped away with types2.Unalias. For backwards
compatibility, we use pkgbits.TypeNamed, which is already used for the
predeclared aliases byte, rune, and any.

While here, remove unnecessary uses of types2.Unalias, and add a
missing one in recvBase to handle:

    type T int
    type A = T
    func (*A) m() {}

Change-Id: I62ddb0426080a44436054964a90ab250bcd8df12
Reviewed-on: https://go-review.googlesource.com/c/go/+/558577
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoruntime: print exported methods from the runtime in tracebacks
Keith Randall [Mon, 3 Jul 2023 20:49:26 +0000 (13:49 -0700)]
runtime: print exported methods from the runtime in tracebacks

We currently suppress runtime frames in tracebacks, except for
exported functions.
This CL also prints exported methods of exported types
in tracebacks, for consistency.

Change-Id: Ic65e7611621f0b210de5ae0c02b9d0a044f39fd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/507736
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
15 months agoruntime: avoid new linkname for goroutine profiles
Michael Pratt [Tue, 30 Jan 2024 16:01:05 +0000 (11:01 -0500)]
runtime: avoid new linkname for goroutine profiles

CL 464349 added a new linkname to provide gcount to runtime/pprof to
avoid a STW when estimating the goroutine profile allocation size.

However, adding a linkname here isn't necessary for a few reasons:

1. We already export gcount via NumGoroutines. I completely forgot about
   this during review.
2. aktau suggested that goroutineProfileWithLabelsConcurrent return
   gcount as a fast path estimate when the input is empty.

The second point keeps the code cleaner overall, so I've done that.

For #54014.

Change-Id: I6cb0811a769c805e269b55774cdd43509854078e
Reviewed-on: https://go-review.googlesource.com/c/go/+/559515
Auto-Submit: Michael Pratt <mpratt@google.com>
Auto-Submit: Nicolas Hillegeer <aktau@google.com>
Reviewed-by: Nicolas Hillegeer <aktau@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/link: add DW_AT_go_runtime_type to unsafe.Pointer and fix it for
Alessandro Arzilli [Wed, 24 Jan 2024 17:10:47 +0000 (18:10 +0100)]
cmd/link: add DW_AT_go_runtime_type to unsafe.Pointer and fix it for
uintptr

Adds the DW_AT_go_runtime_type attribute to the debug_info entry for
unsafe.Pointer (which is special) and fixes the debug_info entry of
uintptr so that its DW_AT_go_runtime_type attribute has the proper
class (it was accidentally using DW_CLS_ADDRESS instead of
DW_CLS_GO_TYPEREF)

Change-Id: I52e18593935fbda9bc425e849f4c7f50e9144ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/558275
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
15 months agointernal/zstd: avoid panic when windowSize is negative
aimuz [Sat, 18 Nov 2023 04:16:04 +0000 (04:16 +0000)]
internal/zstd: avoid panic when windowSize is negative

This change fixes an edge case in the zstd decompressor where
an int conversion could result in a negative window size.

Fixes #63979
For #62513

Change-Id: Ie714bf8fb51fa509b310deb8bd2c96bd87b52852
GitHub-Last-Rev: ab0be6578247da896f16d85e102b81994b8ee5c4
GitHub-Pull-Request: golang/go#63980
Reviewed-on: https://go-review.googlesource.com/c/go/+/540415
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: M Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: M Zhuo <mengzhuo1203@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

15 months agoRevert "runtime: disable use of runnext on wasm"
Michael Pratt [Mon, 29 Jan 2024 23:57:14 +0000 (23:57 +0000)]
Revert "runtime: disable use of runnext on wasm"

This reverts CL 557437.

Reason for revert: Appears to have broken wasip1 builders.

For #65178.

Change-Id: I59c1a310eb56589c768536fe444c1efaf862f8b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/559237
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
15 months agoruntime: reduce one STW when obtaining goroutine configuration file
Jun10ng [Sat, 27 Jan 2024 11:53:43 +0000 (11:53 +0000)]
runtime: reduce one STW when obtaining goroutine configuration file

Fixes #54014

Change-Id: If4ee2752008729e1ed4b767cfda52effdcec4959
GitHub-Last-Rev: 5ce300bf5128f842604d85d5f8749027c8e091c2
GitHub-Pull-Request: golang/go#58239
Reviewed-on: https://go-review.googlesource.com/c/go/+/464349
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
15 months agoruntime: disable use of runnext on wasm
Michael Pratt [Mon, 22 Jan 2024 22:50:44 +0000 (17:50 -0500)]
runtime: disable use of runnext on wasm

When readying a goroutine, the scheduler typically places the readied
goroutine in pp.runnext, which will typically be the next goroutine to
run in the schedule.

In order to prevent a set of ping-pong goroutines from simply switching
back and forth via runnext and starving the rest of the run queue, a
goroutine scheduled via runnext shares a time slice (pp.schedtick) with
the previous goroutine.

sysmon detects "long-running goroutines", which really means Ps using
the same pp.schedtick for too long, and preempts them to allow the rest
of the run queue to run. Thus this avoids starvation via runnext.

However, wasm has no threads, and thus no sysmon. Without sysmon to
preempt, the possibility for starvation returns. Avoid this by disabling
runnext entirely on wasm. This means that readied goroutines always go
on the end of the run queue and thus cannot starve via runnext.

Note that this CL doesn't do anything about single long-running
goroutines. Without sysmon to preempt them, a single goroutine that
fails to yield will starve the run queue indefinitely.

For #65178.

Cq-Include-Trybots: luci.golang.try:gotip-js-wasm,gotip-wasip1-wasm_wasmtime,gotip-wasip1-wasm_wazero
Change-Id: I7dffe1e72c6586474186b72f8068cff77b661eae
Reviewed-on: https://go-review.googlesource.com/c/go/+/557437
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agonet/http: allow nothingWrittenError in TestTransportPersistConnReadLoopEOF
Michael Pratt [Thu, 25 Jan 2024 20:39:09 +0000 (15:39 -0500)]
net/http: allow nothingWrittenError in TestTransportPersistConnReadLoopEOF

Flakes in #64317 are a result of a race where the server shutdown
schedules ahead of the client read loop. Normal network latency usually
hides this, but wasm's net_fake.go has very low latency.

Explicitly allow the results of this race in the test.

For #64317.

Change-Id: I9c2572fb44643762fe3f3d7cb133d7e7a8a47881
Reviewed-on: https://go-review.googlesource.com/c/go/+/558595
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

15 months agonet: in the fake implementation, allow writes to buffer on closed connections
Bryan C. Mills [Fri, 26 Jan 2024 17:23:01 +0000 (12:23 -0500)]
net: in the fake implementation, allow writes to buffer on closed connections

This mimics the apparent behavior of writes on linux/amd64, in which a
write on an already-closed connection silently succeeds — even if the
connection has already been closed by the remote end — provided that
the packet fits in the kernel's send buffer.

I tested this by patching in CL 557437 and running the test on js/wasm
and wasip1/wasm locally.

Fixes #64317.

Change-Id: I43f6a89e5059115cb61e4ffc33a8371057cb67a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/558915
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/go/internal/generate: call modload.InitWorkFile
Michael Matloob [Mon, 29 Jan 2024 16:14:05 +0000 (11:14 -0500)]
cmd/go/internal/generate: call modload.InitWorkFile

This is necessary for go generate to enter workspace mode for
recognizing package paths in the workspace.

Fixes #56098

Change-Id: I25f68de24f4189259353f63194823516e9d3d505
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/559195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agocmd/go/internal/list: make a copy of the package before zeroing fields
Michael Matloob [Wed, 3 Jan 2024 19:23:49 +0000 (14:23 -0500)]
cmd/go/internal/list: make a copy of the package before zeroing fields

go list -json=<fields> zeroes out the fields in the package struct
that aren't specified. The problem with this is that some of the fields
have references into other fields: specifically, the NoGoError's
Error() function accesses the package struct's Dir field, so if we
clear it out the error will just print out "no Go files in" without a
directory. Instead, make a copy of the package struct before we zero
out the fields so the original values are still there.

For #64946

Change-Id: I95103e91fa0782bb23a86a965d5eb87cb12654c6
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/553795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agocmd/go: allow test caching for the -fullpath flag
Raghvender [Mon, 11 Dec 2023 21:41:45 +0000 (15:41 -0600)]
cmd/go: allow test caching for the -fullpath flag

Change-Id: I5662b8ff617772ca2afec8bf419c468a3e69c392
Reviewed-on: https://go-review.googlesource.com/c/go/+/548996
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

15 months agocmd/go/internal/toolchain: apply the -modcacherw flag when downloading a module to...
Bryan C. Mills [Thu, 11 Jan 2024 20:00:17 +0000 (15:00 -0500)]
cmd/go/internal/toolchain: apply the -modcacherw flag when downloading a module to determine what toolchain it needs

Fixes #64282.

Change-Id: I3f211c599ee70cb58254d0bc07eeb3c135124e58
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/555436
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
15 months agocmd/go/internal/load: improve comments
sivchari [Tue, 1 Aug 2023 05:00:52 +0000 (05:00 +0000)]
cmd/go/internal/load: improve comments

isTestFunc checked whether the parameter type is B, M or T before the version of Go1.17.
But, after Go1.18, isTestFunc checks F, too.

Change-Id: I30bc97c2b8f2974bc9ae4df2f32dc8dce760d7d6
GitHub-Last-Rev: 507d5b1f74b2f2d0a75d61fe169cc0cc40d132c0
GitHub-Pull-Request: golang/go#56127
Reviewed-on: https://go-review.googlesource.com/c/go/+/441835
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoruntime: crash stack support for loong64
Mauri de Souza Meneguzzo [Thu, 25 Jan 2024 23:11:02 +0000 (23:11 +0000)]
runtime: crash stack support for loong64

Change-Id: Icc2641b888440cc27444b5dfb2b8ff286e6a595d
GitHub-Last-Rev: f5772e32e9190ab1eed94fcf2c9e58d6bc0d74d6
GitHub-Pull-Request: golang/go#63923
Reviewed-on: https://go-review.googlesource.com/c/go/+/539536
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

15 months agocmd/internal/moddeps: fix test fail when the last element of GOROOT start with a...
qiulaidongfeng [Sat, 27 Jan 2024 03:27:17 +0000 (03:27 +0000)]
cmd/internal/moddeps: fix test fail when the last element of GOROOT start with a dot or underscore

Fixes #54221

Change-Id: Id16f553251daf0b7c51f45232a4133f7dfb1ebb9
GitHub-Last-Rev: 675c2bfcbb4fd31da0442dd0e612874934cc0d87
GitHub-Pull-Request: golang/go#65298
Reviewed-on: https://go-review.googlesource.com/c/go/+/558696
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agoRevert "crypto/internal/boring: upgrade module to fips-20220613" +1
Filippo Valsorda [Fri, 26 Jan 2024 22:22:45 +0000 (23:22 +0100)]
Revert "crypto/internal/boring: upgrade module to fips-20220613" +1

This reverts commit 7383b2a4db5dc93c9b875b42d5add73d27cc4b9f
("crypto/internal/boring: upgrade module to fips-20220613") and commit
4106de901a8efe914cda6f6c4e8d45ff8c115da4 ("crypto/tls: align FIPS-only
mode with BoringSSL policy").

Fixes #65321
Updates #64717
Updates #62372

Change-Id: I0938b97e5b4904e6532448b8ae76e920d03d0508
Reviewed-on: https://go-review.googlesource.com/c/go/+/558796
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/api: include type arguments in API
Matthew Dempsky [Fri, 26 Jan 2024 04:29:32 +0000 (20:29 -0800)]
cmd/api: include type arguments in API

T[A] and T[B] are different types, but we were writing them both as
just "T". Reported by Russ.

Change-Id: I27db35946b6d3a1fad6c56c785fa6d850ad71d00
Reviewed-on: https://go-review.googlesource.com/c/go/+/558716
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agocmd/link: print failed external command invocation
Cherry Mui [Fri, 26 Jan 2024 17:08:00 +0000 (12:08 -0500)]
cmd/link: print failed external command invocation

When the invocation of the external linker, dsymutil or strip
command fails, print the command we invoked.

For #65292.

Change-Id: Icdb5f9ee942ebda4276f6373c3fbbf5222088d0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/558856
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agonet/mail: remove obsolete comment
Roland Shoemaker [Fri, 26 Jan 2024 00:11:15 +0000 (16:11 -0800)]
net/mail: remove obsolete comment

Forgot to remove this in CL 555596.

Change-Id: I903a6d1c02ee38b676e3e5860376d8d9509f0e03
Reviewed-on: https://go-review.googlesource.com/c/go/+/558675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>

15 months agoRevert "net/http: wrap client errors"
Cherry Mui [Fri, 26 Jan 2024 17:28:45 +0000 (17:28 +0000)]
Revert "net/http: wrap client errors"

This reverts CL 533119.

Reason for revert: the test fails frequently, see #65287.

Fixes #65287.

Change-Id: I5bf2ee2b7ce435608ff76b892da261c0a4a189bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/558916
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>

15 months agocmd/go: ensure the correct line number is displayed when using TB.Helper
Quan Tong [Mon, 6 Nov 2023 02:17:02 +0000 (09:17 +0700)]
cmd/go: ensure the correct line number is displayed when using TB.Helper

Fixes #26995

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-race,gotip-linux-386-longtest,gotip-windows-amd64-longtest
Change-Id: If3b68002d205fe985a692b69f5d7e0d2f20a7bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/540016
TryBot-Bypass: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agocmd/link: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abi
qiulaidongfeng [Sun, 17 Dec 2023 09:47:10 +0000 (09:47 +0000)]
cmd/link: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abi

For #59670

Change-Id: I248bad2d2f9d05903b80022e52a795ff7a4fae93
GitHub-Last-Rev: df6a7bf29a2012eb681ce391dc9cf295370b5b2e
GitHub-Pull-Request: golang/go#64775
Reviewed-on: https://go-review.googlesource.com/c/go/+/550596
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
15 months agoreflect: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abi
qiulaidongfeng [Sun, 17 Dec 2023 09:46:48 +0000 (09:46 +0000)]
reflect: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abi

For #59670

Change-Id: I63a6e2cfaf9eec03866ea61064164a059fc42bb2
GitHub-Last-Rev: a3aa46a36444b08382ddac79c10a064b314bd971
GitHub-Pull-Request: golang/go#64773
Reviewed-on: https://go-review.googlesource.com/c/go/+/550595
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agoruntime: use channels in gcBgMarkStartWorkers
Michael Pratt [Tue, 23 Jan 2024 18:29:23 +0000 (13:29 -0500)]
runtime: use channels in gcBgMarkStartWorkers

gcBgMarkStartWorkers currently starts workers one at a time, using a
note to communicate readiness back from the worker.

However, this is a pretty standard goroutine, so we can just use a
channel to communicate between the goroutines.

In addition to being conceptually simpler, using channels has the
additional advantage of coordinating with the scheduler. Notes use OS
locks and sleep the entire thread, requiring other threads to run the
other goroutines. Waiting on a channel allows the scheduler to directly
run another goroutine. When the worker sends to the channel, the
scheduler can use runnext to run gcBgMarkStartWorker immediately,
reducing latency.

We could additionally batch start all workers and then wait only once,
however this would defeate runnext switching between the workers and
gcBgMarkStartWorkers, so in a heavily loaded system, we expect the
direct switches to reduce latency.

Change-Id: Iedf0d2ad8ad796b43fd8d32ccb1e815cfe010cb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/558535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
15 months agogo/types, types2: use existing case-insensitive lookup (remove TODO)
Robert Griesemer [Wed, 24 Jan 2024 20:42:11 +0000 (12:42 -0800)]
go/types, types2: use existing case-insensitive lookup (remove TODO)

Rather than implementing a new, less complete mechanism to check
if a selector exists with different capitalization, use the
existing mechanism in lookupFieldOrMethodImpl by making it
available for internal use.

Pass foldCase parameter all the way trough to Object.sameId and
thus make it consistently available where Object.sameId is used.

From sameId, factor out samePkg functionality into stand-alone
predicate.

Do better case distinction when reporting an error for an undefined
selector expression.

Cleanup.

Change-Id: I7be3cecb4976a4dce3264c7e0c49a320c87101e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/558315
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

15 months agoall: enable range-over-func in Go 1.23
Russ Cox [Tue, 23 Jan 2024 17:02:50 +0000 (12:02 -0500)]
all: enable range-over-func in Go 1.23

GOEXPERIMENT=rangefunc still enables it for all Go modules.
Otherwise only enable in Go 1.23 source files.
More work remains but it will be done in follow-up issues.

Fixes #61405.

Change-Id: Icad64942deb152ee65444e4d7be289814a8a0b6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/557835
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
15 months agomaps: correct use of linkname
Russ Cox [Tue, 23 Jan 2024 19:42:42 +0000 (14:42 -0500)]
maps: correct use of linkname

Linkname should have uses at both ends,
and then no fake assembly file is needed.

Change-Id: Ia2066be7b1e08d71a6db622d2a167f1b09cb7d9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/558297
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agocmd/compile: implement float min/max in hardware for riscv64
Meng Zhuo [Tue, 1 Aug 2023 14:17:02 +0000 (22:17 +0800)]
cmd/compile: implement float min/max in hardware for riscv64

CL 514596 adds float min/max for amd64, this CL adds it for riscv64.

The behavior of the RISC-V FMIN/FMAX instructions almost match Go's
requirements.

However according to RISCV spec 8.3 "NaN Generation and Propagation"
>> if at least one input is a signaling NaN, or if both inputs are quiet
>> NaNs, the result is the canonical NaN. If one operand is a quiet NaN
>> and the other is not a NaN, the result is the non-NaN operand.

Go using quiet NaN as NaN and according to Go spec
>> if any argument is a NaN, the result is a NaN

This requires the float min/max implementation to check whether one
of operand is qNaN before float mix/max actually execute.

This CL also fix a typo in minmax test.

Benchmark on Visionfive2
goos: linux
goarch: riscv64
pkg: runtime
         │ float_minmax.old.bench │       float_minmax.new.bench        │
         │         sec/op         │   sec/op     vs base                │
MinFloat             158.20n ± 0%   28.13n ± 0%  -82.22% (p=0.000 n=10)
MaxFloat             158.10n ± 0%   28.12n ± 0%  -82.21% (p=0.000 n=10)
geomean               158.1n        28.12n       -82.22%

Update #59488

Change-Id: Iab48be6d32b8882044fb8c821438ca8840e5493d
Reviewed-on: https://go-review.googlesource.com/c/go/+/514775
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Run-TryBot: M Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
15 months agogo/types, types2: in struct processing, set name position in types2
Robert Griesemer [Wed, 24 Jan 2024 21:09:55 +0000 (13:09 -0800)]
go/types, types2: in struct processing, set name position in types2

As a consequence, the positions needed by the Checker.structType
internal helper functions add and addInvalid are always the positions
of the provided identifiers, and we can leave away the extra position
arguments.

Change-Id: Iddc275c83d3781261476b8e1903050e0a049957c
Reviewed-on: https://go-review.googlesource.com/c/go/+/558316
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
15 months agointernal/testenv: support the LUCI mobile builders in tests
Michael Anthony Knyszek [Thu, 25 Jan 2024 17:23:15 +0000 (17:23 +0000)]
internal/testenv: support the LUCI mobile builders in tests

This change updates the testenv tests to correctly match on future LUCI
builder names for mobile builders. This isn't a problem today because
those haven't been set up yet, but the builder names are structured and
it's clear where the modifiers will appear. Might as well set them up
now.

Change-Id: I244b88a62a90312c0f3ff2360527d58531070362
Reviewed-on: https://go-review.googlesource.com/c/go/+/558597
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agointernal/testenv: allow "-noopt" anywhere in builder name in test
Michael Anthony Knyszek [Thu, 25 Jan 2024 17:13:11 +0000 (17:13 +0000)]
internal/testenv: allow "-noopt" anywhere in builder name in test

testenv's TestHasGoBuild test is supposed to allow noopt builders to not
have go build, but the pattern match is failing on the LUCI builders
where a test shard might have an additional "-test_only" suffix in the
builder name. Furthermore, in the LUCI world, "run mods" (the builder
type suffixes) are supposed to be well-defined and composable, so it
doesn't make sense to restrict "-noopt" to the builder suffix anyway.

This change modifies the test to allow "-noopt" to appear anywhere in
the builder name when checking if it's running on a noopt builder.

Change-Id: I393818e3e8e452c7b0927cbc65726d552aa8ff8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/558596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
15 months agoruntime/pprof: fix retry logic introduced by #858cd8d
Cosmos Nicolaou [Thu, 25 Jan 2024 19:55:38 +0000 (11:55 -0800)]
runtime/pprof: fix retry logic introduced by #858cd8d

The previous attempt to fix this flake was incorrect in that it
examined the vmmap output rather than the detailed error
output for the 'resource shortage' message that triggers the
retry, and hence failed to retry. This PR looks at the
detailed error output.

Fixes #62352

Change-Id: I4218b187528a95842556dc1ea27947ffcbfbc497
Reviewed-on: https://go-review.googlesource.com/c/go/+/558575
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
15 months agodebug/gosym: add detailed doc for text argument in NewLineTable
Zxilly [Wed, 24 Jan 2024 21:27:41 +0000 (21:27 +0000)]
debug/gosym: add detailed doc for text argument in NewLineTable

Fixes #65232

Change-Id: I9ef76355cec4bea2d77811a69c61c1806c486be8
GitHub-Last-Rev: 9c617b65be9b01e9708e05a540316f98c8a0d165
GitHub-Pull-Request: golang/go#65263
Reviewed-on: https://go-review.googlesource.com/c/go/+/557957
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
15 months agomath/big,crypto/internal/bigmod: unroll loop in addMulVVW for ppc64x
Lynn Boger [Tue, 23 Jan 2024 18:46:05 +0000 (12:46 -0600)]
math/big,crypto/internal/bigmod: unroll loop in addMulVVW for ppc64x

This updates the assembly implementation of AddMulVVW to
unroll the main loop to do 64 bytes at a time.

The code for addMulVVWx is based on the same code and has
also been updated to improve performance.

goos: linux
goarch: ppc64le
pkg: crypto/internal/bigmod
cpu: POWER10
               │ bg.orig.out │               bg.out               │
               │   sec/op    │   sec/op     vs base               │
ModAdd           116.3n ± 0%   116.9n ± 0%   +0.52% (p=0.002 n=6)
ModSub           111.5n ± 0%   111.5n ± 0%    0.00% (p=0.273 n=6)
MontgomeryRepr   2.195µ ± 0%   1.944µ ± 0%  -11.44% (p=0.002 n=6)
MontgomeryMul    2.195µ ± 0%   1.943µ ± 0%  -11.48% (p=0.002 n=6)
ModMul           4.418µ ± 0%   3.900µ ± 0%  -11.72% (p=0.002 n=6)
ExpBig           5.736m ± 0%   5.117m ± 0%  -10.78% (p=0.002 n=6)
Exp              5.891m ± 0%   5.237m ± 0%  -11.11% (p=0.002 n=6)
geomean          9.901µ        9.094µ        -8.15%

goos: linux
goarch: ppc64le
pkg: math/big
cpu: POWER10
                 │ am.orig.out  │               am.out               │
                 │    sec/op    │   sec/op     vs base               │
AddMulVVW/1         4.456n ± 1%   3.565n ± 0%  -20.00% (p=0.002 n=6)
AddMulVVW/2         4.875n ± 1%   5.938n ± 1%  +21.79% (p=0.002 n=6)
AddMulVVW/3         5.484n ± 0%   5.693n ± 0%   +3.80% (p=0.002 n=6)
AddMulVVW/4         6.370n ± 0%   6.065n ± 0%   -4.79% (p=0.002 n=6)
AddMulVVW/5         7.321n ± 0%   7.188n ± 0%   -1.82% (p=0.002 n=6)
AddMulVVW/10        12.26n ± 8%   11.41n ± 0%   -6.97% (p=0.002 n=6)
AddMulVVW/100      100.70n ± 0%   93.58n ± 0%   -7.08% (p=0.002 n=6)
AddMulVVW/1000      938.6n ± 0%   845.5n ± 0%   -9.92% (p=0.002 n=6)
AddMulVVW/10000     9.459µ ± 0%   8.415µ ± 0%  -11.04% (p=0.002 n=6)
AddMulVVW/100000    94.57µ ± 0%   84.01µ ± 0%  -11.16% (p=0.002 n=6)
geomean             75.17n        71.21n        -5.27%

Change-Id: Idd79f5f02387564f4c2cc28d50b1c12bcd9a400f
Reviewed-on: https://go-review.googlesource.com/c/go/+/557915
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Paul Murphy <murp@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
15 months agonet/http: wrap client errors
kayos@tcp.direct [Mon, 8 Jan 2024 07:42:00 +0000 (07:42 +0000)]
net/http: wrap client errors

Fixes #50856

Change-Id: I7fe89fcce223e1571debb73436f8aeb3bfbe4b9f
GitHub-Last-Rev: be570e7883be06adbd227a1dfe63a80e384d96f6
GitHub-Pull-Request: golang/go#63448
Reviewed-on: https://go-review.googlesource.com/c/go/+/533119
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agocmd/dist,internal/platform,runtime: add cgo support for openbsd/riscv64 port
Joel Sing [Sat, 17 Sep 2022 16:37:36 +0000 (02:37 +1000)]
cmd/dist,internal/platform,runtime: add cgo support for openbsd/riscv64 port

Updates #55999

Change-Id: Ie9a030130713f3eaf789b91d9033be3335eb9d75
Reviewed-on: https://go-review.googlesource.com/c/go/+/518630
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agocmd/dist,internal/platform: enable openbsd/riscv64 port
Joel Sing [Fri, 4 Aug 2023 10:40:23 +0000 (20:40 +1000)]
cmd/dist,internal/platform: enable openbsd/riscv64 port

Fixes #55999

Change-Id: If76b61b660db3fefe5f9ca97500782f2a650db25
Reviewed-on: https://go-review.googlesource.com/c/go/+/518629
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
15 months agoruntime: add crash stack support for s390x
Mauri de Souza Meneguzzo [Sat, 2 Dec 2023 15:04:52 +0000 (15:04 +0000)]
runtime: add crash stack support for s390x

Change-Id: Ie923f7bbe5ef22e381ae4f421387fbd570622a28
GitHub-Last-Rev: f8f21635025eb6e26c6994679995ade501e870cf
GitHub-Pull-Request: golang/go#63908
Reviewed-on: https://go-review.googlesource.com/c/go/+/539296
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
15 months agonet/netip: use Addr.appendTo4In6 in Addr.AppendTo
Tobias Klauser [Wed, 24 Jan 2024 21:15:19 +0000 (22:15 +0100)]
net/netip: use Addr.appendTo4In6 in Addr.AppendTo

Change-Id: Ieb1931c40b37b87fc7d0011461d9f583e73aaff9
Reviewed-on: https://go-review.googlesource.com/c/go/+/557778
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
15 months agonet/netip: optimize Addr.String for 4in6 addresses
Tobias Klauser [Wed, 24 Jan 2024 21:15:15 +0000 (22:15 +0100)]
net/netip: optimize Addr.String for 4in6 addresses

name                      old time/op    new time/op    delta
AddrString/v4-8             20.0ns ± 0%    19.7ns ± 1%   -1.42%  (p=0.000 n=9+10)
AddrString/v6-8             58.9ns ± 6%    57.1ns ± 0%   -3.08%  (p=0.000 n=10+9)
AddrString/v6_ellipsis-8    59.9ns ± 1%    59.5ns ± 0%   -0.53%  (p=0.027 n=8+10)
AddrString/v6_v4-8          33.7ns ± 1%    24.3ns ± 0%  -27.82%  (p=0.000 n=9+10)
AddrString/v6_zone-8        61.4ns ± 1%    61.6ns ± 0%     ~     (p=0.190 n=9+9)

name                      old alloc/op   new alloc/op   delta
AddrString/v4-8              16.0B ± 0%     16.0B ± 0%     ~     (all equal)
AddrString/v6-8              48.0B ± 0%     48.0B ± 0%     ~     (all equal)
AddrString/v6_ellipsis-8     24.0B ± 0%     24.0B ± 0%     ~     (all equal)
AddrString/v6_v4-8           24.0B ± 0%     24.0B ± 0%     ~     (all equal)
AddrString/v6_zone-8         24.0B ± 0%     24.0B ± 0%     ~     (all equal)

name                      old allocs/op  new allocs/op  delta
AddrString/v4-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrString/v6-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrString/v6_ellipsis-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrString/v6_v4-8            1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrString/v6_zone-8          1.00 ± 0%      1.00 ± 0%     ~     (all equal)

Change-Id: Ie611ee8629a2ff457dcff83b08d0c94c93af3182
Reviewed-on: https://go-review.googlesource.com/c/go/+/557777
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agonet/netip: optimize Addr.MarshalText allocation for 4in6 addresses
Tobias Klauser [Wed, 24 Jan 2024 21:14:49 +0000 (22:14 +0100)]
net/netip: optimize Addr.MarshalText allocation for 4in6 addresses

name                           old time/op    new time/op    delta
AddrMarshalText/v4-8             18.5ns ± 1%    18.8ns ± 1%   +1.40%  (p=0.000 n=9+10)
AddrMarshalText/v6-8             58.0ns ± 0%    57.5ns ± 0%   -0.93%  (p=0.000 n=9+10)
AddrMarshalText/v6_ellipsis-8    61.4ns ± 0%    60.4ns ± 0%   -1.65%  (p=0.000 n=10+9)
AddrMarshalText/v6_v4-8          25.7ns ± 0%    26.2ns ± 1%   +1.86%  (p=0.000 n=10+10)
AddrMarshalText/v6_zone-8        61.8ns ± 0%    60.8ns ± 0%   -1.63%  (p=0.000 n=10+9)

name                           old alloc/op   new alloc/op   delta
AddrMarshalText/v4-8              16.0B ± 0%     16.0B ± 0%     ~     (all equal)
AddrMarshalText/v6-8              48.0B ± 0%     48.0B ± 0%     ~     (all equal)
AddrMarshalText/v6_ellipsis-8     48.0B ± 0%     48.0B ± 0%     ~     (all equal)
AddrMarshalText/v6_v4-8           48.0B ± 0%     32.0B ± 0%  -33.33%  (p=0.000 n=10+10)
AddrMarshalText/v6_zone-8         48.0B ± 0%     48.0B ± 0%     ~     (all equal)

name                           old allocs/op  new allocs/op  delta
AddrMarshalText/v4-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrMarshalText/v6-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrMarshalText/v6_ellipsis-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrMarshalText/v6_v4-8            1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrMarshalText/v6_zone-8          1.00 ± 0%      1.00 ± 0%     ~     (all equal)

Change-Id: Ib298a0fb9ec6b55e37d0559dad387242dc82aab9
Reviewed-on: https://go-review.googlesource.com/c/go/+/557776
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agonet/netip: further optimize AddrPort.String
Tobias Klauser [Wed, 24 Jan 2024 21:13:17 +0000 (22:13 +0100)]
net/netip: further optimize AddrPort.String

name                          old time/op    new time/op    delta
AddrPortString/v4-8             29.0ns ± 0%    28.2ns ± 1%   -2.74%  (p=0.000 n=8+9)
AddrPortString/v6-8             96.0ns ± 0%    65.1ns ± 0%  -32.22%  (p=0.000 n=10+10)
AddrPortString/v6_ellipsis-8    98.5ns ± 0%    68.0ns ± 1%  -30.95%  (p=0.000 n=10+10)
AddrPortString/v6_v4-8          71.8ns ± 1%    33.9ns ± 0%  -52.88%  (p=0.000 n=10+10)
AddrPortString/v6_zone-8        98.5ns ± 0%    68.6ns ± 0%  -30.35%  (p=0.000 n=8+9)

name                          old alloc/op   new alloc/op   delta
AddrPortString/v4-8              24.0B ± 0%     24.0B ± 0%     ~     (all equal)
AddrPortString/v6-8              96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.000 n=10+10)
AddrPortString/v6_ellipsis-8     56.0B ± 0%     32.0B ± 0%  -42.86%  (p=0.000 n=10+10)
AddrPortString/v6_v4-8           56.0B ± 0%     32.0B ± 0%  -42.86%  (p=0.000 n=10+10)
AddrPortString/v6_zone-8         56.0B ± 0%     32.0B ± 0%  -42.86%  (p=0.000 n=10+10)

name                          old allocs/op  new allocs/op  delta
AddrPortString/v4-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrPortString/v6-8               2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
AddrPortString/v6_ellipsis-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
AddrPortString/v6_v4-8            2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
AddrPortString/v6_zone-8          2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)

Change-Id: Iae077c5c80db3d236d7ec9a02d20a96b0e3a96e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/557775
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
15 months agonet: verify if internal/poll.Splice has been called during io.Copy
Andy Pan [Fri, 22 Dec 2023 13:49:46 +0000 (21:49 +0800)]
net: verify if internal/poll.Splice has been called during io.Copy

Change-Id: I29ef35b034cd4ec401ac502bf95dbd8c3ef2a2d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/552535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
15 months agogo/types, types2: better error msg when type inference fails in a call
Robert Griesemer [Tue, 23 Jan 2024 21:21:19 +0000 (13:21 -0800)]
go/types, types2: better error msg when type inference fails in a call

In Checker.infer, report an error through an (incoming) *error_
so that the error can be reported as desired where infer is called.
Checker.infer is now a pure function.

Fixes #60543.

At call sites of Checker.infer, pass in an *error_ and use it to
report inference errors, together with additional information as
desired.

Fixes #60542.

In go/types, in error_.errorf, pass in a positioner rather than
a token.Pos. Also, introduce noposn, the positioner equivalent
for nopos. Adjust call sites as needed.

Change-Id: I462a7899a77a8bee2a21ba88299df237d74e0672
Reviewed-on: https://go-review.googlesource.com/c/go/+/558035
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
15 months agodoc/go1.22: remove archive/tar.FileInfoNames
Cherry Mui [Wed, 24 Jan 2024 20:24:50 +0000 (15:24 -0500)]
doc/go1.22: remove archive/tar.FileInfoNames

CL 514235 is reverted.

Updates #65245.
Updates #61422.

Change-Id: Ib5d2e16c982ab25c8a87af2bdaee8568446cf599
Reviewed-on: https://go-review.googlesource.com/c/go/+/557840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
15 months agoRevert "archive/tar: add FileInfoNames interface"
Cherry Mui [Wed, 24 Jan 2024 20:00:47 +0000 (15:00 -0500)]
Revert "archive/tar: add FileInfoNames interface"

This reverts CL 514235. Also reverts CL 518056 which is a followup
fix.

Reason for revert: Proposal #50102 defined an interface that is
too specific to UNIX-y systems and also didn't make much sense.
The proposal is un-accepted, and we'll revisit in Go 1.23.

Fixes (via backport) #65245.
Updates #50102.

Change-Id: I41ba0ee286c1d893e6564a337e5d76418d19435d
Reviewed-on: https://go-review.googlesource.com/c/go/+/558295
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
15 months agonet: ignore Dial errors in TestAcceptTimeout
Bryan C. Mills [Tue, 23 Jan 2024 22:08:50 +0000 (17:08 -0500)]
net: ignore Dial errors in TestAcceptTimeout

Also use DialContext instead of just Dial so that we can ensure
the call returns before we close the listener.

The Dial in this test is intended to complete before the call to
Accept, but there is no synchronization to ensure that and sometimes
it doesn't happen. That's ok and mostly immaterial to the test, but it
does mean we need to ignore Dial errors (which can happen when the
listener is closed), and we need to be a little more careful about not
dialing a port that may have already been reused by some other test.

Fixes #65240.
Updates #17948.

Change-Id: Ife1b5c3062939441b58f4c096461bf5d7841889b
Reviewed-on: https://go-review.googlesource.com/c/go/+/558175
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

15 months agoreflect: fix isRegularMemory at case Array
Jes Cok [Wed, 24 Jan 2024 12:33:30 +0000 (12:33 +0000)]
reflect: fix isRegularMemory at case Array

To match cmd/compile/internal/compare.IsRegularMemory,
this CL adds code for empty arrays of comparable element type.

Change-Id: I205fb9bfda60be6c9aac2d9098ed3f0eb51cd0fa
GitHub-Last-Rev: 40db7ed510883633374895271145678a51418426
GitHub-Pull-Request: golang/go#65252
Reviewed-on: https://go-review.googlesource.com/c/go/+/558155
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>