1
0
mirror of https://github.com/golang/go synced 2024-11-15 12:10:22 -07:00
Commit Graph

60059 Commits

Author SHA1 Message Date
aimuz
2b0f2f8169 maps: add All, Keys, Values, Insert, Collect
Fixed #61900.

Change-Id: Ic5962dc92b3102e7448635bef541414a2eaf415e
GitHub-Last-Rev: 3c6f74d617
GitHub-Pull-Request: golang/go#67521
Reviewed-on: https://go-review.googlesource.com/c/go/+/586716
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-20 16:01:35 +00:00
Ian Lance Taylor
4edb367bac cmd/cgo: don't force rewritten code onto a single line
Doing that appears to have been a mistake in CL 142883.

Fixes #67517

Change-Id: Iec6b897984a2e27ec596fc3c4c8129e9620afab1
Reviewed-on: https://go-review.googlesource.com/c/go/+/586676
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: Russ Cox <rsc@golang.org>
2024-05-20 15:50:06 +00:00
Ian Lance Taylor
7ffa8d0a5b cmd/go: accept -mcmodel and -mlarge-data-threshold compiler flags
For #67475

Change-Id: Ia90952eb7c19764306205928ead50bff22857378
Reviewed-on: https://go-review.googlesource.com/c/go/+/586675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-20 15:47:34 +00:00
guoguangwu
834f9710c3 cmd/internal/telemetry: fix typo in comments
Change-Id: I5595206674170351691b1d9869356db654f20ebb
GitHub-Last-Rev: bc0d4d13f6
GitHub-Pull-Request: golang/go#67464
Reviewed-on: https://go-review.googlesource.com/c/go/+/586159
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-20 15:47:30 +00:00
Cherry Mui
9a9dd72d5c cmd/link: add runtime.text.N symbols to macho symbol table in dynlink mode
In dynamic linking mode (e.g. when using plugins) on darwin, the
marker symbols runtime.text and runtime.etext are added to Textp
in an early stage, so when adding symbols to the symbol table we
don't need to explicitly add them. However, when splitting text
sections, the runtime.text.N marker symbols for the addtional
sections are not added to Textp. So we do need to add them
explicitly to the symbol table.

Fixes #66993.

Change-Id: Ic718d03cd71fc0bfb931cff82640b1f4c53b89be
Reviewed-on: https://go-review.googlesource.com/c/go/+/586555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-20 15:32:53 +00:00
apocelipes
e3d87d1932 hash: use more internal/byteorder functions to simplify the code
A follow-up for the CL 585015.

Change-Id: I412f33f1d75abe1446cb3fd742d44d3cb4350380
GitHub-Last-Rev: 554ace757c
GitHub-Pull-Request: golang/go#67476
Reviewed-on: https://go-review.googlesource.com/c/go/+/586240
Reviewed-by: Dmitri Shuralyov <dmitshur@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: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-05-18 22:36:41 +00:00
Michael Mitchell
e7bf9959fd runtime: remove unused code in (*pallocBits).findLargeN
Change-Id: I9611edb9663a9c32bb23d26b9b22b79a54a97498
Reviewed-on: https://go-review.googlesource.com/c/go/+/586196
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-18 15:13:43 +00:00
aimuz
1667dbd7be net: use stringslite package for string operations
- Replace manual string suffix removal with stringslite.TrimSuffix in conf.go
- Use stringslite.Cut for string splitting in ParseCIDR function in ip.go
- Add stringslite import in ip.go

This change simplifies string operations and improves code readability.

Change-Id: I02c238d0bc91e95789d8060e6ef4c7d4f6e3f0d9
GitHub-Last-Rev: aef5dc5011
GitHub-Pull-Request: golang/go#67461
Reviewed-on: https://go-review.googlesource.com/c/go/+/586157
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2024-05-18 03:13:26 +00:00
Paul E. Murphy
105ac94486 cmd/asm: on PPC64, fix assembling of FCMPO opcode
The assembler should pack 3 argument usage of FCMPO similar
to other CMP-like opcodes.

Fixes #67359

Change-Id: Icfb42a67d741431a70dd880806857b4c38f42d62
Reviewed-on: https://go-review.googlesource.com/c/go/+/585640
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-17 21:53:50 +00:00
Austin Clements
b4376b8513 runtime: skip coro cgo test on platforms without cgo
Change-Id: Ibbe82a3ae2a67fb8f2b831130123dc74bc4dc9dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/586535
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 21:36:37 +00:00
Austin Clements
6ec291f495 internal/runtime/atomic: fix missing linknames
CL 544455, which added atomic And/Or APIs, raced with CL 585556, which
enabled stricter linkname checking. This caused linkname-related
failures on ARM and MIPS. Fix this by adding the necessary linknames.

We fix one other linkname that got overlooked in CL 585556.

Updates #61395.

Change-Id: I454f0767ce28188e550a61bc39b7e398239bc10e
Reviewed-on: https://go-review.googlesource.com/c/go/+/586516
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>
2024-05-17 20:08:37 +00:00
Michael Anthony Knyszek
dfe781e1eb runtime: fix coro interactions with thread-locked goroutines
This change fixes problems with thread-locked goroutines using
newcoro/coroswitch/etc. Currently, the coro paths do not consider
thread-locked goroutines at all and can quickly result in broken
scheduler state or lost/leaked goroutines.

One possible fix to these issues is to fall back on goroutine+channel
semantics, but that turns out to be fairly complicated to implement and
results in significant performance cliffs. More complex thread-lock
state donation tricks also result in some fairly complicated state
tracking that doesn't seem worth it given the use-cases of iter.Pull
(and even then, there will be performance cliffs).

This change implements a much simpler, but more restrictive semantics.
In particular, thread-lock state is tied to the coro at the first call
to newcoro (i.e. iter.Pull). From then on, the invariant is that if the
coro has any thread-lock state *or* a goroutine calling into coroswitch
has any thread-lock state, that the full gamut of thread-lock state must
remain the same as it was when newcoro was called (the full gamut
meaning internal and external lock counts as well as the identity of the
thread that was locked to).

This semantics allows the common cases to be always fast, but comes with
a non-orthogonality caveat. Specifically, when iter.Pull is used in
conjunction with thread-locked goroutines, complex cases (passing next
between goroutines or passing yield between goroutines) are likely to
fail. Simple cases, where any number of iter.Pull iterators are used in
a straightforward way (nested, in series, etc.) from the same
goroutine, will work and will be guaranteed to be fast regardless of
thread-lock state.

This is a compromise for the near-term and we may consider lifting the
restrictions imposed by this CL in the future.

Fixes #65889.
Fixes #65946.

Change-Id: I3fb5791e36a61f5ded50226a229a79d28739b24e
Reviewed-on: https://go-review.googlesource.com/c/go/+/583675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-05-17 19:46:10 +00:00
Carlos Amedee
5890b023a5 internal/trace: move v2 tracer into trace directory
This change moves the v2 tracer into the trace directory.

Updates #67367

Change-Id: I3657b4227002cb00fdf29c797434800ea796715e
Reviewed-on: https://go-review.googlesource.com/c/go/+/584538
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 18:48:18 +00:00
Mauri de Souza Meneguzzo
192d65e46b sync/atomic: public And/Or ops and race instrumentation
This CL implements the new sync/atomic AND and OR apis as well as their race
counterparts.

Fixes #61395

Change-Id: I294eefe4b3ac27bc4ed237edcbfa88a8c646d86f
GitHub-Last-Rev: f174297007
GitHub-Pull-Request: golang/go#64331
Reviewed-on: https://go-review.googlesource.com/c/go/+/544455
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-05-17 18:37:29 +00:00
Carlos Amedee
664088b898 internal/trace: remove remnanats of v1 tracer
This change removes unused parts of the v1 tracer in preperation of
the move of the v2 tracer into the trace package.

Updates #67367

Change-Id: I3e53a8afdef72dc90c2d5b514380d1077d284bc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/584537
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 18:31:04 +00:00
Michael Matloob
e95f6af008 cmd/go/internal/envcmd: remove duplicate env value set
CL 586095 wasn't needed because setting the GODEBUG value was just moved
lower in CL 563137. Now we set it twice. Remove the second set so that
it's only set once.

Change-Id: I4a830977833b007e996d0ccaec705a1da4631e6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/586477
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 18:28:42 +00:00
Carlos Amedee
01ad44bc08 cmd/trace: collapse v2 directory into trace
This change removes the old trace code and replaces it with the new tracer.
It does the following:
- Moves the contents of the v2 directory into the parent trace directory.
- Combines the old tracer main file with the new main file.
- Replaces any existing files with the corresponding v2 files.
- Removes any unused files.

Updates #67367

Change-Id: I2237920e13588258a2442b639d562cf7f8a8e944
Reviewed-on: https://go-review.googlesource.com/c/go/+/584536
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-05-17 17:15:58 +00:00
Cherry Mui
003683f41d cmd/link: enable checklinkname by default
Fixes #67401.

Change-Id: Ia8e091c77414cd1281cadc524215ef89ba9184b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/585556
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
2024-05-17 16:59:50 +00:00
Cherry Mui
41aab30bd2 all: add push linknames to allow legacy pull linknames
CL 585358 adds restrictions to disallow pull-only linknames
(currently off by default). Currently, there are quite some pull-
only linknames in user code in the wild. In order not to break
those, we add push linknames to allow them to be pulled. This CL
includes linknames found in a large code corpus (thanks Matthew
Dempsky and Michael Pratt for the analysis!), that are not
currently linknamed.

Updates #67401.

Change-Id: I32f5fc0c7a6abbd7a11359a025cfa2bf458fe767
Reviewed-on: https://go-review.googlesource.com/c/go/+/586137
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 16:48:00 +00:00
Robert Griesemer
f73dd8173a go/types: re-enable suppressed gcimporter tests
Port CL 577616 from types2 to go/types allows us
to re-enable these tests.

Fixes #66859.
Fixes #67436.
Updates #50259.
Updates #65294.

Change-Id: I573e51cf16546ac1c115beac5322b51dd998c881
Reviewed-on: https://go-review.googlesource.com/c/go/+/586236
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2024-05-17 16:22:59 +00:00
Damien Neil
a61729b880 net/http: return correct error when reading from a canceled request body
CL 546676 inadvertently changed the error returned when reading
from the body of a canceled request. Fix it.

Rework various request cancelation tests to exercise all three ways
of canceling a request.

Fixes #67439

Change-Id: I14ecaf8bff9452eca4a05df923d57d768127a90c
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-race
Reviewed-on: https://go-review.googlesource.com/c/go/+/586315
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 15:58:58 +00:00
Jes Cok
2c635b68fd runtime: make use of stringslite.{HasPrefix, HasSuffix}
Change-Id: I7461a892e1591e3bad876f0a718a99e6de2c4659
Reviewed-on: https://go-review.googlesource.com/c/go/+/585435
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-17 15:41:45 +00:00
Paul E. Murphy
d11e417285 cmd/compile/internal/ssa: cleanup ANDCCconst rewrite rules on PPC64
Avoid creating duplicate usages of ANDCCconst. This is preparation for
a patch to reintroduce ANDconst to simplify the lower pass while
treating ANDCCconst like other *CC* ssa opcodes.

Also, move many of the similar rules wich retarget ANDCCconst users
to the flag result to a common rule for all compares against zero.

Change-Id: Ida86efe17ff413cb82c349d8ef69d2899361f4c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/585400
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-17 15:28:00 +00:00
Kir Kolyshkin
2f6426834c os: make use of pidfd on linux
Use Process.handle field to store pidfd, and make use of it. Only use
pidfd functionality if all the needed syscalls are available.

1. Add/use pidfdWorks, which checks that all needed pidfd-related
   functionality works.

2. os.StartProcess: obtain the pidfd from the kernel, if possible, using
   the functionality added by CL 520266. Note we could not modify
   syscall.StartProcess to return pidfd directly because it is a public
   API and its callers do not expect it, so we have to use ensurePidfd
   and getPidfd.

3. (*Process).Kill: use pidfdSendSignal, if available and the pidfd is
   known. Otherwise, fall back to the old implementation.

4. (*Process).Wait: use pidfdWait, if available, otherwise fall back to
   using waitid/wait4. This is more complicated than expected due to
   struct siginfo_t idiosyncrasy.

NOTE pidfdSendSignal and pidfdWait are used without a race workaround
(blockUntilWaitable and sigMu, added by CL 23967) because with pidfd,
PID recycle issue doesn't exist (IOW, pidfd, unlike PID, is guaranteed
to refer to one particular process) and thus the race doesn't exist
either.

Rework of CL 528438 (reverted in CL 566477 because of #65857).

For #62654.
Updates #13987.

Change-Id: If5ef8920bd8619dc428b6282ffe4fb8c258ca224
Reviewed-on: https://go-review.googlesource.com/c/go/+/570036
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-17 01:23:00 +00:00
qiulaidongfeng
69105d79ef cmd/go: unexport loadImport
Complete a TODO.

Change-Id: I39869df4d95a5a5f6019e281719b942fbf4ba7db
GitHub-Last-Rev: c664b5332e
GitHub-Pull-Request: golang/go#67091
Reviewed-on: https://go-review.googlesource.com/c/go/+/581939
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-17 00:11:59 +00:00
Jorropo
1b8117b34a cmd/compile: fix indentation level in generic.rules
Change-Id: I60a9abe72f786e18a59339df271c5521d2d1cda2
Reviewed-on: https://go-review.googlesource.com/c/go/+/555155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-16 22:21:05 +00:00
Mauri de Souza Meneguzzo
c89318667f runtime: cleanup crashstack code
This patch removes redundant guards for the crash stack feature, as all
supported Go architectures now have a crash stack implementation.

Change-Id: I7ffb61c57955778d687073418130b2aaab0ff183
GitHub-Last-Rev: 6ff56d6420
GitHub-Pull-Request: golang/go#67202
Reviewed-on: https://go-review.googlesource.com/c/go/+/583416
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Mauri de Souza Meneguzzo <mauri870@gmail.com>
2024-05-16 21:49:14 +00:00
Michael Matloob
036e93ba76 cmd/go: add go telemetry command and GOTELEMETRY, GOTELEMETRYDIR
Add the go telemetry command to support setting and viewing the
telemetry mode. Also add the non-settable GOTELEMETRY and GOTELEMETRYDIR
variables to go env, which contain the mode and telemetry dir.

For #67111

Change-Id: Id7e89cefe30acfe3d865fa467315fe7cda975de9
Reviewed-on: https://go-review.googlesource.com/c/go/+/584535
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 20:16:39 +00:00
Robert Griesemer
26ed0528c7 go/types, types2: report error for floating-point iteration variable
While at it, slightly improve documentation and code.
Also, add additional test cases for #66561.

Updates #66561.
Fixes #67027.

Change-Id: I682b0e9227e065d6bbd199871c2e1ecff13edc66
Reviewed-on: https://go-review.googlesource.com/c/go/+/580937
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-05-16 18:56:00 +00:00
Chen.Zhidong
a523152ea1 net/http: add Pattern field in Request to return matched pattern info
Fixes #66405

Change-Id: Icd80944b6ca081aa7addd4fb85d2b3c29b6c9542
GitHub-Last-Rev: c6e32742c4
GitHub-Pull-Request: golang/go#66618
Reviewed-on: https://go-review.googlesource.com/c/go/+/574997
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 18:42:34 +00:00
Jonathan Amsterdam
06b4578160 doc/README.md: give example of package-less symbol link
Change-Id: I84d7b6aae7319cc62628a2b5ee752a0680377a15
Reviewed-on: https://go-review.googlesource.com/c/go/+/586135
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-05-16 18:37:47 +00:00
Mike Beaumont
78e50d0fa0 crypto/tls: don't call tlsrsakex.IncNonDefault with FIPS
We haven't called tlsrsakex.Value() yet at this point if we're using
FIPS, like if CipherSuites != nil. This adds needFIPS as a gate next to
CipherSuites != nil. FIPS specifies suites that would be skipped if
tlsarsakex were set.

Fixes #65991

Change-Id: I8070d8f43f27c04067490af8cc7ec5e787f2b9bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/582315
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-16 17:33:18 +00:00
Yoann Congal
18104621ce crypto/x509: fix certificate request creation with RSA-PSS
In case of a RSA-PSS algorithm, the hashFunc of CreateCertificateRequest
is embedded in a rsa.PSSOptions struct. Given to key.Sign(), this will
generate a proper RSA-PSS signature.

Pasted from the RSA-PSS handling code in CreateCertificate().

Fixes #45990
Fixes #65074

Change-Id: I8475afa79d8add107f092cc2871d38300e7b3903
GitHub-Last-Rev: 63fb0214c3
GitHub-Pull-Request: golang/go#55153
Reviewed-on: https://go-review.googlesource.com/c/go/+/431916
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alex Scheel <alex.scheel@hashicorp.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-16 17:32:30 +00:00
Tobias Klauser
6ed31e3c3e net: fix typo in ctrlCtxFn parameter name
context.Context parameters are commonly named ctx, not cxt.

Change-Id: Icaadbcd38b054694959e5e8a058552a3e54be6d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/586016
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-05-16 16:54:32 +00:00
apocelipes
2b42ed6483 crypto: use byteorder to simplify consumeUint32 and consumeUint64
A follow-up for the recent CL 585017.

Change-Id: I9faaff7fdf62fc931fc7f64dbe238de277280730
GitHub-Last-Rev: 468d60c396
GitHub-Pull-Request: golang/go#67425
Reviewed-on: https://go-review.googlesource.com/c/go/+/586035
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 16:50:58 +00:00
Jonathan Amsterdam
4c1cc1c97f doc/next/64910.md: reword release note
Change-Id: I41a01dd2bcaf5716703946bad42830d4e8095c11
Reviewed-on: https://go-review.googlesource.com/c/go/+/586136
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 16:44:13 +00:00
Rob Findley
6a05055780 go/ast: fix bug handling the result of yield in Preorder
Once yield returns false, ast.Preorder must not call yield on any more
nodes. Even after the function passed to ast.Inspect returns false, it
may be invoked again with a non-nil node. Therefore, we must explicitly
truncate the inspection.

For #66339

Change-Id: I2b01e4e96a2d7aca785467c15ab59da13208c161
Reviewed-on: https://go-review.googlesource.com/c/go/+/585520
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 16:34:10 +00:00
Jonathan Amsterdam
db7bb2742c log/slog: handle times with undefined UnixNanos
slog tries to represent a time.Time without allocations, which involves
storing its UnixNanos value. But UnixNanos is undefined for some valid
times. Provide a fallback representation for those times by storing them
in the `any` field of `Value`.

Fixes #65902.

Change-Id: I736c739a92f77d7b1122ea0831524acdd2c4703f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585519
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-05-16 16:12:08 +00:00
Damien Neil
505000b2d3 net/http: simplify HTTP/1 request cancelation
HTTP requests have three separate user cancelation signals:

	Transport.CancelRequest
	Request.Cancel
	Request.Context()

In addition, a request can be canceled due to errors.

The Transport keeps a map of all in-flight requests,
with an associated func to run if CancelRequest is
called. Confusingly, this func is *not* run if
Request.Cancel is closed or the request context expires.

The map of in-flight requests is also used to communicate
between roundTrip and readLoop. In particular, if readLoop
reads a response immediately followed by an EOF, it may
send racing signals to roundTrip: The connection has
closed, but also there is a response available.
This race is resolved by readLoop communicating through
the request map that this request has successfully
completed.

This CL refactors all of this.

In-flight requests now have a context which is canceled
when any of the above cancelation events occurs.

The map of requests to cancel funcs remains, but is
used strictly for implementing Transport.CancelRequest.
It is not used to communicate information about the
state of a request.

Change-Id: Ie157edc0ce35f719866a0a2cb0e70514fd119ff8
Reviewed-on: https://go-review.googlesource.com/c/go/+/546676
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-16 15:57:17 +00:00
Damien Neil
33d725e575 archive/zip: treat truncated EOCDR comment as an error
When scanning for an end of central directory record,
treat an EOCDR signature with a record containing a truncated
comment as an error. Previously, we would skip over the invalid
record and look for another one. Other implementations do not
do this (they either consider this a hard error, or just ignore
the truncated comment). This parser misalignment allowed
presenting entirely different archive contents to Go programs
and other zip decoders.

Fixes #66869

Change-Id: I94e5cb028534bb5704588b8af27f1e22ea49c7c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/585397
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 15:56:19 +00:00
Jes Cok
2b3d98f2ba doc: make symbol links simpler for relnotes
Change-Id: Ie8ff3d1d1398618b9a229aa3cb1ef2deaa58c3d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/586056
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-05-16 15:53:51 +00:00
Michael Matloob
643ad42d5c cmd/go/internal/envcmd: fix showing GODEBUG env value
It was accidently dropped in CL 563137

For #34208

Change-Id: I0aea93fda6260f07bc662dea92d1eabb26f82ca0
Reviewed-on: https://go-review.googlesource.com/c/go/+/586095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
2024-05-16 15:26:42 +00:00
Alan Donovan
a22cb5cabe runtime/debug: eliminate temporary variadicity from SetCrashOutput
Updates #67182

Change-Id: I33fc8c515f4a9d120262ba30f61aea80ede5e9f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/585420
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-05-16 15:19:04 +00:00
qiulaidongfeng
6cd066f8b2 cmd/go: add -changed to query for non-defaults in the env
Fixes #34208

Change-Id: I8ec2d96262dcd7cbf870f6173690143c54190722
GitHub-Last-Rev: 6543df4784
GitHub-Pull-Request: golang/go#65655
Reviewed-on: https://go-review.googlesource.com/c/go/+/563137
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-16 14:34:32 +00:00
Alan Donovan
d367b2a475 cmd/vendor/golang.org/x/telemetry: update to 9ff3ad9
Updates #67182

Change-Id: I76b312ccbd1ea98eb2f4e3beec9e8b42e633ea5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/585819
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 14:32:04 +00:00
Jonathan Amsterdam
ee0bf1d1b6 doc/README.md: mention adding the proposal issue
Inform users that every accepted proposal should be mentioned
in the release notes to avoid generating a TODO.

Also, clarify instructions for the release team.

For #64169.

Change-Id: I03921739af31fc93f4b5808b2c7c98e28ad3da11
Reviewed-on: https://go-review.googlesource.com/c/go/+/584615
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 12:38:55 +00:00
Mateusz Poliwczak
722d59436b crypto/x509: add text and binary marshal methods to OID
Fixes #66249

Change-Id: I5973a19a087a35ad951e8a220d3e6e4456c7577f
GitHub-Last-Rev: 921ca8bd0c
GitHub-Pull-Request: golang/go#66599
Reviewed-on: https://go-review.googlesource.com/c/go/+/575295
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2024-05-16 02:00:26 +00:00
Cuong Manh Le
8ce2fedaeb cmd/compile: add test case for using Alias types
CL 579935 disabled usage of Alias types in the compiler, and tracks
the problem with issue #66873. The test case in #65893 passes now
with the current tip. This CL adds a test case to ensure there is no
regression once Alias types are enabled for the compiler.

Updates #66873
Fixes #65893

Change-Id: I51b51bb13ca59549bc5925dd95f73da40465556d
Reviewed-on: https://go-review.googlesource.com/c/go/+/568455
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-05-16 01:45:48 +00:00
Tobias Klauser
63a0a905fa math/rand/v2: use max builtin in tests
Change-Id: I6d0050319c66fb62c817206e646e1a9449dc444c
Reviewed-on: https://go-review.googlesource.com/c/go/+/585715
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-05-16 01:44:46 +00:00
Michael Pratt
1ffc296717 runtime: always update stack bounds on cgocallback
callbackUpdateSystemStack contains a fast path to exit early without
update if SP is already within the g0.stack bounds.

This is not safe, as a subsequent call may have new stack bounds that
only partially overlap the old stack bounds. In this case it is possible
to see an SP that is in the old stack bounds, but very close to the
bottom of the bounds due to the partial overlap. In that case we're very
likely to "run out" of space on the system stack.

We only need to do this on extra Ms, as normal Ms have precise bounds
defined when we allocated the stack.

TSAN annotations are added to x_cgo_getstackbounds because bounds is a
pointer into the Go stack. The stack can be reused when an old thread
exits and a new thread starts, but TSAN can't see the synchronization
there. This isn't a new case, but we are now calling more often.

Fixes #62440.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I5389050494987b7668d0b317fb92f85e61d798ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/584597
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 01:32:45 +00:00