Damien Neil [Mon, 3 Nov 2025 22:28:47 +0000 (14:28 -0800)]
[release-branch.go1.26] net/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters
net/url does not currently limit the number of query parameters parsed by
url.ParseQuery or URL.Query.
When parsing a application/x-www-form-urlencoded form,
net/http.Request.ParseForm will parse up to 10 MB of query parameters.
An input consisting of a large number of small, unique parameters can
cause excessive memory consumption.
We now limit the number of query parameters parsed to 10000 by default.
The limit can be adjusted by setting GODEBUG=urlmaxqueryparams=<n>.
Setting urlmaxqueryparams to 0 disables the limit.
Thanks to jub0bs for reporting this issue.
Fixes #77101
Fixes CVE-2025-61726
Change-Id: Iee3374c7ee2d8586dbf158536d3ade424203ff66
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3020 Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3345 Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736707
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Neal Patel [Thu, 4 Dec 2025 17:30:39 +0000 (12:30 -0500)]
[release-branch.go1.26] cmd/go/internal/work: sanitize flags before invoking 'pkg-config'
The addition of CgoPkgConfig allowed execution with flags not
matching the safelist. In order to prevent potential arbitrary
code execution at build time, ensure that flags are validated
prior to invoking the 'pkg-config' binary.
Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc.
for reporting this issue.
Fixes CVE-2025-61731
Fixes #77100
Change-Id: Ic51b41f1f7e697ab98c9c32c6fae35f217f7f364
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3240 Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3324 Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736706
Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Roland Shoemaker [Wed, 10 Dec 2025 13:13:07 +0000 (08:13 -0500)]
[release-branch.go1.26] cmd/go: update VCS commands to use safer flag/argument syntax
In various situations, the toolchain invokes VCS commands. Some of these
commands take arbitrary input, either provided by users or fetched from
external sources. To prevent potential command injection vulnerabilities
or misinterpretation of arguments as flags, this change updates the VCS
commands to use various techniques to separate flags from positional
arguments, and to directly associate flags with their values.
Additionally, we update the environment variable for Mercurial to use
`HGPLAIN=+strictflags`, which is the more explicit way to disable user
configurations (intended or otherwise) that might interfere with command
execution.
We also now disallow version strings from being prefixed with '-' or
'/', as doing so opens us up to making the same mistake again in the
future. As far as we know there are currently ~0 public modules affected
by this.
While I was working on cmd/go/internal/vcs, I also noticed that a
significant portion of the commands being implemented were dead code.
In order to reduce the maintenance burden and surface area for potential
issues, I removed the dead code for unused commands.
We should probably follow up with a more structured change to make it
harder to accidentally re-introduce these issues in the future, but for
now this addresses the issue at hand.
Thanks to splitline (@splitline) from DEVCORE Research Team for
reporting this issue.
Fixes CVE-2025-68119
Fixes #77099
Change-Id: I9d9f4ee05b95be49fe14edf71a1b8e6c0784378e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3260 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3341 Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736705
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Roland Shoemaker [Tue, 6 Jan 2026 22:36:01 +0000 (14:36 -0800)]
[release-branch.go1.26] crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone
Once a tls.Config is used, it is not safe to mutate. We provide the
Clone method in order to allow users to copy and modify a Config that
is in use.
If Config.SessionTicketKey is not populated, and if
Config.SetSessionTicketKeys has not been called, we automatically
populate and rotate session ticket keys. Clone was previously copying
these keys into the new Config, meaning that two Configs could share
the same auto-rotated session ticket keys. This could allow sessions to
be resumed across different Configs, which may have completely different
configurations.
This change updates Clone to not copy the auto-rotated session ticket
keys.
Additionally, when resuming a session, check that not just that the leaf
certificate is unexpired, but that the entire certificate chain is still
unexpired.
Fixes #77113
Fixes CVE-2025-68121
Change-Id: I011df7329de83068d11b3f0c793763692d018a98
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3300 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3340 Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736704
TryBot-Bypass: Michael Pratt <mpratt@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Cherry Mui [Thu, 8 Jan 2026 16:57:28 +0000 (11:57 -0500)]
simd/archsimd: rename Broadcast methods
Currently the Broadcast128/256/512 methods broadcast the lowest
element of the input vector to a vector of the corresponding width.
There are also variations of broadcast operations that broadcast
the whole (128- or 256-bit) vector to a larger vector, which we
don't yet support. Our current naming is unclear which version it
is, though. Rename the current ones to Broadcast1ToN, to be clear
that they broadcast one element. The vector version probably will
be named BoradcastAllToN (not included in this CL).
Mark Freeman [Wed, 7 Jan 2026 21:40:53 +0000 (16:40 -0500)]
internal/types: add test for cycles in value context
Exposition is also added to outline a difference between syntax which
can / cannot produce values of incomplete types.
For us to enforce non-nilness of type RHS and remove the pending type
mechanism, I suspect we would need to add completeness guards to
the syntax which *can*.
Enforcing non-nilness of type RHS currently breaks the below test
cases, but I suspect that is simply an implementation artifact.
In other words, they just call Underlying at a bad time.
- T0
- T3
- T6 / T7
- T10
- T12
If we also remove pendingType, all of these test cases break; again,
we would need guards in the appropriate syntax logic.
Change-Id: Ibe22042232e542de1d38b923dd1d5cc50dce08cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734600
TryBot-Bypass: Mark Freeman <markfreeman@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
Michael Matloob [Mon, 5 Jan 2026 17:23:14 +0000 (12:23 -0500)]
cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
To allow this, we also increase the size of the pool to allow the
minimum number for each action, with an extra 2*GOMAXPROCS number of
tokens to boost -c when there are fewer concurrently running actions.
That means the pool will now have the size 6*GOMAXPROCS instead of the
previous 4*GOMAXPROCS.
The goal is to maintain the boosting behavior added by the pool, while
guarding from starving compiles when there are too few tokens left, so
that the value of -c is always at least min(4,GOMAXPROCS), which is what
it was set to before Go 1.26.
Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I113a38584514a6c025d3d1bc727ff8d86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734040
Commit-Queue: Michael Matloob <matloob@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
Michael Matloob [Tue, 6 Jan 2026 22:18:48 +0000 (17:18 -0500)]
cmd/go/internal/work: decrement concurrentProcesses when action finishes
This fixes a bug where we only incremented concurrentProcesses but never
decremented it, causing us to run out of tokens and give all compiles
-c=1 after a point.
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-arm64_c4as16-perf_vs_parent
Change-Id: I41f4c1edb77004cbc1772d6d672045946a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734260 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
Junyang Shao [Wed, 7 Jan 2026 20:06:48 +0000 (20:06 +0000)]
[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26
Merge List:
+ 2026-01-07 f6ebd91129 all: update vendored x/tools
+ 2026-01-06 d1d0fc7a97 os/exec: avoid atomic.Bool for Cmd.startCalled
+ 2026-01-05 9b2e3b9a02 simd/archsimd: use V(P)MOVMSK for mask ToBits if possible
+ 2026-01-02 f8ee0f8475 cmd/go/testdata/vcstest/git: use git commands that work on older git versions
+ 2026-01-02 b094749bad test/codegen: codify bit related code generation for arm64
+ 2026-01-02 e84983fa40 cmd/compile: optimize SIMD IsNaN.Or(IsNaN)
+ 2026-01-02 8244b85677 simd/archsimd: add tests for IsNaN
+ 2026-01-02 13440fb518 simd/archsimd: make IsNaN unary
+ 2026-01-02 c3550b3352 simd/archsimd: correct documentation of Mask types
+ 2026-01-02 34ad26341d net/rpc: correct comment for isExportedOrBuiltinType function
+ 2025-12-30 b28808d838 cmd/go/internal/modindex: fix obvious bug using failed type assertion
+ 2025-12-30 d64add4d60 simd/archsimd: adjust documentations slightly
+ 2025-12-30 1843cfbcd6 runtime/secret: make tests more sturdy
+ 2025-12-30 fd45d70799 all: fix some minor grammatical issues in the comments
+ 2025-12-30 df4e08ac65 test/codegen: fix a tab in comparisons.go to ensure pattern works
+ 2025-12-30 cd668d744f cmd/compile: disable inlining for functions using runtime.deferrangefunc
+ 2025-12-29 06eff0f7c3 simd/archsimd: add tests for Saturate-Concat operations
+ 2025-12-29 110aaf7137 simd/archsimd: add tests for Saturate operations
+ 2025-12-29 22e7b94e7f simd/archsimd: add tests for ExtendLo operations
+ 2025-12-29 76dddce293 simd/archsimd: remove redundant suffix of ExtendLo operations
+ 2025-12-29 6ecdd2fc6e simd/archsimd: add more tests for Convert operations
+ 2025-12-29 e0c99fe285 simd/archsimd: add more tests for Truncate operations
+ 2025-12-29 08369369e5 reflect: document Call/CallSlice panic when v is unexported field
+ 2025-12-29 ca8effbde1 internal/coverage/decodemeta: correct wording in unknown version error
+ 2025-12-29 0b06b68e21 encoding/gob: clarify docs about pointers to zero values not being sent
+ 2025-12-29 9cb3edbfe9 regexp: standardize error message format in find_test.go
+ 2025-12-29 b3ed0627ce tests: improve consistency and clarity of test diagnostics
+ 2025-12-29 3dcb48d298 test: follow got/want convention in uintptrescapes test
+ 2025-12-29 f7b7e94b0a test: clarify log message for surrogate UTF-8 check
+ 2025-12-29 e790d59674 simd/archsimd: add tests for Truncate operations
+ 2025-12-27 f4cec7917c cmd: fix unused errors reported by ineffassign
+ 2025-12-27 ca13fe02c4 simd/archsimd: add more tests for Convert operations
+ 2025-12-27 037c047f2c simd/archsimd: add more tests for Extend operations
+ 2025-12-26 7971fcdf53 test/codegen: tidy tests for bits
+ 2025-12-24 0f620776d7 simd/archsimd: fix "go generate" command
+ 2025-12-24 a5fe8c07ae simd/archsimd: guard test helpers with amd64 tag
+ 2025-12-23 a23d1a4ebe bytes: improve consistency in split test messages
+ 2025-12-23 866e461b96 cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe
+ 2025-12-23 08dc8393d7 time: skip test that will fail with GO111MODULE=off
+ 2025-12-23 43ebed88cc runtime: improve a log message in TestCleanupLost
+ 2025-12-23 81283ad339 runtime: fix nGsyscallNoP accounting
+ 2025-12-23 3e0e1667f6 test/codegen: codify bit related code generation for riscv64
+ 2025-12-23 3faf988f21 errors: add a test verifying join does not flatten errors
+ 2025-12-23 2485a0bc2c cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
+ 2025-12-23 8254d66eab cmd/asm/internal/asm: abort end to end test if assembly failed
+ 2025-12-23 1b3db48db7 Revert "errors: optimize errors.Join for single unwrappable errors"
+ 2025-12-23 b6b8b2fe6e cmd/compile: handle propagating an out-of-range jump table index
+ 2025-12-22 2cd0371a0a debug/pe: avoid panic in File.ImportedSymbols
+ 2025-12-22 91435be153 runtime: revert entry point on freebsd/arm64
+ 2025-12-22 c1efada1d2 simd/archsimd: correct documentation for pairwise operations
+ 2025-12-22 3d77a0b15e os/exec: second call to Cmd.Start is always an error
+ 2025-12-20 7ecb1f36ac simd/archsimd: add HasAVX2() guards to tests that need them
+ 2025-12-19 70c22e0ad7 simd/archsimd: delete DotProductQuadruple methods for now
+ 2025-12-19 42cda7c1df simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type
+ 2025-12-19 baa0ae3aaa simd/archsimd: correct type and instruction for SaturateToUint8
+ 2025-12-19 d46c58debb go/doc: link to struct fields in the same package
+ 2025-12-19 25ed6c7f9b cmd/go/internal/doc: update pkgsite version
+ 2025-12-19 4411edf972 simd/archsimd: reword documentation for some operations
+ 2025-12-19 7d9418a19c simd/archsimd: reword documentation of comparison operations
+ 2025-12-18 d00e96d3ae internal/cpu: repair VNNI feature check
+ 2025-12-18 cfc024daeb simd/archsimd: reword documentation for conversion ops
+ 2025-12-17 ad91f5d241 simd/archsimd: reword documentation of shfit operations
+ 2025-12-17 b8c4cc63e7 runtime: keep track of secret allocation size
+ 2025-12-17 8564fede89 cmd/go: remove reference to no longer existing -i flag
+ 2025-12-17 eecdb61eeb crypto: rename fips140v2.0 to fips140v1.26
+ 2025-12-17 05e41225f6 simd/archsimd: reword documentation of As methods
+ 2025-12-17 516699848b runtime/secret: warn users about allocations, loosen guarantees
+ 2025-12-16 8c28ab936a cmd/cgo: don't emit C local if it is not used
+ 2025-12-16 65b71c11d4 crypto/internal/fips140only: test fips140=only mode
+ 2025-12-16 ea1aa76554 go/doc: exclude examples with results
+ 2025-12-16 5046bdf8a6 crypto/tls: reject trailing messages after client/server hello
+ 2025-12-16 3f6eabdf09 cmd/compile: use unsigned constant when folding loads for SIMD ops with constants
+ 2025-12-16 a4b5b92055 cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments
[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=internal-branch.go1.26-vendor
Change-Id: Ic0c10569a4a3a292aec9164e6dd034e55d052904
Reviewed-on: https://go-review.googlesource.com/c/go/+/733780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Alan Donovan [Tue, 6 Jan 2026 19:48:31 +0000 (14:48 -0500)]
os/exec: avoid atomic.Bool for Cmd.startCalled
An atomic.Bool isn't necessary here since, unless otherwise
specified, the methods of an object are not concurrency-safe
w.r.t. each other. Using an atomic causes the copylocks vet
check to warn about copying of Cmd, which is not wrong, because
one shouldn't be copying opaque complex structs from other
packages, but it is a nuisance in the absence of any safe way
to copy a Cmd.
If and when we add a Clone method to Cmd (see #77075) then
it would be appropriate to revert this change so that we get
the benefit of the static check (though ideally we would make
a more explicit tool-readable declaration of the "do not copy"
attribute than merely happening to use an atomic.Bool).
For #77075
Change-Id: I982d4e86623ca165a3e76bbf648fd44041d5f6bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734200 Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Cherry Mui [Mon, 5 Jan 2026 17:56:08 +0000 (12:56 -0500)]
simd/archsimd: use V(P)MOVMSK for mask ToBits if possible
VPMOVMSKB, VMOVMSKPS, and VMOVMSKPD moves AVX1/2-style masks to
integer registers, similar to VPMOV[BWDQ]2M (which moves to mask
registers). The former is available on AVX1/2, the latter requires
AVX512. So use the former if it is supported, i.e. for 128- and
256-bit vectors with 8-, 32-, and 64-bit elements (16-bit elements
always require AVX512).
Change-Id: I972195116617ed2faaf95cee5cd6b250e671496c
Reviewed-on: https://go-review.googlesource.com/c/go/+/734060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Joel Sing [Fri, 12 Dec 2025 08:03:05 +0000 (19:03 +1100)]
cmd/go/testdata/vcstest/git: use git commands that work on older git versions
On older versions of git (such as 2.25.1), `git branch -M master`
fails after `git init` - use `git checkout -b master` instead, which
works across multiple versions.
Fixes tests on the rather outdated linux/mips* builders.
Change-Id: Id86ec82b37a8d2c3131f449276b13989d097d106
Reviewed-on: https://go-review.googlesource.com/c/go/+/729600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Cherry Mui [Fri, 2 Jan 2026 19:02:07 +0000 (14:02 -0500)]
cmd/compile: optimize SIMD IsNaN.Or(IsNaN)
IsNaN's underlying instruction, VCMPPS (or VCMPPD), takes two
inputs, and computes either of them is NaN. Optimize the Or
pattern to generate two-operand form.
This implements the optimization mentioned in CL 733660.
Change-Id: I13943b377ee384864c913eed320763f333a03e41
Reviewed-on: https://go-review.googlesource.com/c/go/+/733680 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Cherry Mui [Wed, 31 Dec 2025 07:42:30 +0000 (02:42 -0500)]
simd/archsimd: make IsNaN unary
Currently, the IsNan API is defined as x.IsNan(y), which returns
a mask to represent, for each element, either x or y is NaN.
Albeit closer to the machine instruction, this is weird API, as
IsNaN is a unary operation. This CL changes it to unary, x.IsNaN().
It compiles to VCMPPS $3, x, x (or VCMPPD). For the two-operand
version, we can optimize x.IsNaN().Or(y.IsNaN()) to VCMPPS $3, x,
y (not done in this CL).
While here, change the name to IsNaN (uppercase both Ns), which
matches math.IsNaN.
Tests in the next CL.
Change-Id: Ib6e7afc2635e6c3c606db5ea16420ee673a6c6d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/733660 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Matloob [Tue, 30 Dec 2025 20:41:41 +0000 (15:41 -0500)]
cmd/go/internal/modindex: fix obvious bug using failed type assertion
adonovan pointed out this bug in the review of CL 733320 and this seems
to be the cause of all those list_empty_importpath flakes. It makes
sense that something nondeterministic would be tied up with the module
index because the state of the cache could depend on the order tests are
run in.
Also remove the parts of the test that accept the flaky behavior so we
can verify the issue has been resolved.
For #73976
Change-Id: Ib64ce6b8eed1dc8d327b7c5e842c1e716a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/733321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com>
Cherry Mui [Fri, 19 Dec 2025 22:37:37 +0000 (17:37 -0500)]
simd/archsimd: adjust documentations slightly
- Reword the documentation of Scale to mention parameter names.
- Correct the parameter name in Merge.
- Use proper a/an articles in some documentation.
- Add punctuations.
- Format code blocks for long expressions.
Change-Id: I8a31721503c1b155862255619a835895f3d5123a
Reviewed-on: https://go-review.googlesource.com/c/go/+/731560 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Daniel Morsing [Sun, 28 Dec 2025 09:29:47 +0000 (09:29 +0000)]
runtime/secret: make tests more sturdy
Technically, the garbage collector can take an arbitrary long time until
it finds a given value unreachable. Account for this fact in our zeroing
tests.
Updates #76586.
Change-Id: Ieaf3cec99afb9204a32524ea559c5f1a280a59e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/732980 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
cuishuang [Thu, 18 Dec 2025 02:36:50 +0000 (10:36 +0800)]
all: fix some minor grammatical issues in the comments
Change-Id: I0459f05e7f6abd9738813c65d993114e931720d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/731000
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Alexander Musman [Sat, 6 Dec 2025 13:43:55 +0000 (21:43 +0800)]
test/codegen: fix a tab in comparisons.go to ensure pattern works
Fix a pattern in test/codegen/comparisons.go to use whitespace instead
of a tab. The test needs a whitespace to properly fail if the regalloc
change from CL686655 would be missing (in that case we would have a
spill immediately after call to memequal, which is supposed to be
captured by this pattern).
Change-Id: I5b6fb5e861b9327c7f071660592b8ffa265e0030
Reviewed-on: https://go-review.googlesource.com/c/go/+/727620 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
zuojunwei.1024 [Tue, 23 Dec 2025 08:12:04 +0000 (16:12 +0800)]
cmd/compile: disable inlining for functions using runtime.deferrangefunc
The rangefunc rewrite pass implements defer using deferrangefunc and
deferproccat. The loop body is rewritten into a closure, it cannot be
inlined due to defer call. But the outer function may still be inlined
in certain scenarios (e.g., with PGO), leading to the defer executing
at the wrong time.
Fixes #77033
Change-Id: I4649fad5cd1b65891832523522002d9352711123
Reviewed-on: https://go-review.googlesource.com/c/go/+/732140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
jjpinto [Fri, 26 Dec 2025 17:13:09 +0000 (17:13 +0000)]
regexp: standardize error message format in find_test.go
This change updates the test error messages in find_test.go to follow
the Go standard 'got, want' format.
It also replaces 'expected/should be' terminology with the project's
preferred style and improves the clarity of failure logs by using %q
to quote string values.
Change-Id: I17bfc60a06a879ce5e2c64d624c636e2c24135e9
GitHub-Last-Rev: e9613ac28cdce2fc16672b4aa42636b01ae0a80c
GitHub-Pull-Request: golang/go#77005
Reviewed-on: https://go-review.googlesource.com/c/go/+/732780
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
Joel Sing [Tue, 23 Dec 2025 12:43:15 +0000 (23:43 +1100)]
test/codegen: tidy tests for bits
Use Go idiomatic function names, use a common prefix, attempt to
maintain some consistency, avoid naming functions based upon
machine specific instructions and combine a duplicate test that
likely exists due to this confusion.
Change-Id: I996e9efd7497821edef94c1997d4a310d9d79a71
Reviewed-on: https://go-review.googlesource.com/c/go/+/732200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Cherry Mui [Tue, 23 Dec 2025 16:31:36 +0000 (11:31 -0500)]
simd/archsimd: fix "go generate" command
Correct the generate command for test helpers. There is no longer
a genfiles.go. Also correct the generated file headers to match
the current generator layout.
Change-Id: Ifb9a8c394477359020ff44290dbaabe7a2d59aca
Reviewed-on: https://go-review.googlesource.com/c/go/+/732280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>
This pulls in a version of the pkgsite doc command that includes CL
729900 which adds support for showing documentation for some of our
experiments
Change-Id: I52aebf06521adc114aa90f99f515f2746a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/732400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com>
Kevin Burke [Tue, 23 Dec 2025 06:07:32 +0000 (22:07 -0800)]
time: skip test that will fail with GO111MODULE=off
The test is designed to ensure that behavior introduced in Go 1.23
to garbage collect async timed channels is working correctly. If
GO111MODULE=off is set (or GODEBUG=asynctimerchan=1) Go reverts to the
Go 1.20 behavior of not garbage collecting these channels, which fails
the test.
Instead of running a test in conditions where we know it will fail,
just skip the test. A more comprehensive test does not make sense
right now because this code may go away soon.
Fixes #76948.
Change-Id: Ib186abd2ea583a06b5c246bfd6df932522cf7f1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/732100 Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Tue, 23 Dec 2025 17:16:17 +0000 (17:16 +0000)]
runtime: fix nGsyscallNoP accounting
CL 726964 has two bugs.
One is fairly obvious. Where there was previous a decrement of
nGsyscallNoP in exitsyscallTryGetP, it added a call to addGSyscallNoP.
Oops.
The other is more subtle. In needm we set isExtraInC to false very
early. This will cause exitsyscall (via cgocallbackg) to decrement
nGsyscallNoP when the thread never had a corresponding increment. (It
could not have, otherwise it would not have called needm, on Linux
anyway.) The fix is simple: increment nGsyscallNoP. CL 726964 actually
removed this increment erroneously. I'm pretty sure I removed it because
the first bug was the real issue, and removing this increment "fixed it"
in the context of the test. I was right that this case was subtle, but
wrong about how.
Fixes #76435.
Change-Id: I1ff1dfbf43bd4cf536b0965da370fee58e3f8753
Reviewed-on: https://go-review.googlesource.com/c/go/+/732320 Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Joel Sing [Tue, 23 Dec 2025 10:06:49 +0000 (21:06 +1100)]
test/codegen: codify bit related code generation for riscv64
Change-Id: Iba4d3ded15d578e97a978780069e70a51a5e944b
Reviewed-on: https://go-review.googlesource.com/c/go/+/732180
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
Damien Neil [Tue, 23 Dec 2025 17:42:37 +0000 (09:42 -0800)]
errors: add a test verifying join does not flatten errors
For #76961
Change-Id: Ib81f3202074bf83a5b204b32706445f051f837a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/732360
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Joel Sing [Sun, 21 Dec 2025 03:48:18 +0000 (14:48 +1100)]
cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
Currently, the end-to-end tests are only run for the profile set
via GORISCV64. Run each of the end-to-end tests for each profile,
increasing test coverage. Also rename tests to be RISCV64 specific,
rather than RISCV.
Change-Id: I15a70939064122c79ec5f2edcda1fa2a47c8cc95
Reviewed-on: https://go-review.googlesource.com/c/go/+/731921
Auto-Submit: Joel Sing <joel@sing.id.au> 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: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Joel Sing [Sun, 21 Dec 2025 03:39:20 +0000 (14:39 +1100)]
cmd/asm/internal/asm: abort end to end test if assembly failed
If errors are encountered during assembly, do not attempt to perform verification.
In this case the output is unlikely to be correct and all verification fails, which
means the real issue gets lost in the noise.
Change-Id: I62c1bf09fa025b0df4c06f0bfa424fb5d328184b
Reviewed-on: https://go-review.googlesource.com/c/go/+/731920 Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Damien Neil [Tue, 23 Dec 2025 00:35:42 +0000 (16:35 -0800)]
Revert "errors: optimize errors.Join for single unwrappable errors"
This reverts CL 635115.
Reason for revert: The new behavior does not match the function documentation.
Fixes #76961
Change-Id: If2450aa4efba28c7a12887a5b306c231a836e740
Reviewed-on: https://go-review.googlesource.com/c/go/+/731981 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Alex Brainman [Tue, 24 Jun 2025 05:18:28 +0000 (15:18 +1000)]
debug/pe: avoid panic in File.ImportedSymbols
This change skips symbols where dt.OriginalFirstThunk is less than
ds.VirtualAddress.
The variable types are uint32, and
(dt.OriginalFirstThunk-ds.VirtualAddress) becomes very large number when
dt.OriginalFirstThunk < ds.VirtualAddress.
Fixes #73548.
Fixes #76721.
Fixes #76724.
Change-Id: I72908bd0896003423aeb754fa0b6c72d452cdb4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/684495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Rob Nichols [Mon, 22 Dec 2025 21:25:08 +0000 (21:25 +0000)]
runtime: revert entry point on freebsd/arm64
CL 706175 unified some arm64 entry points. However, the entry point for
freebsd/arm64 is incorrect and builds now fail. This change reverts the
freebsd/arm64 entry point and adds additional context for the future.
Fixes #76958
Change-Id: Ib9e9b7844706f7b0ef54bd449411fefc8f10bc43
GitHub-Last-Rev: 70064d8126f8ff7e2c0e5e8d4b00177c627f4d76
GitHub-Pull-Request: golang/go#76959
Reviewed-on: https://go-review.googlesource.com/c/go/+/731980
Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
David Chase [Fri, 19 Dec 2025 20:50:57 +0000 (15:50 -0500)]
simd/archsimd: add HasAVX2() guards to tests that need them
This may not be complete, because some 256-bit float operations
may be implemented with integer simd instead (in some cases there
is no float op). (And some tests may have just been overlooked.)
Fixes #76866.
Change-Id: I90b1dfe039c322c484af916436fc6f6c50a31030
Reviewed-on: https://go-review.googlesource.com/c/go/+/731502
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Cherry Mui [Fri, 19 Dec 2025 22:05:03 +0000 (17:05 -0500)]
simd/archsimd: delete DotProductQuadruple methods for now
The DotProductQuadruple methods are currently defined on Int8
vectors. There are some problems for that.
1. We defined a DotProductQuadrupleSaturated method, but the dot
product part does not need saturation, as it cannot overflow. It
is the addition part of VPDPBUSDS that does the saturation.
Currently we have optimization rules like
which is incorrect, in that the dot product doesn't do (or need)
saturation, and the Add is a regular Add, but we rewrite it to a
saturated add. The correct rule should be something like
2. There are multiple flavors of DotProductQuadruple:
signed/unsigned × signed/unsigned, which cannot be completely
disambiguated by the type. The current naming may preclude adding
all the flavors.
For these reasons, remove the methods for now. We can add them
later with the issues addressed.
Change-Id: I549c0925afaa68c7e2cc956105619f2c1b46b325
Reviewed-on: https://go-review.googlesource.com/c/go/+/731441
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Cherry Mui [Fri, 19 Dec 2025 20:21:15 +0000 (15:21 -0500)]
simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type
They operate on 128-bit groups, so name them Grouped to be clear,
and consistent with other grouped operations. Reword the
documentation, mention the grouping only for grouped versions.
Also, SaturateToUnt16Concat(Grouped) is a signed int32 to unsigned
uint16 saturated conversion. The receiver and the parameter should
be signed. The result remains unsigned.
Change-Id: I30e28bc05e07f5c28214c9c6d9d201cbbb183468
Reviewed-on: https://go-review.googlesource.com/c/go/+/731501 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sean Liao [Sun, 14 Dec 2025 18:48:51 +0000 (18:48 +0000)]
go/doc: link to struct fields in the same package
This collects up any struct direct field references
for linking. It does not attempt to do any validation
of embedded field conflicts as in CL 510315.
For #61394
Change-Id: I57dc0a0e8a71ce0bcb4e6c0963f459f76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/729980
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
matloob [Fri, 19 Dec 2025 18:00:33 +0000 (13:00 -0500)]
cmd/go/internal/doc: update pkgsite version
Fixes #76827
For #36905
Change-Id: I3f855a75efc9272105f0a352c54600cd6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Cherry Mui [Wed, 17 Dec 2025 16:20:25 +0000 (11:20 -0500)]
simd/archsimd: reword documentation for some operations
- Min/Max: make it clear it is elementwise.
- RoundToEven: clarify it is rounding tie to even.
- MulEvenWiden: use mathematical form of the index.
- CopySign: use parameter names directly.
- ConcatShiftBytesRight: rename the parameter.
Change-Id: I4cf0773c4daf3e3bf7b26e79d84ac5c2a9145c88
Reviewed-on: https://go-review.googlesource.com/c/go/+/731421 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
David Chase [Thu, 18 Dec 2025 18:18:14 +0000 (13:18 -0500)]
internal/cpu: repair VNNI feature check
This is a pain to test.
Also the original test was never executed, because it was wrong.
It looks like processors that might lack this features
include Intel 11th generation and AMD Zen 4. These might
or might not have bit 2 set in the 7th cpuid "leaf" (SM4)
which is what the incorrect test was checking; the bug
is triggered by ^VNNI & SM4. Apparently the SM4 bit is
not usually set, else we would have seen a test failure.
The "Lion Cove" microarchitecture (Arrow Lake, Lunar Lake)
appears to trigger this problem, it's not clear if there are
others. It was hard to verify this from online information.
Fixes #76881.
Change-Id: I21be6b4f47134d81e89799b0f06f89fcb6563264
Reviewed-on: https://go-review.googlesource.com/c/go/+/731240
TryBot-Bypass: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Cherry Mui [Wed, 17 Dec 2025 19:32:55 +0000 (14:32 -0500)]
simd/archsimd: reword documentation for conversion ops
Use more compact wording for extension, truncation, and
saturation. Say that we pack the results to the low elements and
zero the high elements if and only if the result has more elements.
Change-Id: Iae98d3c6ea6b5b5fa0acd548471e8d6c70a26d2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/730940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Cherry Mui [Wed, 17 Dec 2025 16:00:36 +0000 (11:00 -0500)]
simd/archsimd: reword documentation of shfit operations
Say the name of the parameter, instead of "the immediate".
Don't say "Emptied bits are zeroed", which is implied by the shift
operation in Go (and perhaps many other languages). For right
shifts, say signed or unsigned shifts instead.
Change-Id: I29c9c0e218bfaeef55b03d92d44762e34f006654
Reviewed-on: https://go-review.googlesource.com/c/go/+/730720 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Daniel Morsing [Tue, 16 Dec 2025 13:50:57 +0000 (13:50 +0000)]
runtime: keep track of secret allocation size
During a naive attempt to test the new runtime/secret package, I tried
wrapping the entire handshake in a secret.Do call. This lead to a panic
because some of the allocator logic had been previously untested.
freeSpecial takes p and size, but they can be misleading. They don't
refer to the pointer and size of the object with the special attached,
but a pointer to the enclosing object and the size of the span element.
The previous code did not take this into account and when passing the
size to memclr would overwrite nearby objects.
Fix by storing the size of the object being cleared inside the special.
Fixes #76865.
Change-Id: Ifae31f1c8d0609a562a37f37c45aec2f369dc6a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/730361 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Daniel Morsing [Wed, 10 Dec 2025 10:13:05 +0000 (10:13 +0000)]
runtime/secret: warn users about allocations, loosen guarantees
The discussion at #76477 warranted some stronger documentation about
what is expected from users of the secret package. In addition, #76764
presented a problem about when a user can expect their secrets to be
deleted.
Fix by loosening the guarantee to when all allocations from within a
secret function have been deemed unreachable. Provide some guidance for
users to steer them away from situations where allocations live on for
long after the secret function has finished executing
Fixes #76764.
Updates #76477.
Change-Id: I0cef3e7275737f32ec48f71355e588b3be26ea32
Reviewed-on: https://go-review.googlesource.com/c/go/+/728921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Ian Lance Taylor [Wed, 17 Dec 2025 00:00:36 +0000 (16:00 -0800)]
cmd/cgo: don't emit C local if it is not used
Fixes #76861
Change-Id: Icc8452e48ed736e8240f8afea18637c33b8e3ef8
Reviewed-on: https://go-review.googlesource.com/c/go/+/730600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Joe Richey <joerichey@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Roland Shoemaker [Mon, 24 Nov 2025 22:03:10 +0000 (14:03 -0800)]
crypto/tls: reject trailing messages after client/server hello
For TLS 1.3, after procesesing the server/client hello, if there isn't a
CCS message, reject the trailing messages which were appended to the
hello messages. This prevents an on-path attacker from injecting
plaintext messages into the handshake.
Additionally, check that we don't have any buffered messages before we
switch the read traffic secret regardless, since any buffered messages
would have been under an old key which is no longer appropriate.
We also invert the ordering of setting the read/write secrets so that if
we fail when changing the read secret we send the alert using the
correct write secret.
Fixes #76443
Fixes CVE-2025-61730
Change-Id: If6ba8ad16f48d5cd5db5574824062ad4244a5b52
Reviewed-on: https://go-review.googlesource.com/c/go/+/724120
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Coia Prant <coiaprant@gmail.com>
Cherry Mui [Tue, 16 Dec 2025 16:16:47 +0000 (11:16 -0500)]
cmd/compile: use unsigned constant when folding loads for SIMD ops with constants
When folding loads into a SIMD op with a constant, in the SSA
rules we use makeValAndOff to create an AuxInt for the constant
and the offset. For the SIMD ops of concern (for now), the
constants are always unsigned. So pass the constant unsigned.
Fixes #76756.
Change-Id: Ia5910e689ff510ce54d3a0c2ed0e950bc54f8862
Reviewed-on: https://go-review.googlesource.com/c/go/+/730420 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qmuntal [Tue, 16 Dec 2025 10:08:35 +0000 (11:08 +0100)]
cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments
Some tests require enabling specific Go experiments via the GOEXPERIMENT
, like "jsonv2", "runtimesecret", or "simd".
When running these tests, we should preserve any existing GOEXPERIMENT
settings, so that multiple experiments can be tested together.
I've found this limitation while working in my own Go fork, where in
some situations I pass additional experiments to the tests that alter
the Go runtime and other core packages.
Change-Id: Ib0324cd93282f6993611dea2f0c57d00ab304a33
Reviewed-on: https://go-review.googlesource.com/c/go/+/730360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Mon, 15 Dec 2025 21:42:49 +0000 (21:42 +0000)]
[release-branch.go1.26] all: merge master (d14b642) into release-branch.go1.26
Merge List:
+ 2025-12-15 d14b6427cf cmd/link: set canUsePlugins only on platforms that support plugin
+ 2025-12-15 9ba0948172 cmd/link: don't create __x86.get_pc_thunk symbol if it already exists
+ 2025-12-15 b7944a5f80 text/template: fix slice builtin for pointers to arrays
+ 2025-12-15 6713f46426 archive/tar, compress/bzip2: base64 some troublesome testdata files
+ 2025-12-15 388eb10f50 cmd/go: show comparable in go doc interface output
+ 2025-12-13 1b291b70df simd/archsimd: skip tests if AVX is not available
+ 2025-12-12 d30884ba1f cmd/dist: test GOEXPERIMENT=simd on AMD64
+ 2025-12-12 ee0275d15b runtime, cmd/link: tighten search for stackObjectRecord
+ 2025-12-12 63fced531c runtime/secret: restore goroutine behavior to proposal
+ 2025-12-12 6455afbc6f runtime: dropg after emitting trace event in preemptPark
+ 2025-12-12 8f45611e78 runtime/pprof: deflake TestGoroutineLeakProfileConcurrency
+ 2025-12-12 34af879dde cmd/link: add new linknames to blocked linkname list
+ 2025-12-12 8d31244562 runtime/secret: guard files with goexperiment
+ 2025-12-12 e8a83788a4 go/doc: reuse import name logic for examples
+ 2025-12-11 927c89bbc5 cmd/compile: update ABI document for riscv64
+ 2025-12-11 245bcdd478 runtime: add extra subtest layer to TestFinalizerOrCleanupDeadlock
+ 2025-12-11 ae62a1bd36 Revert "database/sql: allow drivers to override Scan behavior"
+ 2025-12-11 89614ad264 runtime/trace: fix broken TestSubscribers
+ 2025-12-11 bb2337f24c cmd/go: set GOOS in vet_asm test
+ 2025-12-11 2622d2955b go/types, types2: remove indirection of Named.finite
+ 2025-12-11 5818c9d714 encoding/json/jsontext: add symbolic Kind constants
+ 2025-12-11 9de6468701 json/jsontext: normalize all invalid Kinds to 0
+ 2025-12-11 00642ee23b encoding/json: report true from v2 Decoder.More when an error is pending
+ 2025-12-11 7b60d06739 lib/time: update to 2025c/2025c
+ 2025-12-11 1de9585be2 runtime: prevent calls to GOMAXPROCS while clearing P trace state
+ 2025-12-11 e38c38f0e5 internal/trace: correctly handle GoUndetermined for GoroutineSummary
+ 2025-12-11 c0ba519764 simd/archsimd: rename Mask.AsIntMxN to Mask.ToIntMxN
+ 2025-12-11 f110ba540c simd/archsimd: define ToMask only on integer vectors
+ 2025-12-11 1da0c29c2a simd/archsimd: add package doc
+ 2025-12-11 f105dfd048 lib/fips140: freeze v1.1.0-rc1 FIPS 140 module zip file
+ 2025-12-11 af14f67911 runtime: make goroutines inherit DIT state, don't lock to OS thread
+ 2025-12-11 72c83bcc80 go/types, types2: put Named.finite behind Named.mu
+ 2025-12-10 b2a697bd06 all: update to x/crypto@7dacc380ba00
+ 2025-12-10 fc66a5655b crypto: clean up subprocess-spawning tests
+ 2025-12-10 b130dab792 crypto/hpke: apply fips140.WithoutEnforcement to ML-KEM+X25519 hybrid
+ 2025-12-10 c39fe18fea crypto/mlkem/mlkemtest: error out in fips140=only mode
+ 2025-12-10 db0ab834d6 crypto/hpke: don't corrupt enc's excess capacity in DHKEM decap
+ 2025-12-10 cd873cf7e9 crypto/internal/fips140/aes/gcm: don't panic on bad nonces out of FIPS 140-3 mode
+ 2025-12-10 550c0c898b crypto/hpke: use new gcm.NewGCMForHPKE for FIPS 140-3 compliance
+ 2025-12-10 d349854de6 crypto/internal: ACVP test data migrated to Geomys repo
+ 2025-12-10 cd9319ff8e runtime: use correct function name in methodValueCallFrameObjs comment
+ 2025-12-10 0d71bd57c9 runtime: VZEROUPPER at the end of FilterNilAVX512
+ 2025-12-09 36bca3166e cmd: fix some issues in the comments
+ 2025-12-09 b9693a2d9a runtime: on AIX check isarchive before calling libpreinit
+ 2025-12-09 1274d58dac go/types, types2: add check for finite size at value observance
+ 2025-12-08 9e09812308 all: REVERSE MERGE dev.simd (c456ab7) into master
+ 2025-12-08 c456ab7a30 [dev.simd] all: merge master (a33bbf1) into dev.simd
+ 2025-12-08 1d8711e126 [dev.simd] internal/buildcfg: don't enable SIMD experiment by default
+ 2025-12-08 a33bbf1988 weak: fix weak pointer test to correctly iterate over weak pointers after GC
+ 2025-12-08 a88a96330f cmd/cgo: use doc link for cgo.Handle
+ 2025-12-08 276cc4d3db cmd/link: fix AIX builds after recent linker changes
+ 2025-12-08 f38e968aba [dev.simd] cmd/compile: zero only low 128-bit of X15
+ 2025-12-08 144cf17d2c [dev.simd] simd, cmd/compile: move "simd" to "simd/archsimd"
+ 2025-12-08 f2d96272cb runtime/trace: update TestSubscribers to dump traces
+ 2025-12-08 4837bcc92c internal/trace: skip tests for alloc/free experiment by default
+ 2025-12-08 b5f6816cea cmd/link: generate DWARF for moduledata
+ 2025-12-08 44a39c9dac runtime: only run TestNotInGoMetricCallback when building with cgo
+ 2025-12-08 3a6a034cd6 runtime: disable TestNotInGoMetricCallback on FreeBSD + race
+ 2025-12-08 4122d3e9ea runtime: use atomic C types with atomic C functions
+ 2025-12-08 34397865b1 runtime: deflake TestProfBufWakeup
+ 2025-12-08 3417b48b17 [dev.simd] simd: add carryless multiply
+ 2025-12-08 d4972f6295 runtime: mark getfp as nosplit
+ 2025-12-05 0d0d5c9a82 test/codegen: test negation with add/sub on riscv64
+ 2025-12-05 2e509e61ef cmd/go: convert some more tests to script tests
+ 2025-12-05 c270e71835 cmd/go/internal/vet: skip -fix on pkgs from vendor or non-main mod
+ 2025-12-05 f51ee08905 [dev.simd] simd: replace checking loops with call to slice-checker
+ 2025-12-03 2b91d96941 [dev.simd] internal/buildcfg: turn GOEXPERIMENT=simd back on
Cherry Mui [Mon, 15 Dec 2025 20:36:23 +0000 (15:36 -0500)]
cmd/link: set canUsePlugins only on platforms that support plugin
If a program imports the plugin package, but the plugin build mode
is not supported on the platform, it still cannot use plugin. Don't
treat it like so.
Updates #76815.
Change-Id: I0fd719427d7c3cc96a94ce1f92d6e4457da92a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/730164 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Cherry Mui [Mon, 15 Dec 2025 18:45:28 +0000 (13:45 -0500)]
cmd/link: don't create __x86.get_pc_thunk symbol if it already exists
On 386, in some build modes we need to create the __x86.get_pc_thunk
symbols, to support PC-relative addressing. In some situation
the thunk symbols may already exist, e.g. loaded from a C object
in internal linking mode. In this case, we should use the exiting
symbol instead of making a new one. The current code updates the
symbol content in place but also adds a duplicated entry to Textp,
which breaks the address sorting order.
Fixes #76815.
Change-Id: Iab11106ce592dc5219b7a0e07cfafcd270661a2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/730161 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Nathan Nguyen [Fri, 5 Dec 2025 20:50:24 +0000 (15:50 -0500)]
text/template: fix slice builtin for pointers to arrays
The slice function now properly handles pointers to arrays by calling
indirect() to dereference pointers, matching the behavior of the index
function.
Fixes #39596
Change-Id: Id4920edbfd8fd3df3a181b59a61733f88b0f104d
Reviewed-on: https://go-review.googlesource.com/c/go/+/727400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Ian Lance Taylor [Fri, 12 Dec 2025 22:18:13 +0000 (14:18 -0800)]
archive/tar, compress/bzip2: base64 some troublesome testdata files
This avoids complaints from scanners that look for and open
tar and bz2 files, and complain if they look weird.
In this case, they do look weird, because they are intentionally strange.
This kind of thing shouldn't be necessary, but we already have the machinery
to do it so it's easy enough.
Fixes #76799
Change-Id: Ib302b3aef30108a1325f91fcb2d166f8e1863792
Reviewed-on: https://go-review.googlesource.com/c/go/+/729780 Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Nathan Nguyen [Fri, 5 Dec 2025 08:25:33 +0000 (03:25 -0500)]
cmd/go: show comparable in go doc interface output
The go doc command now displays the comparable constraint when embedded
in an interface, matching the existing behavior for the error type.
Previously, when an interface embedded comparable, it was not shown in
the documentation and incorrectly triggered the "Has unexported methods"
message even when no unexported methods existed.
Fixes #76125
Change-Id: Idaae07fcb1dfc79b1fae374f9fc68df0052ff38e
Reviewed-on: https://go-review.googlesource.com/c/go/+/727100 Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Wed, 10 Dec 2025 02:56:45 +0000 (18:56 -0800)]
runtime, cmd/link: tighten search for stackObjectRecord
A stackObjectRecord should always be in funcdata, between gofunc
and the end of pclntab, except for the special case of
methodValueCallFrameObjs, which should always be in noptrbss.
Adjust the two loops that look for the moduledata corresponding
to a stackObjectRecord to search more precisely, rather than
relying on datap.end.
Closely based on a patch by Michael Stapelberg.
For #76038
Change-Id: I751801d8fd030af751825a67905b2a343280e7d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/728840 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Daniel Morsing [Wed, 10 Dec 2025 10:07:56 +0000 (10:07 +0000)]
runtime/secret: restore goroutine behavior to proposal
During review of CL 704615, a suggestion was made that spawning a
goroutine inside a call to secret.Do result in a panic. I agreed with
this at the time, but had missed that this had been extensively
discussed on the proposal. Revert the behavior back to what was agreed
upon.
Change-Id: Ifaa9e24bd03ecbd870ae2217137d1a9527c96842
Reviewed-on: https://go-review.googlesource.com/c/go/+/728920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Michael Anthony Knyszek [Thu, 11 Dec 2025 19:23:19 +0000 (19:23 +0000)]
runtime: dropg after emitting trace event in preemptPark
Because we dropg before emitting a trace event in preemptPark, we end up
failing to emit a status for the goroutine if this happens to be the
first event for it in the generation. We only really see this with
multiple subscribers in TestSubscribers.
This is for two reasons:
1. If we are missing a status event for a non-initial generation then
the trace parser won't validate that (an oversight, but we can only
enforce that for new traces because of this bug), and
2. If we're starting the tracer fresh, then we have a STW which
effectively guarantees that the first event for a goroutine cannot
come from preemptPark.
Therefore, we cannot observe this situation unless the first generation
manifests the bug, but prior to having flight recording and/or multiple
subscribers being able to "cut" the trace data at any point, this was
impossible.
The fix is simple: dropg only after emitting the trace event. This is
also safe, because the tracer doesn't care. The tracer will also start
taking a stack trace of the goroutine in this circumstance, but that is
also safe, since we are able to generally unwind the stack of
asynchronously preempted goroutines, and here we're at the very, very
end of asynchronous preemption where all the state to do so is already
set up.
Fixes #75665.
Change-Id: I7ee1142697d0a53b62d4c5647aa53775d2f6976a
Reviewed-on: https://go-review.googlesource.com/c/go/+/729400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Issue #76540 reports failures in this test from the leaked goroutine
count being too small. The test makes an effort to wait for the
goroutines to leak, but there's no guarantee.
This change instead changes TestGoroutineLeakProfileConcurrency to wait
for the number of leaked goroutines to reach at least the minimum
expected before proceeding. This deflakes this particular issue.
The downside of this change is that a failure to detect leaked
goroutines due to a bug will lead to a timeout instead of an instant
failure, but this change makes an effort to log and report that it was
waiting for the goroutines to leak and timed out for that reason, so at
least the failure is more obvious.
Overall, this is still better than random flakes.
While we're here, I also make some minor stylistic changes and document
the helper functions a little more. I also noticed that checkFrames was
using the wrong *testing.T, so this change fixes that too.
Fixes #76540.
Change-Id: I0508855dc39b91f8c6b72d059ce88dbfc68fe748
Reviewed-on: https://go-review.googlesource.com/c/go/+/729280 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Cherry Mui [Fri, 12 Dec 2025 18:00:54 +0000 (13:00 -0500)]
cmd/link: add new linknames to blocked linkname list
Update the blocklist with new linknames added in Go 1.26.
Some goroutine leak profile symbols were manually added but they
did not match the actual symbol names. Corrected.
runtime.freegc is not itself push-linknamed, so there is no need
to explicitly add it to blocklist. Keep the test, to ensure one
cannot linkname-pull freegc.
Change-Id: Ie5fd6bc191e9afa164fa79055cc39e6fa9ed4c7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/729720
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>