aboutsummaryrefslogtreecommitdiff
path: root/src/internal
AgeCommit message (Collapse)Author
2026-02-17internal/syscall/windows: add lpBytesReturned to DeviceIoControl callbobo liu
According to https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol, if lpOverlapped is NULL, then lpBytesReturned cannot be NULL. Even when an operation returns no output data and lpOutBuffer is NULL, DeviceIoControl makes use of lpBytesReturned. After such an operation, the value of lpBytesReturned is meaningless. This trivial change should help us avoid potential issues in the future. Change-Id: I10bfc2e4f66a0ea7db1c02ca6997b98481a520db GitHub-Last-Rev: e40773e88603e812850ef00c01bb1ce2b618c3fe GitHub-Pull-Request: golang/go#77539 Reviewed-on: https://go-review.googlesource.com/c/go/+/744282 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2026-02-17internal/syscall/windows: correct some enums and syscall signaturesMichal Pristas
This CL corrects code submitted in CL 741040. Fixes #77402 Change-Id: I1c22c1a9f77028f3c2a8e3905f2ec5b071b5445e GitHub-Last-Rev: 2bfb07310b4707484b5bdce96ad367db567741c4 GitHub-Pull-Request: golang/go#77525 Reviewed-on: https://go-review.googlesource.com/c/go/+/743780 Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <markfreeman@google.com>
2026-02-17crypto: don't overwrite existing GODEBUG settingsqmuntal
Some tests set GODEBUG by calling t.Setenv("GODEBUG", "foo=bar"). This overwrites any existing GODEBUG settings, which is undesirable. Instead, append the new setting to any existing GODEBUG settings. As this operation is quite common, add a helper function testenv.SetGODEBUG to do this. Change-Id: Ie7905483e87ec4c4a448511a7dd53c18939577fd Reviewed-on: https://go-review.googlesource.com/c/go/+/734400 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Mark Freeman <markfreeman@google.com>
2026-02-17internal/poll: readWriteLock should destroy the fd when there are no more ↵qmuntal
references to it The read lock in readWriteLock might be holding the last reference to the fd. If the fd is closed while the read lock is still held, then the fd will not be destroyed until the read lock is released and fd.destroy is called. The race windows is small and difficult to trigger on real workloads, but it has been observed in CI. Fixes #77609 Fixes #74754 (tentatively) Change-Id: I17be2d23dced1258e1a986c7359e27a81fc51c53 Reviewed-on: https://go-review.googlesource.com/c/go/+/745601 Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-13cmd/link: support PIE on linux/s390x without cgoGeorge Adams
Enable PIE builds on linux/s390x when CGO is disabled by teaching the linker to handle dynamic relocations against SDYNIMPORT symbols. This adds support for TLS_IE and handles R_CALL, R_PCRELDBL, and R_ADDR relocations by generating the appropriate PLT/GOT entries instead of rejecting them as unsupported. Fixes #77449 Cq-Include-Trybots: luci.golang.try:gotip-linux-s390x Change-Id: Ib6586780073fedbcbd42b9a2c554a99dd7386aa6 Reviewed-on: https://go-review.googlesource.com/c/go/+/742342 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-13doc: document the gotypesalias removalMateusz Poliwczak
Change-Id: I21a23870ba1917c72efaa6438f7cd32f6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/745280 Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Mateusz Poliwczak <mpoliwczak34@gmail.com>
2026-02-11internal/poll: simplify IOCP association checksqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. FD.pollable() obscures the fact that it is really checking if the handle is associated with the IOCP. This doesn't need to be a function that checks multiple conditions. It can be a simple boolean field that tracks whether the handle is associated with the IOCP or not. For #76391 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race Change-Id: I3ee6532f8a387fb5cfae8ae3d20ea9569f585e71 Reviewed-on: https://go-review.googlesource.com/c/go/+/742282 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
2026-02-11internal/poll: avoid race between execIO and DisassociateIOCPqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. There is a small race windows between execIO and DisassociateIOCP where execIO checks if the fd is disassociated before passing the operation to the OS. DisassociateIOCP can set the disassociated flag right after that check but before Windows started processing the IO operation. Once Windows takes over, the race doesn't matter anymore because Windows doesn't allow disassociating a handle that has pending IO operations. If that still hasn't happened, an overlapped IO operation will start assuming the they can be waited using the Go runtime IOCP, which is wrong due to the disassociation, leading to undefined behavior. Fix that race by trying to take a write/read lock in DisassociateIOCP before setting the disassociated flag, but failing if there is an ongoing execIO operation so that DisassociateIOCP doesn't block indefinitely waiting for execIO to finish. For #76391 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race Change-Id: Iec265fa1900383aace50051d2be750bc76aa0944 Reviewed-on: https://go-review.googlesource.com/c/go/+/741020 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2026-02-07internal/abi, runtime: put type descriptor sizes in internal/abiIan Lance Taylor
Change-Id: I4ecfda9f85b00a228e8cf51d7ff4457ef7f83ce5 Reviewed-on: https://go-review.googlesource.com/c/go/+/726160 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-06internal/bytealg: unexport {Last,}IndexRabinKarp helpersTobias Klauser
After CL 538737 these no longer need to be exported. They are only used in internal/bytealg and can be unexported. Change-Id: Idd405f397c7ec9f96425d2b7e0e74de61daa7a6e Reviewed-on: https://go-review.googlesource.com/c/go/+/741920 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2026-02-06internal/poll: move isBlocking checks to inside execIOqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. Having all isBlocking checks inside execIO will make it easier to delay getting that information until the first IO operation. It also makes the code simpler, as Pread and Pwrite now only modify the overlapped object offset, not the one in the FD struct, so they don't need to reverse the offset change after the IO operation. For #76391 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race Change-Id: Iea680c502c9417b9569a0b1a9da6f7e6bf916f6a Reviewed-on: https://go-review.googlesource.com/c/go/+/742283 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-06internal/poll: optimize socket completion modesqmuntal
FILE_SKIP_SET_EVENT_ON_HANDLE is always safe to use. FILE_SKIP_COMPLETION_PORT_ON_SUCCESS is safe as long as the socket is provided by an IFS provider. While here, stop using the kindFileNet type, it doesn't provide any value. Fixes #77448 Change-Id: Ib3dc0d68c7ff57b6a1f15f017e60a092e4b87f46 Reviewed-on: https://go-review.googlesource.com/c/go/+/742281 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>
2026-02-06internal/poll: make waitIO more idempontentqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. waitIO should use the overlapped event if it is provided, regardless of whether FD is pollable or not. This simplifies reasoning about the code and makes it more robust to race conditions. While here, remove the panic in waitIO that was triggered when called with a blocking handle. That shouldn't happen, but if it does, fd.pd.wait will return an error that will already be promoted to a panic. For #76391 Change-Id: I8e84592568a3ef66e71161eb2c5f515dde638117 Reviewed-on: https://go-review.googlesource.com/c/go/+/742280 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>
2026-02-06os: support deleting inaccessible files in RemoveAllMichal Pristas
windows: retry file open with DELETE access after access denied Additional access rights when opening files, including SYNCHRONIZE, break deletion when the caller has FILE_DELETE_CHILD on the parent directory but not the file. Retry with DELETE only restores correct Windows semantics. Fixes #77402 Change-Id: Ie53bc6f1673de1a8af4dcfb7496daf99e71098cb GitHub-Last-Rev: 0ad635cf1a13c0242e3b1922cf47a8c594dd7215 GitHub-Pull-Request: golang/go#77403 Reviewed-on: https://go-review.googlesource.com/c/go/+/741040 Reviewed-by: Quim Muntal <quimmuntal@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2026-02-04internal/stringslite: remove duplicate code in IndexОлег Световидов
Merge two nearly identical loops into one by selecting the fallback method (IndexString vs IndexRabinKarp) inside the loop based on whether n <= bytealg.MaxLen. Fixes #77364# Change-Id: Iefbef60922ca24e4dda3016127f54290096bcfed Reviewed-on: https://go-review.googlesource.com/c/go/+/741340 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-04internal/poll: unlock read lock if write lock fails in readWriteLockqmuntal
If the write lock acquisition fails, the read lock acquired earlier is not released, leading to a potential deadlock. The deadlock shouldn't occur because when the write lock fails, it indicates that the FD is closing, and no other goroutine should be holding the read lock. However, better to be safe and release the read lock in such cases. Change-Id: If593c36040a97357f835b42bb3133ff1dc55a638 Reviewed-on: https://go-review.googlesource.com/c/go/+/740560 Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-02-04cmd/go: rewrite cgo names to "C." in compiler error messagesIan Lance Taylor
We used to do this but it broke in Go 1.10. This restores the rewrite, but only applied to compiler output for packages that use cgo. That is all that the original rewrite applied to anyhow. Fixes #76339 Change-Id: Ife8ee858ddd0ff7bcc7423455b2eabf8381b7bde Reviewed-on: https://go-review.googlesource.com/c/go/+/721821 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: Roland Shoemaker <roland@golang.org>
2026-02-03internal/runtime: fix assembly for spectre retpoline instrumentationMichael Anthony Knyszek
In the last year we added two CALLs whose targets are loaded from memory. Change them to call from a register so that the instrumentation for spectre mitigations works. This change also adds a smoke test for the spectre build flags. For #77420. Change-Id: I35ec723449ff6a712bcce3276bf1df3fa932bddc Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/741541 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2026-02-03internal/poll: readWriteUnlock should destroy fd when no remaining referencesqmuntal
Fixes #77404 Change-Id: I0402becb94855baf942d6ba3815cc2a3c1526d6e Reviewed-on: https://go-review.googlesource.com/c/go/+/740921 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-02go/types, types2: add missing Named.unpack call in Checker.hasVarSizeMark Freeman
CL 734980 swapped use of Type.Underlying() in Checker.hasVarSize for traversal of Named.fromRHS. It forgot to call Named.unpack() before inspecting Named.fromRHS, allowing access of unexpanded instantiated types. These unexpanded instantiated types are then mistakenly marked as having fixed size, which fails assertions downstream. This change adds the missing Named.unpack() call and swaps direct access of Named.fromRHS for Named.rhs(), which verifies such access in debug mode. Fixes #77382 Change-Id: I324bbbbf790f8b09e95902ebe67f775483f88417 Reviewed-on: https://go-review.googlesource.com/c/go/+/740620 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02internal/maps,cmd/compile/internal/walk: replace calls to mapaccess1* with ↵ArsenySamoylov
mapaccess2* mapaccess1* and mapaccess2* functions share the same implementation and differ only in whether the boolean "found" is returned. This change replaces mapaccess1* calls with mapaccess2*. We can do this transparently, since the call site can safely discard the second (boolean) result. Ideally, mapacces1* functions could be removed entirely, but this change keeps them as thin wrappers for compatibility. Fixes #73196 Change-Id: I07c3423d22ed1095ac3666d00e134c2747b2f9c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/736020 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-02-02internal/poll: move buffer pinning inside execIOqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. The goal of this CL is to avoid the fd.isBlocking check in fd.pin, which was happening outside execIO, and making buffer pinning less error-prone. This also fixes an issue where buffer used in Pwrite and WriteTo were unpinned too early when the write buffer was larger than the maximum chunk size. For #76391 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race Change-Id: Ia181dcb57a559ae466a4341c36a307ad6678aac0 Reviewed-on: https://go-review.googlesource.com/c/go/+/740561 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>
2026-02-02internal/poll: consolidate cancelIO logic into waitIOqmuntal
This is a step towards deferring adding the handle to IOCP until the first IO operation. The main goal of this CL is to remove the fd.pollable() check in cancelIO. For #76391 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race Change-Id: I76263ce12980297d88a5f6c514e4074dfee428cb Reviewed-on: https://go-review.googlesource.com/c/go/+/740540 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2026-01-28cmd/compile, simd: capture VAES instructions and fix AVX512VAES featureJunyang Shao
The code previously filters out VAES-only instructions, this CL added them back. This CL added the VAES feature check following the Intel xed data: XED_ISA_SET_VAES: vaes.7.0.ecx.9 # avx.1.0.ecx.28 This CL also found out that the old AVX512VAES feature check is not checking the correct bits, it also fixes it: XED_ISA_SET_AVX512_VAES_128: vaes.7.0.ecx.9 aes.1.0.ecx.25 avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31 XED_ISA_SET_AVX512_VAES_256: vaes.7.0.ecx.9 aes.1.0.ecx.25 avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31 XED_ISA_SET_AVX512_VAES_512: vaes.7.0.ecx.9 aes.1.0.ecx.25 avx512f.7.0.ebx.16 It restricts to the most strict common set - includes avx512vl for even 512-bits although it doesn't requires it. Change-Id: I4e2f72b312fd2411589fbc12f9ee5c63c09c2e9a Reviewed-on: https://go-review.googlesource.com/c/go/+/738500 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27internal/runtime/gc/scan: include package in expandAVX512 symbol namesMichael Pratt
These symbols are part of the scan package, so they should include the package name in the symbol name for consistency. Change-Id: I6a6a636ca63b34a8da7fb2f0bfe1fa5f8672fff5 Reviewed-on: https://go-review.googlesource.com/c/go/+/738522 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27go/types, types2: add check for map value completeness in IndexExprMark Freeman
An index expression can also go from map[K]V to V. Since V could be incomplete (due to some admittedly contrived syntax), we need a check. Change-Id: I03ffbfc0e5bcc9129591d60dfbaa5fafcf8fb183 Reviewed-on: https://go-review.googlesource.com/c/go/+/737620 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <markfreeman@google.com>
2026-01-27go/types, types2: replace pendingType with completion checkMark Freeman
This change establishes the invariant that Underlying() cannot observe a nil RHS for a defined type, unless that type was created by go/types with an explicitly nil underlying type. It does so using isComplete, which is a guard to check that a type has an underlying type. This guard is needed whenever we could produce a value of a defined type or access some property of a defined type. Examples include T{}, *x (where x has type *T), T.x, etc. (see CL 734600 for more). The pendingType mechanism to deeply traverse values of a defined type is moved to hasVarSize, since this is only truly needed at the site of a built-in such as unsafe.Sizeof. This ties cycle detection across value context directly to the syntax, which seems like the right direction. Change-Id: Ic47862a2038fb2ba3ae6621e9907265ccbd86ea3 Reviewed-on: https://go-review.googlesource.com/c/go/+/734980 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <markfreeman@google.com>
2026-01-26internal/reflectlite: remove unused codekhr@golang.org
Change-Id: I87ae45657a9bae85b0fbf52692f15552a2987847 Reviewed-on: https://go-review.googlesource.com/c/go/+/738941 Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23internal/buildcfg: disable sizespecializedmalloc by defaultMichael Anthony Knyszek
We're finding some regressions in overall icache footprint at scale and we should figure out how to deal with those before rolling this out to everybody. Change-Id: I98e792db31712bf64575d76dfeafedb48898f76a Reviewed-on: https://go-review.googlesource.com/c/go/+/738780 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
2026-01-22go/types, types2: remove support for gotypesalias GODEBUG flagRobert Griesemer
For #76472. Change-Id: Ia51b41639637b1de916625e73c26f625382be305 Reviewed-on: https://go-review.googlesource.com/c/go/+/736441 Reviewed-by: Alan Donovan <adonovan@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 Griesemer <gri@google.com> Commit-Queue: Robert Griesemer <gri@google.com>
2026-01-22internal/runtime: remove math.Mul64Gavin Lam
internal/runtime/math.Mul64 is a copy of math/bits.Mul64 and redundant. Change-Id: I4dd2ab531a32da97839c6b45cf90df6430811967 GitHub-Last-Rev: 1a73e16049ee346ccfa8f052856e49e10e202d70 GitHub-Pull-Request: golang/go#77187 Reviewed-on: https://go-review.googlesource.com/c/go/+/736500 Auto-Submit: Keith Randall <khr@google.com> Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-21go/types, types2: better error when selecting field on type rather than valueRobert Griesemer
Fixes #6814. Change-Id: I659670998f8e89400d03d40189e8c54f7e705cdc Reviewed-on: https://go-review.googlesource.com/c/go/+/738040 Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-21internal/goversion: update Version to 1.27Carlos Amedee
Go 1.27 is in the process of being opened for development (to be eventually released). This change marks the very beginning of its development cycle, updating the Version value accordingly. For #40705. For #76474. Change-Id: Id64ac75e6727715c32a842501b4318281dd8998f Reviewed-on: https://go-review.googlesource.com/c/go/+/737960 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-15go/types,cmd/compile/internal/types2: better diagnostic for type shadowingAlan Donovan
This change causes the "x is not a type" diagnostic to describe x's actual kind, helping to reveal when shadowing is at work. (The kind description could improve other errors too.) Fixes #76877 Change-Id: Ia3484998bb384ff570c20b6792cf8461c60aa38c Reviewed-on: https://go-review.googlesource.com/c/go/+/731180 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com>
2026-01-15net/url: add urlmaxqueryparams GODEBUG to limit the number of query parametersDamien Neil
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-review.googlesource.com/c/go/+/736712 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-13simd/archsimd: 128- and 256-bit FMA operations do not require AVX-512Austin Clements
Currently, all FMA operations are marked as requiring AVX512, even on smaller vector widths. This is happening because the narrower FMA operations are marked as extension "FMA" in the XED. Since this extension doesn't start with "AVX", we filter them out very early in the XED process. However, this is just a quirk of naming: the FMA feature depends on the AVX feature, so it is part of AVX, even if it doesn't say so on the tin. Fix this by accepting the FMA extension and adding FMA to the table of CPU features. We also tweak internal/cpu slightly do it correctly enforces that the logical FMA feature depends on both the FMA and AVX CPUID flags. This actually *deletes* a lot of generated code because we no longer need the AVX-512 encoding of these 128- and 256-bit operations. Change-Id: I744a18d0be888f536ac034fe88b110347622be7e Reviewed-on: https://go-review.googlesource.com/c/go/+/736160 Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/736201 Reviewed-by: Austin Clements <austin@google.com>
2026-01-08internal/types: add test for cycles in value contextMark Freeman
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>
2025-12-29internal/coverage/decodemeta: correct wording in unknown version errorjjpinto
Correct the wording in the error message returned by readFileHeader when encountering a meta-data file with an unsupported version. Change-Id: I49be1bb1509ccc64e8384103bd7f19382b536c26 GitHub-Last-Rev: 2ab8e05a21443c45635e42d788946bec2478ca99 GitHub-Pull-Request: golang/go#76981 Reviewed-on: https://go-review.googlesource.com/c/go/+/732581 Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@golang.org>
2025-12-18internal/cpu: repair VNNI feature checkDavid Chase
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>
2025-12-11internal/trace: correctly handle GoUndetermined for GoroutineSummaryMichael Anthony Knyszek
Currently the trace summarization incorrectly handles GoUndetermined by treating it too much like GoNotExist. In particular, it should be accumulating all the time since the start of the trace in a particular bucket, but it doesn't, so that instead gets counted as "unknown time" because the "creation time" is at the start of the trace. This change fixes the problem by simply doing the accumulation. It's very straightforward. It also side-steps some other inaccuracies, like associating a goroutine that is being named with the current task. I don't think this can ever actually happen in practice, but splitting up the two cases, GoUndetermined and GoNotExist, fixes it. Fixes #76716. Change-Id: I3ac1557044f99c92bada2cb0e124b2192b1d6ebb Reviewed-on: https://go-review.googlesource.com/c/go/+/728822 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Nick Ripley <nick.ripley@datadoghq.com>
2025-12-11lib/fips140: freeze v1.1.0-rc1 FIPS 140 module zip fileFilippo Valsorda
Fixes #76769 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Change-Id: I16b0e9463e2e10ee5a6f20967fb6377b6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/729180 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: David Chase <drchase@google.com>
2025-12-10runtime: VZEROUPPER at the end of FilterNilAVX512Cherry Mui
VZEROUPPER at the end of FilterNilAVX512 as we're leaving AVX context. Also explicitly zero Z15, as the high bits are not guaranteed zero as of CL 728240. Change-Id: I000a199206d0b8fd4905c8a699e934551bbd3c60 Reviewed-on: https://go-review.googlesource.com/c/go/+/728740 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-09go/types, types2: add check for finite size at value observanceMark Freeman
Each type must be representable by a finite amount of Go source code after replacing all alias type names, value names, and embedded interfaces (per #56103) with the RHS from their respective declarations ("expansion"); otherwise the type is invalid. Furthermore, each type must have a finite size. Checking for finite source after expansion is handled in decl.go. Checking for finite size is handled in validtype.go and is delayed to the end of type checking (unless used in unsafe.Sizeof, in which case it is computed eagerly). We can only construct values of valid types. Thus, while a type is pending (on the object path and thus not yet valid), it cannot construct a value of its own type (directly or indirectly). This change enforces the indirect case by validating each type at value observance (and hence upholding the invariant that values of only valid types are created). Validation is cached on Named types to avoid duplicate work. As an example, consider: type A [unsafe.Sizeof(B{})]int type B A Clearly, since there are no aliases, A and B have finite source. At the site of B{}, B will be checked for finite size, recursing down the values of B, at which point A is seen. Since A is on the object path, there is a cycle preventing B from being proven valid before B{}, violating our invariant. Note that this change also works for generic types. Fixes #75918 Fixes #76478 Change-Id: I76d493b5da9571780fed4b3c76803750ec184818 Reviewed-on: https://go-review.googlesource.com/c/go/+/726580 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <markfreeman@google.com>
2025-12-08internal/trace: skip tests for alloc/free experiment by defaultMichael Anthony Knyszek
These tests are just too flaky and I don't have the time to fix them right now. I also am thinking to just change how trace experiments work, so it may not be worth taking the time to fix them. For #70838. Change-Id: Ia896215a0cbeccac99b73fefc836088f43530849 Reviewed-on: https://go-review.googlesource.com/c/go/+/728122 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-05crypto/subtle: add speculation barrier after DITRoland Shoemaker
When enabling DIT on ARM64, add speculation barrier instructions to ensure that subsequent instructions are executed using the updated DIT state. See https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Enable-DIT-for-constant-time-cryptographic-operations which recommends doing this. The Arm documentation for DIT doesn't tell you to do this, but it seems prudent. Change-Id: Idbc87b332650a77b8cb3509c11377bf5c724f3cf Reviewed-on: https://go-review.googlesource.com/c/go/+/726980 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-05internal/runtime/maps: clarify probeSeq doc commentNick Ripley
The probeSeq doc comment describes the probe sequence as triangular and gives the formula for terms in the sequence. This formula isn't actually used in the code, though. List the first few terms of the sequence explicitly so the connection between the description and the code is more clear. Change-Id: I6a6a69648bc94e15df436815c16128ebef3c6eb8 Reviewed-on: https://go-review.googlesource.com/c/go/+/726820 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-12-01internal/runtime/cgroup: remove duplicate readString definitionMichael Pratt
Both CL 723241 and CL 723581 added identical definitions. Change-Id: I6a6a636c9e5f8c9080b9389ebf9d3f10305d79ac Reviewed-on: https://go-review.googlesource.com/c/go/+/725661 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-01internal/runtime/cgroup: lineReader fuzz test胡玮文
The original unit test is converted to a fuzz test, to be more confident on future refactors. All sub-tests are converted to seed corpus. Change-Id: Id0c167ed47729a00ea0614d17746ddcc284697d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/723581 Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2025-11-26internal/runtime/cgroup: stricter unescapePath胡玮文
8 and 9 in escape sequence is invalid now, it should be octal. Escape sequence larger than \377 is invalid now, it does not fit one byte. Change-Id: I3fdebce1d054c44919f0e66a33c778b5a2b099e2 Reviewed-on: https://go-review.googlesource.com/c/go/+/723242 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2025-11-26internal/runtime/cgroup: fix path on non-root mount point胡玮文
We should trim the mount root (4th field in /proc/self/mountinfo) from cgroup path read from /proc/self/cgroup before appending it to the mount point. Non-root mount points are very common in containers with cgroup v1. parseCPURelativePath is renamed to parseCPUCgroup, as it is unclear what it is relative to. cgroups(7) says "This pathname is relative to the mount point of the hierarchy." It should mean the root of the hierarchy, and we cannot concat it to arbirary cgroup mount point. So just use the word cgroup, since it parses /proc/self/cgroup. It now returns errMalformedFile if the cgroup pathname does not start with "/", and errPathTooLong if the pathname can't fit into the buffer. We already rely on this when composing the path, just make this explicit to avoid incorrect paths. We now parse cgroup first then parse the mount point accordingly. We consider the previously read cgroup pathname and version to ensure we got the desired mount point. The out buffer is reused to pass in the cgroup, to avoid extra memory allocation. This should also resolve the race mentioned in the comments, so removing those comments. If our cgroup changed between the two read syscalls, we will stick with the cgroup read from /proc/self/cgroup. This is the same behavior as cgroup change after FindCPU() returns, so nothing special to comment about now. parseCPUMount now returns error when the combined path is too long, to avoid panic or truncation if we got a really long path from mountinfo. cgrouptest is changed to use dev returned from stat() to detect filesystem boundary, since we don't return mount point and sub-path separately now. This also avoid using os.Root since we don't handle untrusted input here. os.Root is too complex, and the performance is bad. Fixes #76390 Change-Id: Ia9cbd7be3e58a2d51caf27a973fbd201dac06afc Reviewed-on: https://go-review.googlesource.com/c/go/+/723241 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.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>