Robert Griesemer [Mon, 24 Feb 2025 23:00:55 +0000 (15:00 -0800)]
go/types, types2: remove coreType call in lookup
For #70128.
Change-Id: I7d16ad7fdc6b07a2632b4eaefaedfa2bcceffe1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/652215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Robert Griesemer [Mon, 24 Feb 2025 22:47:30 +0000 (14:47 -0800)]
go/types, types2: remove another coreType call in type checking range clause
For #70128.
Change-Id: I5949bccbfaaebc435ae8ac7c70580d9740de6f00
Reviewed-on: https://go-review.googlesource.com/c/go/+/652136
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Robert Griesemer [Fri, 21 Feb 2025 00:23:11 +0000 (16:23 -0800)]
go/types, types2: better error messages for calls
Provide the exact error cause instead of reporting a missing
core type.
For #70128.
Change-Id: I34bd401115742883cb6aef7997477473b2464abb
Reviewed-on: https://go-review.googlesource.com/c/go/+/651256 Reviewed-by: Robert Griesemer <gri@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 Findley <rfindley@google.com>
Robert Griesemer [Thu, 20 Feb 2025 23:01:36 +0000 (15:01 -0800)]
go/types, types2: better error messages for for-range clauses
Provide the exact error cause instead of reporting a missing
core type.
For #70128.
Change-Id: I835698fa1f22382711bd54b974d2c87ee17e9065
Reviewed-on: https://go-review.googlesource.com/c/go/+/651215 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Jes Cok [Mon, 24 Feb 2025 13:05:31 +0000 (13:05 +0000)]
strconv: use builtin min function in commonPrefixLenIgnoreCase
To make code a bit simpler.
Change-Id: I33b3e04bc810a4838584c477854ef612b355579a
GitHub-Last-Rev: 6d5bbc2a2877193e1319b9e626f408eda399666e
GitHub-Pull-Request: golang/go#71927
Reviewed-on: https://go-review.googlesource.com/c/go/+/651975 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Ian Lance Taylor [Thu, 20 Feb 2025 20:12:35 +0000 (12:12 -0800)]
net: accept a valid IP address in LookupMX
Fixes #56025
Change-Id: I202fdd0e11afeb22c5bc22d91fe4bfea8987e727
Reviewed-on: https://go-review.googlesource.com/c/go/+/651056 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qmuntal [Mon, 24 Feb 2025 08:43:41 +0000 (09:43 +0100)]
all: use testenv.Executable instead of os.Executable and os.Args[0]
In test files, using testenv.Executable is more reliable than
os.Executable or os.Args[0].
Change-Id: I88e577efeabc20d02ada27bf706ae4523129128e
Reviewed-on: https://go-review.googlesource.com/c/go/+/651955 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Harald Nordgren [Sun, 23 Feb 2025 10:43:23 +0000 (10:43 +0000)]
net/http: remove unused err parameter from cancel
Change-Id: I91f1b93298671bcb2aa5f86a59f5794bd3e3b2a9
GitHub-Last-Rev: f2e7ffb45f7b201381e1f1a3018b523dea4249f8
GitHub-Pull-Request: golang/go#71911
Reviewed-on: https://go-review.googlesource.com/c/go/+/651220
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Olivier Mengué [Sun, 23 Feb 2025 09:55:29 +0000 (10:55 +0100)]
net: add godoc links for UnixConn, UnixListener
Change-Id: I8f332eb14c0ce4f31a2e0f44ddd227769d7b940f
Reviewed-on: https://go-review.googlesource.com/c/go/+/651875
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Albert Sundjaja [Sat, 22 Feb 2025 23:02:57 +0000 (23:02 +0000)]
syscall: allow \x00-prefixed unix abstract socket to use full path length
Fixes #70893
Change-Id: Ia0aaa497dad335fe962d52d3f115d26e8046e36f
GitHub-Last-Rev: 7dd663678d8aecdfac94541a570dfbd1aa2577e7
GitHub-Pull-Request: golang/go#71851
Reviewed-on: https://go-review.googlesource.com/c/go/+/650875 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Joel Sing [Wed, 4 Sep 2024 14:01:52 +0000 (00:01 +1000)]
cmd/compile/internal/ssa: correct MOVDnop handling for arm64
The extension-removing rules for ARM64 were moved to late lower in
CL 568616. This means that the late lower pass can now generate
MOVDreg, however the rules that potentially eliminate MOVDreg only
exist in the earlier pass. Fix this by duplicating the MOVDreg/NOVDnop
rules in late lower, such that we can potentially eliminate conversions.
Removes 400+ instructions from the Go binary on openbsd/arm64.
Change-Id: I14aad06b994c9179f3ecdda566629793ba167511
Reviewed-on: https://go-review.googlesource.com/c/go/+/651819
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Joel Sing [Sat, 22 Feb 2025 13:22:23 +0000 (00:22 +1100)]
cmd/compile: remove carriage returns from AMD64latelower.rules
AMD64latelower.rules currently has Windows style line endings,
rather than Unix style line endings. Correct this.
Change-Id: Ie068dc6c64bd51cf2aa5bd192839fca4f28f40b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/651818
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: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Dmitrii Martynov [Thu, 30 Jan 2025 18:48:17 +0000 (21:48 +0300)]
runtime: exclude allocation(s) from memmove/memclr benchmarking
The overhead for allocation is not significant but it should be excluded
from the memmove/memclr benchmarking anyway.
Change-Id: I7ea86d1b85b13352ccbff16f7510caa250654dab
Reviewed-on: https://go-review.googlesource.com/c/go/+/645576
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Than McIntosh [Wed, 11 Dec 2024 18:15:27 +0000 (13:15 -0500)]
cmd: initial compiler+linker support for DWARF5 .debug_addr
This patch rolls the main .debug_info DWARF section from version 4 to
version 5, and also introduces machinery in the Go compiler and linker
for taking advantage of the DWARF5 ".debug_addr" section for
subprogram DIE "high" and "low" PC attributes. All functionality is
gated by GOEXPERIMENT=dwarf5.
For the compiler portion of this patch, we add a new DIE attribute
form "DW_FORM_addrx", which accepts as an argument a function (text)
symbol. The dwarf "putattr" function is enhanced to handle this
format by invoking a new dwarf context method "AddIndirectTextRef".
Under the hood, this method invokes the Lsym method WriteDwTxtAddrx,
which emits a new objabi.R_DWTXTADDR_* relocation. The size of the
relocation is dependent on the number of functions in the package; we
pick a size that is just big enough for the largest func index.
In the linker portion of this patch, we now switch over to writing out
a version number of 5 (instead of 4) in the compile unit header (this
is required if we want to use addrx attributes). In the parallel portion
of DWARF gen, within each compilation unit we scan subprogram DIEs to
look for R_DWTXTADDR_* relocations, and when we find such a reloc,
we assign a slot in the .debug_addr section for the func targeted.
After the parallel portion is complete, we then walk through all of the
compilation units to assign a value to their DW_AT_addr_base attribute,
which points to the portion of the single .debug_addr section containing
the text addrs for that compilation unit.
Note that once this patch is in, programs built with GOEXPERIMENT=dwarf5
will have broken/damaged DWARF info; in particular, since we've changed
only the CU and subprogram DIEs and haven't incorported the other
changes mandated by DWARF5 (ex: .debug_ranges => .debug_rnglists)
a lot of the variable location info will be missing/incorrect. This
will obviously change in subsequent patches.
Note also that R_DWTXTADDR_* can't be used effectively for lexical
scope DIE hi/lo PC attrs, since there isn't a viable way to encode
"addrx + constant" in the attribute value (you would need a new entry
for each attr endpoint in .debug_addr, which would defeat the point).
Updates #26379.
Change-Id: I2dfc45c9a8333e7b2a58f8e3b88fc8701fefd006
Reviewed-on: https://go-review.googlesource.com/c/go/+/635337
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Than McIntosh [Fri, 6 Dec 2024 00:01:22 +0000 (19:01 -0500)]
cmd/internal/objabi,cmd/link/internal/sym: add SDWARFADDR symbol type
Add a new symbol type: SDWARFADDR. This kind of symbol stores content
to be added to the DWARF .debug_addr section (new with DWARF5). At the
moment these symbols are created only in the linker, but it's not hard to
imagine other implementations in which the compiler would create them,
so they are added to both the compiler and linker symbol kind space.
Updates #26379.
Change-Id: I4a82ead0d59fe6028abfd6d6e3fc3df2e28c0ef6
Reviewed-on: https://go-review.googlesource.com/c/go/+/634415 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Than McIntosh [Tue, 26 Nov 2024 22:08:01 +0000 (17:08 -0500)]
cmd/internal/objabi: add new R_DWTXTADDR_* relocation types
Add a set of new relocations to be used when the compiler is writing
debug information using DWARF version 5. No changes in compiler or
linker functionality, this patch just adds the relocations themselves
and some helper functions; uses will appear in a later patch. These
relocations are generated by the compiler when writing a DWARF DIE
attribute of form DW_FORM_addrx, or when writing a .debug_addr index
reference in a SDWARFRANGE or SDWARFLOC section. The target symbol of
the relocation is a function (STEXT symbol); the linker resolves the
relocation by replacing the target of the reloc with an index of a
slot in the .debug_addr section (.debug_addr is new with DWARF5).
Updates #26379.
Change-Id: I43c587d25d0836972dac487d09c8924d77345f4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/633880
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com>
Than McIntosh [Tue, 12 Nov 2024 17:02:17 +0000 (12:02 -0500)]
cmd/link, cmd/internal/dwarf: add DWARF5 line table support
This patch rolls out the necessary changes to migrate the DWARF line
table support in the compiler and linker to DWARF version 5, gated by
the "dwarf5" GOEXPERIMENT.
DWARF version 5 includes a number of changes to the line table,
notably a revamped prolog section and a change in the indexing system
used to refer to files and directories within the line table
program. Specifically, prior to DWARF 4 a compilation's directory
table was considered to have an implicit zero entry containing the
compilation directory of the translation unit (package), and the file
table was considered to have an implicit zero entry storing the
"primary source file" (stored in the compilation unit DIE name).
DWARF 5 does away with these implicity entries meaning that files and
dirs are now effectively a 0-based index.
Updates #26379.
Change-Id: I9b4f1be5415aacec1ba57366d60bd48819c56ea5
Reviewed-on: https://go-review.googlesource.com/c/go/+/633879 Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Than McIntosh [Mon, 18 Nov 2024 16:23:39 +0000 (11:23 -0500)]
cmd/internal/dwarf: add DW_LNCT and DW_UT constant definitions
Add a set of constants for the DWARF version 5 line table content
description values found in the V5 line table prolog, and for the
new DWARF unit type encodings.
Updates #26379.
Change-Id: I8f4989ea6b6cbb303deda1a6a20ad243d73b46b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/633878 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Than McIntosh [Sun, 17 Nov 2024 18:20:17 +0000 (13:20 -0500)]
cmd/link, cmd/internal/objabi: remove R_DWARFFILEREF relocation type
Get rid of the R_DWARFFILEREF relocation type -- we have not used this
relocation for a while now, ever since jfaller's revamp of the DWARF
line table file section in Go 1.15. No change in compiler or linker
functionality; this is purely a dead code cleanup.
Change-Id: I178760c87f3aa79694cfabe7364ca382605c6975
Reviewed-on: https://go-review.googlesource.com/c/go/+/633876 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Fri, 21 Feb 2025 06:20:38 +0000 (22:20 -0800)]
cmd/go: look at runes, not bytes, when printing env vars
For #58508
Fixes #71863
Change-Id: Ib1ebaf751bcc6900da6ffd01a9462dd237e2c89a
Reviewed-on: https://go-review.googlesource.com/c/go/+/651295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Julian Zhu [Fri, 21 Feb 2025 08:48:07 +0000 (16:48 +0800)]
internal/runtime/atomic: add Xchg8 for mipsx
For #69735
Change-Id: I2a0336214786e14b9a37834d81a0a0d14231451c
Reviewed-on: https://go-review.googlesource.com/c/go/+/651315 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@google.com>
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>
Change-Id: Id5ddbea0d080e2903156ef8dc86c030a8179115b
Reviewed-on: https://go-review.googlesource.com/c/go/+/650995 Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Filippo Valsorda [Wed, 19 Feb 2025 21:41:59 +0000 (22:41 +0100)]
crypto/internal/fips140/nistec: make SetBytes constant time
Similarly to CL 648035, SetBytes doesn't need to be constant time for
the uses we make of it in the standard library (ECDH and ECDSA public
keys), but it doesn't cost much to make it constant time for users of
the re-exported package, or even just to save the next person from
convincing themselves that it's ok for it not to be constant time.
Change-Id: I6a6a465622a0de08d9fc71db75c63185a82aa54a
Reviewed-on: https://go-review.googlesource.com/c/go/+/650579
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Michael Anthony Knyszek [Fri, 21 Feb 2025 15:53:51 +0000 (15:53 +0000)]
reflect: correctly handle method values in Seq
Currently method values aren't correctly handled in Seq because we call
canRangeFunc on the reciever type, not the method value type, when we're
handling a method value. reflect.Value.Type has the logic to obtain the
method value type from the Value.
This change slightly refactors reflect.Value.Type into a separate
function so we can obtain the correct type as an abi.Type and pass it
off to canRangeFunc (and canRangeFunc2).
Fixes #71874.
Change-Id: Ie62dfca2a84b8f2f816bb87ff1ed1a58a7bb8122
Reviewed-on: https://go-review.googlesource.com/c/go/+/651416
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Michael Pratt [Fri, 21 Feb 2025 15:29:09 +0000 (10:29 -0500)]
runtime: use WCLONE when waiting on pidfd test child
As of CL 650835, the pidfd test child no longer sends SIGCHLD on exit.
Per clone(2), "If [the child termination] signal is specified as
anything other than SIGCHLD, then the parent process must specify the
__WALL or __WCLONE options when waiting for the child with wait(2)."
Align with this requirement.
For #71828.
Change-Id: I6a6a636c739e4a59abe1533fe429a433e8588939
Reviewed-on: https://go-review.googlesource.com/c/go/+/651415 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qmuntal [Thu, 20 Feb 2025 17:31:42 +0000 (18:31 +0100)]
os: don't log the entire environment in tests
TestEnvironConsistency logs the values of all the environment variables,
which can be quite large on some environments. This change limits the
output to just the variables that caused the test to fail.
Change-Id: Ie796b57ac2cc845093c73298058b720df344fa28
Reviewed-on: https://go-review.googlesource.com/c/go/+/650581 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Thomas Vaillant [Thu, 20 Feb 2025 22:33:45 +0000 (22:33 +0000)]
doc: add a disclamer for the TLS handshake timeouts TL;DR bug in godebug.md
Relates to #71257. Since post-quantum TLS algorithms are enabled by default, we should warn about the possible bugs with legacy servers (see https://tldr.fail/)
Change-Id: I06a5d8a927497ea2141007b14a90af27e0891720
GitHub-Last-Rev: 476e6462dfc7db8c2a47a25dcb7eb342264aabad
GitHub-Pull-Request: golang/go#71865
Reviewed-on: https://go-review.googlesource.com/c/go/+/651036 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Pratt [Thu, 20 Feb 2025 19:42:19 +0000 (14:42 -0500)]
debug/buildinfo: base64-encode test binaries
Overzealous security scanners don't like the Go 1.17 binary because they
think it has every 1.17 security vulnerability. base64-encode the binary
to hide from them.
I've also extended the instructions to make the binary easier to
reproduce.
Since we do the Go binary, we might as well do the C binary too, as it
apparently makes some virus scanners unhappy.
Fixes #71753.
For #71734.
For #71821.
Change-Id: I6a6a636cccbf5312522f52f27f74eded64048fb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/651175
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Cherry Mui [Sun, 16 Feb 2025 21:31:22 +0000 (16:31 -0500)]
cmd/compile: remove residual register GC map code
We used to generate register GC maps as an experimental approach
for asynchronous preemption, which later we chose not to take.
Most of the register GC map code are already removed. One
exception is that the ssa.Register type still contains a field
for the register map index. Remove it.
Change-Id: Ib177ebce9548aa5ffbcaedd4b507240ea7df8afe
Reviewed-on: https://go-review.googlesource.com/c/go/+/651076 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Julian Zhu [Tue, 26 Nov 2024 09:14:45 +0000 (17:14 +0800)]
internal/runtime/atomic: add Xchg8 for mips64x
For #69735
Change-Id: Ide6b3077768a96b76078e5d4f6460596b8ff1560
Reviewed-on: https://go-review.googlesource.com/c/go/+/631756 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Jorropo [Thu, 20 Feb 2025 10:50:53 +0000 (11:50 +0100)]
cmd/compile: don't report newLimit discovered when unsat happens multiple times
Fixes #71852
Change-Id: I696fcb8fc8c0c2e5e5ae6ab50596f6bdb9b7d498
Reviewed-on: https://go-review.googlesource.com/c/go/+/650975
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Ian Lance Taylor [Thu, 20 Feb 2025 01:37:49 +0000 (17:37 -0800)]
syscall: don't send child signal when testing pidfd
Avoid a spurious SIGCHLD the first time we start a process.
Fixes #71828
Change-Id: I744100d21bf6aaaaafc99bc5eec9f9f807a50682
Reviewed-on: https://go-review.googlesource.com/c/go/+/650835
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Joel Sing [Fri, 7 Feb 2025 10:12:05 +0000 (21:12 +1100)]
internal/bytealg: clean up and simplify the riscv64 equal implementation
Now that riscv64 is only regabi, remove the entrypoint separation and
have runtime.memequal_varlen call runtime.memequal. Add a zero byte
length check and replace the equal and not equal exit paths with a
single exit path that conditions on length reaching zero.
Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Change-Id: Ida4e54378daa7fd423f759753eba04ce513a27cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/648855 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Joel Sing [Fri, 14 Jun 2024 15:29:32 +0000 (01:29 +1000)]
cmd/internal/obj/x86: add support for the endbr64 instruction on amd64
Add support for endbr64, which terminates an indirect branch in 64-bit
mode. This is effectively used to mark locations where an indirect branch
is permitted to land, when Indirect Branch Tracking (IBT) is enforced on
Intel CPUs.
Updates #66054
Change-Id: Ib898031711cfaaa6e05c197bfe727ded0bce6f52
Reviewed-on: https://go-review.googlesource.com/c/go/+/649215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Roland Shoemaker [Wed, 19 Feb 2025 22:27:33 +0000 (14:27 -0800)]
crypto/tls: improve ech parsing errors
Make the errors we return when parsing an ECHConfig slightly more
verbose.
Fixes #71706
Change-Id: Id138fd9defec71ce492a490a71af4981cb9ede51
Reviewed-on: https://go-review.googlesource.com/c/go/+/650720
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Change-Id: Id689ec476eb3f76500dbf59d716a4376749de700
Reviewed-on: https://go-review.googlesource.com/c/go/+/650719 Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Daniel Martí [Wed, 19 Feb 2025 22:35:48 +0000 (22:35 +0000)]
go/*: use go/types.Func.Signature and go/ast.Preorder
In the few obvious candidates that I found after a bit of grepping.
Change-Id: I36af79c46d29e4422bce1f43bbbac9db7de2001a
Reviewed-on: https://go-review.googlesource.com/c/go/+/650656 Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I8d7bbeebbf4a46f2fd8d630b1edbaf79b8ffccc5
Reviewed-on: https://go-review.googlesource.com/c/go/+/420114 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
TryBot-Bypass: Joel Sing <joel@sing.id.au>
Julian Zhu [Mon, 25 Nov 2024 14:08:41 +0000 (22:08 +0800)]
internal/runtime/atomic: add Xchg8 for riscv64
For #69735
Change-Id: I34ca2b027494525ab64f94beee89ca373a5031ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/631615 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Pratt [Mon, 27 Jan 2025 21:50:35 +0000 (16:50 -0500)]
internal/poll: note that copy_file_range bug is fixed
We shouldn't drop the workaround in case we're running on an unpatched
kernel.
For #44272.
Change-Id: I6a6a636cb81c31856ac9b682e7d02fa1d8efa5d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/644878 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Michael Anthony Knyszek [Tue, 18 Feb 2025 22:32:00 +0000 (22:32 +0000)]
runtime: minor mfinal.go code cleanup
This change moves finBlockSize into mfinal.go and renames finblock to
finBlock.
Change-Id: I20a0bc3907e7b028a2caa5d2fe8cf3f76332c871
Reviewed-on: https://go-review.googlesource.com/c/go/+/650695
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Fri, 14 Feb 2025 18:39:29 +0000 (18:39 +0000)]
weak: accept linker-allocated objects to Make
Currently Make panics when passed a linker-allocated object. This is
inconsistent with both runtime.AddCleanup and runtime.SetFinalizer. Not
panicking in this case is important so that all pointers can be treated
equally by these APIs. Libraries should not have to worry where a
pointer came from to still make weak pointers.
Supporting this behavior is a bit complex for weak pointers versus
finalizers and cleanups. For the latter two, it means a function is
never called, so we can just drop everything on the floor. For weak
pointers, we still need to produce pointers that compare as per the API.
To do this, copy the tiny lock-free trace map implementation and use it
to store weak handles for "immortal" objects. These paths in the
runtime should be rare, so it's OK if it's not incredibly fast, but we
should keep the memory footprint relatively low (at least not have it be
any worse than specials), so this change tweaks the map implementation a
little bit to ensure that's the case.
Fixes #71726.
Change-Id: I0c87c9d90656d81659ac8d70f511773d0093ce27
Reviewed-on: https://go-review.googlesource.com/c/go/+/649460 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>
Rob Findley [Wed, 19 Feb 2025 21:27:21 +0000 (21:27 +0000)]
go/types,types2: remove some unused parameters and results (cleanup)
This CL is the result of pulling the thread of some unused parameter
diagnostics reported by gopls: remove some variables holding partial
type argument expression information that are no longer needed.
Change-Id: Idfc1d0271252ce9bc5b75feb86e30dd2f6dd550b
Reviewed-on: https://go-review.googlesource.com/c/go/+/650775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Dan Peterson [Thu, 13 Feb 2025 21:09:23 +0000 (17:09 -0400)]
cmd/go/internal/cacheprog: drop Request.ObjectID
ObjectID was a misnaming of OutputID from cacheprog's initial
implementation. It was maintained for compatibility with existing
cacheprog users in 1.24 but can be removed in 1.25.
Updates #64876
Change-Id: I8ff53bc581c16b7739e1cfbaa8bd35d285d3231d
Reviewed-on: https://go-review.googlesource.com/c/go/+/649435 Reviewed-by: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
alirezaarzehgar [Wed, 19 Feb 2025 16:17:14 +0000 (19:47 +0330)]
html/template: add available godoc link
Change-Id: I50404dbf0f10ee59007bd0dc5353f38e056a0430
Reviewed-on: https://go-review.googlesource.com/c/go/+/650655 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Mateusz Poliwczak [Sun, 16 Feb 2025 17:24:19 +0000 (17:24 +0000)]
cmd/compile: load properly constant values from itabs
While looking at the SSA of following code, i noticed
that these rules do not work properly, and the types
are loaded indirectly through an itab, instead of statically.
Mateusz Poliwczak [Mon, 17 Feb 2025 11:29:04 +0000 (11:29 +0000)]
cmd/compile: determine static values of len and cap in make() calls
This change improves escape analysis by attempting to
deduce static values for the len and cap parameters,
allowing allocations to be made on the stack.
Change-Id: I1161019aed9f60cf2c2fe4d405da94ad415231ac
GitHub-Last-Rev: d78c1b4ca55fa53282e665009f689d0b013f1434
GitHub-Pull-Request: golang/go#71693
Reviewed-on: https://go-review.googlesource.com/c/go/+/649035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
qiulaidongfeng [Thu, 13 Feb 2025 17:07:54 +0000 (01:07 +0800)]
go/parser: deprecate parser.ParseDir
Fixes #71122
Change-Id: Icaf27842f4a42e11eea4bd2203eba5d56610c196
Reviewed-on: https://go-review.googlesource.com/c/go/+/649275 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
The go command assumes that GOMODCACHE is immutable. As an example of
one place the assumption is made, the modindex won't stat the files in
GOMODCACHE when getting the cache key for the index entry and just uses
the path of the module in the modcache (basically the module's name and
version). Explicitly reject overlays affecting GOMODCACHE to avoid
surprising and incorrect behavior.
For #71783
For #71075
Change-Id: I21dd5d39d71037de473b09ac8482a1867864e11f
Reviewed-on: https://go-review.googlesource.com/c/go/+/650475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Jes Cok [Wed, 19 Feb 2025 15:07:53 +0000 (15:07 +0000)]
bytes,strings: remove redundant return statement for Lines
To make it more idiomatic.
Change-Id: If48ae9931908e515df7f23185aac6f84aac72084
GitHub-Last-Rev: 525ed5031a08388f637bd2a09bd47c9e25df21f1
GitHub-Pull-Request: golang/go#71838
Reviewed-on: https://go-review.googlesource.com/c/go/+/650595
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>
Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>
qmuntal [Wed, 19 Feb 2025 15:05:48 +0000 (16:05 +0100)]
path/filepath: use RtlIsDosDeviceName_U to detect Windows devices
RtlIsDosDeviceName_U is specifically designed to detect Windows devices.
We were using GetFullPathName to do this, but it's not the right API
for the job, as it is slower and allocates more memory.
goos: windows
goarch: amd64
pkg: path/filepath
cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
IsLocal-12 5.685µ ± 59% 1.853µ ± 12% -67.41% (p=0.000 n=10)
David Chase [Tue, 18 Feb 2025 22:34:24 +0000 (17:34 -0500)]
cmd/compile, runtime: use deferreturn as target PC for recover from deferrangefunc
The existing code for recover from deferrangefunc was broken in
several ways.
1. the code following a deferrangefunc call did not check the return
value for an out-of-band value indicating "return now" (i.e., recover
was called)
2. the returned value was delivered using a bespoke ABI that happened
to match on register-ABI platforms, but not on older stack-based
ABI.
3. the returned value was the wrong width (1 word versus 2) and
type/value(integer 1, not a pointer to anything) for deferrangefunc's
any-typed return value (in practice, the OOB value check could catch
this, but still, it's sketchy).
This -- using the deferreturn lookup method already in place for
open-coded defers -- turned out to be a much-less-ugly way of
obtaining the desired transfer of control for recover().
TODO: we also could do this for regular defer, and delete some code.
Fixes #71675
Change-Id: If7d7ea789ad4320821aab3b443759a7d71647ff0
Reviewed-on: https://go-review.googlesource.com/c/go/+/650476
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
qmuntal [Tue, 18 Feb 2025 10:55:07 +0000 (11:55 +0100)]
syscall: don't truncate newly created files on Windows
There is no need for syscall.OpenFile to truncate newly created files.
Some special Windows files, like the NUL device, can't be
truncated, so we should avoid truncating unless it is really necessary.
Fixes #71752.
Change-Id: I8238048594f706f6a5281053d55cfe3dc898828d
Reviewed-on: https://go-review.googlesource.com/c/go/+/650276
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Cuong Manh Le [Fri, 14 Feb 2025 20:00:27 +0000 (03:00 +0700)]
cmd/compile: avoid infinite recursion when inlining closures
CL 630696 changes budget for once-called closures, making them more
inlinable. However, when recursive inlining involve both the closure and
its parent, the inliner goes into an infinite loop:
parent (a closure) -> closure -> parent -> ...
The problem here dues to the closure name mangling, causing the inlined
checking condition failed, since the closure name affects how the
linker symbol generated.
To fix this, just prevent the closure from inlining its parent into
itself, avoid the infinite inlining loop.
Fixes #71680
Change-Id: Ib27626d70f95e5f1c24a3eb1c8e6c3443b7d90c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/649656 Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Mateusz Poliwczak [Tue, 18 Feb 2025 20:40:58 +0000 (20:40 +0000)]
cmd/compile/internal/ir: reduce size of miniExpr by 8 bytes
By moving the bit field, we can reduce the miniExpr size by
8 bytes, reducing the sizes of Exprs embedding this type.
Hopefully we get a few types to a lower memory size class.
Change-Id: I4b1d4471cf905f998b26d235980e40ca91446f45
GitHub-Last-Rev: 6dea0bd27c38d9118d13d55052efcb4070b26751
GitHub-Pull-Request: golang/go#71823
Reviewed-on: https://go-review.googlesource.com/c/go/+/650435
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
段仪 [Tue, 18 Feb 2025 18:01:45 +0000 (18:01 +0000)]
runtime: add some linknames back for `github.com/bytedance/sonic`
Add some linknames back, therefore sonic (github.com/bytedance/sonic) can work correctly.
Fixes #71672
Change-Id: Iae86c837d8a714855106a26766aa08b128e17e58
GitHub-Last-Rev: 4de0a4871766f9e7763394fdcdcaa9d683e97987
GitHub-Pull-Request: golang/go#71673
Reviewed-on: https://go-review.googlesource.com/c/go/+/648537 Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Damien Neil [Tue, 18 Feb 2025 17:36:14 +0000 (09:36 -0800)]
os: document that OpenRoot follows symlinks
OpenRoot is expected to be called with a trusted path,
and does not attempt to defend against symlinks in that path.
Fixes #71806
Change-Id: Ib8b2e123e323d22d5c23ed9f711d21995139a7ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/650355
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
cuishuang [Sat, 15 Feb 2025 03:22:16 +0000 (11:22 +0800)]
all: use a more straightforward return value
Change-Id: I27e86c221da7f541c4823f501801e02942c9a829
Reviewed-on: https://go-review.googlesource.com/c/go/+/649935
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Luka Krmpotić [Sat, 15 Feb 2025 10:25:50 +0000 (10:25 +0000)]
go/format: format comment to match code
Change-Id: I9434a8d04ca4282da86cb2622a6a541db3961a2b
GitHub-Last-Rev: f28908e338e9160ca3d4033161647832fdd76840
GitHub-Pull-Request: golang/go#71763
Reviewed-on: https://go-review.googlesource.com/c/go/+/649955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Jes Cok [Mon, 17 Feb 2025 11:45:51 +0000 (11:45 +0000)]
os: deal with chmod error for TestRootConsistencyChmod
Previously the error returned by chmod has not actually been used.
Change-Id: I97c947a2278a084c58784fd100630ce2a54bfb03
GitHub-Last-Rev: ddc60a044f641d264c9ee88d87b2da7e2f766741
GitHub-Pull-Request: golang/go#71744
Reviewed-on: https://go-review.googlesource.com/c/go/+/649418 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Mauri de Souza Meneguzzo [Mon, 17 Feb 2025 13:57:12 +0000 (13:57 +0000)]
cmd/cgo: explicitly use void for functions with no parameters
Currently, exported Go functions with no parameters generate C functions
with an empty parameter list. In C, a function with an empty parameter
list can accept any number of arguments, whereas a function with a single
void parameter explicitly declares that it takes no arguments.
To align the generated C functions with their Go prototypes, update the
code generation to explicitly include a void parameter for functions
with no parameters.
Fixes #68411
Change-Id: Iab9456aa0236200bf21d1181a2e18e82869df63f
GitHub-Last-Rev: 6ff21a98dfef81df649c76221d9c0858dc0e35e1
GitHub-Pull-Request: golang/go#70981
Reviewed-on: https://go-review.googlesource.com/c/go/+/638635 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Joel Sing [Sat, 15 Feb 2025 07:09:59 +0000 (18:09 +1100)]
crypto/internal/fips140deps/cpu: use const and var blocks
Rather than repeating ourselves, use a single const block and a single
var block. Also separate architectures for readability.
Change-Id: Iab5bda3514eae0c9b5bb16a99277fd4b95f272aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/649658 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
Nicolas Hillegeer [Thu, 12 Dec 2024 16:49:03 +0000 (08:49 -0800)]
runtime: print pp.schedtick in scheddetail even when !detailed
Provides, on one line, an approximation of P scheduling throughput: how
many times execute() was called for a given P. Said another way: how
many RUNNABLE to RUNNING transitions have happened for this P.
This allows discerning whether a P actually did anything, and how it
compares to other periods of a processes operation.
This should be useful to analyze (kernel) scheduler hiccups.
Investigators will want to subtract the tick values from subsequent
schedtrace lines to get a rate of schedulings. I've opted to add a space
around the first and last element as well to make it more uniform to do
the proposed subtracting with tools like AWK.
Change-Id: I69d6dae1509ad285d43799f38bcaa3aa0fb2352e
Reviewed-on: https://go-review.googlesource.com/c/go/+/635636 Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicolas Hillegeer <aktau@google.com>
Change-Id: I578bdf42ef229d687d526e378d697ced51e1880c
Reviewed-on: https://go-review.googlesource.com/c/go/+/639935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com>
Artyom Litovets [Fri, 14 Feb 2025 12:03:06 +0000 (12:03 +0000)]
runtime/maps: fix typo in group.go comment (H1 -> H2)
Fixes a typo to correctly describe the hash bits of the control word.
Change-Id: Id3c2ae0bd529e579a95258845f9d8028e23d10d2
GitHub-Last-Rev: 1baa81be5d292d5625d5d7788b8ea090453f962c
GitHub-Pull-Request: golang/go#71730
Reviewed-on: https://go-review.googlesource.com/c/go/+/649416 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: Ian Lance Taylor <iant@google.com>
Alan Donovan [Wed, 12 Feb 2025 16:18:30 +0000 (11:18 -0500)]
std: add //go:fix inline directives to some deprecated functions
In particular, we apply it only to functions where it is always
a code improvement to inline the call.
We also apply it to some constants.
In a few cases this may introduce a panic statement at the
caller, which is debatable, but making the potential for panic
evident is the purpose of the deprecation.
The gofix analyzer in gopls v0.18 will show a diagnostic for calls
to the annotated functions, and will offer to inline the call.
The new //go:fix annotation needs a special exemption in the
pragma check in the compiler.
Updates #32816
Change-Id: I43bf15648ac12251734109eb7102394f8a76d55e
Reviewed-on: https://go-review.googlesource.com/c/go/+/648995 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Joel Sing [Fri, 3 Jan 2025 08:06:18 +0000 (19:06 +1100)]
crypto/internal/fips140/subtle: provide riscv64 assembly implementation for xorBytes
Provide a riscv64 assembly implementation of xorBytes, which
can process up to 64 bytes per loop and has better handling
for unaligned inputs. This provides a considerable performance
gain compared to the generic code.
Change-Id: I9bec9c8f48df7284f8414ac745615c2a093e9ae9
Reviewed-on: https://go-review.googlesource.com/c/go/+/639858 Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
TryBot-Bypass: Joel Sing <joel@sing.id.au> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Jes Cok [Fri, 14 Feb 2025 13:50:24 +0000 (13:50 +0000)]
os: explicitly return nil for rootChown in root_openat.go
It is consistent with the same function in root_noopenat.go.
Change-Id: I6ddbf4dfcc725cb2023bc6bed961cc525b9c43d2
GitHub-Last-Rev: 0802150a6a8e5d4bd395b702ecc518df1e8dd4c0
GitHub-Pull-Request: golang/go#71743
Reviewed-on: https://go-review.googlesource.com/c/go/+/649417
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Joel Sing [Mon, 1 Jul 2024 14:31:53 +0000 (00:31 +1000)]
cmd/internal/obj/riscv: support MOVD with floating point constants
Currently, we only support loading of values from memory (or other
registers). Add floating point constant support to MOVD. This is
implemented by storing the floating point constant to a symbol,
which is then loaded into the floating point register.
Change-Id: I6db242d27f606f0d5d084a3ab93538698d3a4f8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/631876 Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Joel Sing [Wed, 5 Feb 2025 13:38:51 +0000 (00:38 +1100)]
runtime: use return for async preemption resumption on arm64
Use return with register for async preemption resumption on arm64.
This has the same behaviour as the current use of JMP, however
is permitted when Branch Target Identification is being enforced,
while a JMP with register is considered an indirect call and
requires a `BTI J` marker at the resumption address.
Updates #66054
Change-Id: I135ac577073467bedd9efd8df15b76c97dc08767
Reviewed-on: https://go-review.googlesource.com/c/go/+/646782 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
cuishuang [Thu, 21 Nov 2024 09:14:21 +0000 (17:14 +0800)]
cmd/go/internal: use pathpkg name more
The package "path" is already imported under the name pathpkg and used
many times in these files. It's not worth it to also make it available
under the name path, so keep using pathpkg.
Change-Id: I7f8fa7a11de338b9a7c0f58a48d5af68b5639cfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/630475
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Filippo Valsorda [Mon, 10 Feb 2025 10:30:52 +0000 (11:30 +0100)]
crypto/internal/fips140/edwards25519: make Scalar.SetCanonicalBytes constant time
Internally we only use SetCanonicalBytes as part of Ed25519
verification, where all inputs are public, so it doesn't need to be
constant time.
However, this code is replicated outside of the standard library. Even
there, an attack is not practical, so this should not be considered a
security vulnerability:
- For specific scalars, this only leaks at most four bits of
information, and always the same four bits (so it's not an adaptive
attack).
- For derived scalars, assuming they are valid and uniformly
distributed, the loop would return true on the first iteration with
probability (1 - 2⁻¹²⁷) due to the shape of the scalar field order.
Still, making it constant time is easy enough and saves the next person
from having to think about it.
This was previously reported by Yawning Angel, and then as part of a
security audit.
Change-Id: I6a6a46563c8abecb0b4a6f12033a71c4c4da6fa7
Reviewed-on: https://go-review.googlesource.com/c/go/+/648035 Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Ian Lance Taylor [Thu, 13 Feb 2025 22:40:01 +0000 (14:40 -0800)]
internal/godebugs: add fips140 as an opaque godebug setting
This permits using "godebug fips140=on" in go.mod and
using "//go:debug fips140=on" in the main package.
Change code references to the godebug setting to remove the #
which is no longer required.
For #71666
Change-Id: I3a60ecc55b03848dadd6d431eb43137b6df6568b
Reviewed-on: https://go-review.googlesource.com/c/go/+/649495 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Ian Lance Taylor [Tue, 11 Feb 2025 23:53:20 +0000 (15:53 -0800)]
doc/godebug: mention GODEBUG=fips140
Fixes #71666
Change-Id: Ice816cf2943c5b6660f05934b4c7ca38545714b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/648520
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Andrey Bokhanko [Wed, 27 Nov 2024 17:47:58 +0000 (20:47 +0300)]
cmd/compile: add type-based alias analysis
Make ssa.disjoint call ssa.disjointTypes to disambiguate Values based on
their types. Only one type-based rule is employed: a Type can't alias
with a pointer (https://pkg.go.dev/unsafe#Pointer).
Fixes #70488
Change-Id: I5a7e75292c2b6b5a01fb9048e3e2360e31dbcdd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/632176
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@google.com>
cuishuang [Thu, 13 Feb 2025 07:28:21 +0000 (15:28 +0800)]
bytes: add examples for Lines, SplitSeq, SplitAfterSeq, FieldsSeq and FieldsFuncSeq
Change-Id: I0e755d5c73f14d2c98853bdd31a7f2e84c92a906
Reviewed-on: https://go-review.googlesource.com/c/go/+/648860 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Joel Sing [Fri, 14 Feb 2025 17:45:04 +0000 (04:45 +1100)]
internal/syscall/unix: correct fchmodat on openbsd
This is incorrectly calling the fchownat trampoline - call fchmodat
as intended.
Change-Id: I7b1e758d456006303ca95b70df9e6b52d3020158
Reviewed-on: https://go-review.googlesource.com/c/go/+/649655 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Commit-Queue: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Carlos Ramos Carreño [Fri, 14 Feb 2025 10:14:29 +0000 (10:14 +0000)]
syscall: skip testAmbientCaps tests if there is no nobody user
When there is not a nobody user (for example inside Docker), the
tests TestAmbientCaps and TestAmbientCapsUserns should be skipped
instead of failing.
Fixes #71644
Change-Id: I7f92db19e2b6f449d8d897650a0ecd89f5150f4a
GitHub-Last-Rev: a4c4f5bb61929b4981dc0b92d773bd4ef13d7d3d
GitHub-Pull-Request: golang/go#71729
Reviewed-on: https://go-review.googlesource.com/c/go/+/649396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
Damien Neil [Fri, 14 Feb 2025 17:06:21 +0000 (09:06 -0800)]
internal/syscall/unix: fix fchownat linkname for AIX & Solaris
Typo fix: libc_chownat => libc_fchownat
Change-Id: I6721a988c19e3438b967a73559159c948ed51a0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/649636
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Thu, 13 Feb 2025 19:45:52 +0000 (19:45 +0000)]
internal/trace: emit sync event before deferred spilled error
CL 648315 and CL 648195 fixed #71615 in the case where we fail to read
the next generation by emitting an extra sync event before returning an
error. But, it's possible we failed to even read the next spilled batch
when we read the first generation, and have been carrying the error from
trying to read a spilled batch since the last generation. In this case,
we don't emit a final sync event, meaning that there are still some
cases where #71615 happens.
This change emits the final sync event in this corner case. I believe
this is the final corner case. I could previously reproduce the issue
by running the test under stress2, but I can no longer reproduce any
failures after this change.
Fixes #71615, for real this time.
Change-Id: I10688a3c0e4b8327a95f31add365338c77c091ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/649259 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>