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

60071 Commits

Author SHA1 Message Date
Michael Pratt
7f76c00fc5 internal/reflectlite: remove unused mapType
Change-Id: I715186c053bc9911b912e69904735c9498bf9c13
Reviewed-on: https://go-review.googlesource.com/c/go/+/580376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-19 21:11:15 +00:00
Ian Lance Taylor
903e0ffbed reflect: remove unnecessary type conversions of untyped PtrSize
Change-Id: I0f20020c2929b58958ce228b9f175d5b4fd77a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/578855
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>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2024-04-19 18:02:47 +00:00
Keith Randall
35c619398b runtime: for fallback hash, get rid of constant xors
There's no need for these. If hashkey[i] is uniform over [0,1<<64), then
hashkey[0]^C has exactly the same distribution, for any constant C.

Change-Id: I4e10c27eff15e4b7a45139654ac41f410b1b12fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/580218
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-19 17:39:28 +00:00
khr@golang.org
c260de24b6 runtime: remove odd-forcing of hash constants
We don't multiply by them any more, so no need to make them odd.

Suggested by me here in 2021:
https://go-review.googlesource.com/c/go/+/280372/comment/1a86b8aa_f64310bf/
Never got around to it until now.

Change-Id: Iddc675e6a18b4a7a785acbf77c96e127003cc3c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/579116
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-19 17:39:06 +00:00
khr@golang.org
ef2f3391da runtime: make it harder to find collisions in the 64-bit fallback hash
Currently the first argument to mix() can be set by an attacker, as it
is just the input bytes xored by some constants. That lets an attacker
set the value being multipled by to 0. That can lead to lots of
collisions. To fix, xor the first argument with the process-wide seed,
so the magic collision-generating value isn't a constant known to the
attacker.  (Maybe there's a timing attack that could figure out the
process-wide seed, but that's a much harder attack.)

Fixes #66841

Change-Id: I33e073c78355d1cee08660de52074e6ccc38b426
Reviewed-on: https://go-review.googlesource.com/c/go/+/579115
Reviewed-by: M Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-04-19 17:38:07 +00:00
Michael Anthony Knyszek
2b82a4f488 runtime: track frame pointer while in syscall
Currently the runtime only tracks the PC and SP upon entering a syscall,
but not the FP (BP). This is mainly for historical reasons, and because
the tracer (which uses the frame pointer unwinder) does not need it.

Until it did, of course, in CL 567076, where the tracer tries to take a
stack trace of a goroutine that's in a syscall from afar. It tries to
use gp.sched.bp and lots of things go wrong. It *really* should be using
the equivalent of gp.syscallbp, which doesn't exist before this CL.

This change introduces gp.syscallbp and tracks it. It also introduces
getcallerfp which is nice for simplifying some code. Because we now have
gp.syscallbp, we can also delete the frame skip count computation in
traceLocker.GoSysCall, because it's now the same regardless of whether
frame pointer unwinding is used.

Fixes #66889.

Change-Id: Ib6d761c9566055e0a037134138cb0f81be73ecf7
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-nocgo
Reviewed-on: https://go-review.googlesource.com/c/go/+/580255
Auto-Submit: 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>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 17:25:00 +00:00
Michael Anthony Knyszek
dcb5de5cac cmd/trace/v2: tolerate traces with broken tails
This change modifies cmd/trace/v2 to tolerate traces with
incomplete/broken generations at the tail. These broken tails can be
created if a program crashes while a trace is being produced. Although
the runtime tries to flush the trace on some panics, it may still
produce some extra trace data that is incomplete.

This change modifies cmd/trace/v2 to still work on any complete
generations, even if there are incomplete/broken generations at the tail
end of the trace. Basically, the tool now just tracks when the last good
generation ended (via Sync events) and truncates the trace to that point
when it encounters an error.

This change also revamps the text output of the tool to emit regular
progress notifications as well as warnings as to how much of the trace
data was lost.

Fixes #65316.

Change-Id: I877d39993bc02a81eebe647db9c2be17635bcec8
Reviewed-on: https://go-review.googlesource.com/c/go/+/580135
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
2024-04-19 17:23:57 +00:00
Michael Anthony Knyszek
4324d5a88c internal/concurrent: handle boundary case for hash bits in HashTrieMap
Currently the HashTrieMap has a panic for running out of hash bits, but
it turns out we can end up in these paths in valid cases, like inserting
or deleting an element that requires *all* the hash bits to finds its
position in the tree. There's basically an off-by-one error here where
the panic fires erroneously.

This wasn't caught before the original CL landed because it's very
unlikely on 64-bit platforms, with a 64-bit hash, but much more likely
on 32-bit platforms, where using all 32 bits of a 32-bit hash is much
more likely.

This CL makes the condition for panicking much more explicit, which
avoids the off-by-one error.

After this CL, I can't get the tests to fail on 32-bit under stress
testing.

Change-Id: I855e301e3b3893e2b6b017f6dd9f3d83a94a558d
Reviewed-on: https://go-review.googlesource.com/c/go/+/580138
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-19 17:16:47 +00:00
Ian Lance Taylor
2ff89341f6 reflect: omit anonymous field name from StructOf type string
This makes the reflect package match the compiler for StructOf
with an embedded field.

Fixes #24781

Change-Id: Ice64b167cbe0b9d30a953c5d8e2a86f3ad1158bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/567897
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-04-19 17:15:47 +00:00
Roland Shoemaker
f0d6ddfac0 crypto/tls: don't cache marshal'd bytes
Only cache the wire representation for clientHelloMsg and serverHelloMsg
during unmarshal, which are the only places we actually need to hold
onto them. For everything else, remove the raw field.

This appears to have zero performance impact:

name                                               old time/op   new time/op   delta
CertCache/0-10                                       177µs ± 2%    189µs ±11%   ~     (p=0.700 n=3+3)
CertCache/1-10                                       184µs ± 3%    182µs ± 6%   ~     (p=1.000 n=3+3)
CertCache/2-10                                       187µs ±12%    187µs ± 2%   ~     (p=1.000 n=3+3)
CertCache/3-10                                       204µs ±21%    187µs ± 1%   ~     (p=0.700 n=3+3)
HandshakeServer/RSA-10                               410µs ± 2%    410µs ± 3%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-P256-RSA/TLSv13-10             473µs ± 3%    460µs ± 2%   ~     (p=0.200 n=3+3)
HandshakeServer/ECDHE-P256-RSA/TLSv12-10             498µs ± 3%    489µs ± 2%   ~     (p=0.700 n=3+3)
HandshakeServer/ECDHE-P256-ECDSA-P256/TLSv13-10      140µs ± 5%    138µs ± 5%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-P256-ECDSA-P256/TLSv12-10      132µs ± 1%    133µs ± 2%   ~     (p=0.400 n=3+3)
HandshakeServer/ECDHE-X25519-ECDSA-P256/TLSv13-10    168µs ± 1%    171µs ± 4%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-X25519-ECDSA-P256/TLSv12-10    166µs ± 3%    163µs ± 0%   ~     (p=0.700 n=3+3)
HandshakeServer/ECDHE-P521-ECDSA-P521/TLSv13-10     1.87ms ± 2%   1.81ms ± 0%   ~     (p=0.100 n=3+3)
HandshakeServer/ECDHE-P521-ECDSA-P521/TLSv12-10     1.86ms ± 0%   1.86ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv12-10                  6.79ms ± 3%   6.73ms ± 0%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv13-10                  6.73ms ± 1%   6.75ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv12-10                  12.8ms ± 2%   12.7ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv13-10                  13.1ms ± 3%   12.8ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/4MB/TLSv12-10                  24.9ms ± 2%   24.7ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/4MB/TLSv13-10                  26.0ms ± 4%   24.9ms ± 1%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/8MB/TLSv12-10                  50.0ms ± 3%   48.9ms ± 0%   ~     (p=0.200 n=3+3)
Throughput/MaxPacket/8MB/TLSv13-10                  49.8ms ± 2%   49.3ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/16MB/TLSv12-10                 97.3ms ± 1%   97.4ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/16MB/TLSv13-10                 97.9ms ± 0%   97.9ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/32MB/TLSv12-10                  195ms ± 0%    194ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/32MB/TLSv13-10                  196ms ± 0%    196ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/64MB/TLSv12-10                  405ms ± 3%    385ms ± 0%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/64MB/TLSv13-10                  391ms ± 1%    388ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/1MB/TLSv12-10              6.75ms ± 0%   6.75ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/1MB/TLSv13-10              6.84ms ± 1%   6.77ms ± 0%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/2MB/TLSv12-10              12.8ms ± 1%   12.8ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/2MB/TLSv13-10              12.8ms ± 1%   13.0ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/4MB/TLSv12-10              24.8ms ± 1%   24.8ms ± 0%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/4MB/TLSv13-10              25.1ms ± 2%   25.1ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/8MB/TLSv12-10              49.2ms ± 2%   48.9ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/8MB/TLSv13-10              49.3ms ± 1%   49.4ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/16MB/TLSv12-10             97.1ms ± 0%   98.0ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/16MB/TLSv13-10             98.8ms ± 1%   98.4ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/32MB/TLSv12-10              192ms ± 0%    198ms ± 5%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/32MB/TLSv13-10              194ms ± 0%    196ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/64MB/TLSv12-10              385ms ± 1%    384ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/64MB/TLSv13-10              387ms ± 0%    388ms ± 0%   ~     (p=0.400 n=3+3)
Latency/MaxPacket/200kbps/TLSv12-10                  694ms ± 0%    694ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/200kbps/TLSv13-10                  699ms ± 0%    699ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/500kbps/TLSv12-10                  278ms ± 0%    278ms ± 0%   ~     (p=0.400 n=3+3)
Latency/MaxPacket/500kbps/TLSv13-10                  280ms ± 0%    280ms ± 0%   ~     (p=1.000 n=3+3)
Latency/MaxPacket/1000kbps/TLSv12-10                 140ms ± 1%    140ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/1000kbps/TLSv13-10                 141ms ± 0%    141ms ± 0%   ~     (p=1.000 n=3+3)
Latency/MaxPacket/2000kbps/TLSv12-10                70.5ms ± 0%   70.4ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/2000kbps/TLSv13-10                70.7ms ± 0%   70.7ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/5000kbps/TLSv12-10                28.8ms ± 0%   28.8ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/5000kbps/TLSv13-10                28.9ms ± 0%   28.9ms ± 0%   ~     (p=0.700 n=3+3)
Latency/DynamicPacket/200kbps/TLSv12-10              134ms ± 0%    134ms ± 0%   ~     (p=0.700 n=3+3)
Latency/DynamicPacket/200kbps/TLSv13-10              138ms ± 0%    138ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/500kbps/TLSv12-10             54.1ms ± 0%   54.1ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/500kbps/TLSv13-10             55.7ms ± 0%   55.7ms ± 0%   ~     (p=0.100 n=3+3)
Latency/DynamicPacket/1000kbps/TLSv12-10            27.6ms ± 0%   27.6ms ± 0%   ~     (p=0.200 n=3+3)
Latency/DynamicPacket/1000kbps/TLSv13-10            28.4ms ± 0%   28.4ms ± 0%   ~     (p=0.200 n=3+3)
Latency/DynamicPacket/2000kbps/TLSv12-10            14.4ms ± 0%   14.4ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/2000kbps/TLSv13-10            14.6ms ± 0%   14.6ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/5000kbps/TLSv12-10            6.44ms ± 0%   6.45ms ± 0%   ~     (p=0.100 n=3+3)
Latency/DynamicPacket/5000kbps/TLSv13-10            6.49ms ± 0%   6.49ms ± 0%   ~     (p=0.700 n=3+3)

name                                               old speed     new speed     delta
Throughput/MaxPacket/1MB/TLSv12-10                 155MB/s ± 3%  156MB/s ± 0%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv13-10                 156MB/s ± 1%  155MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv12-10                 163MB/s ± 2%  165MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv13-10                 160MB/s ± 3%  164MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/4MB/TLSv12-10                 168MB/s ± 2%  170MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/4MB/TLSv13-10                 162MB/s ± 4%  168MB/s ± 1%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/8MB/TLSv12-10                 168MB/s ± 3%  172MB/s ± 0%   ~     (p=0.200 n=3+3)
Throughput/MaxPacket/8MB/TLSv13-10                 168MB/s ± 2%  170MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/16MB/TLSv12-10                172MB/s ± 1%  172MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/16MB/TLSv13-10                171MB/s ± 0%  171MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/32MB/TLSv12-10                172MB/s ± 0%  173MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/32MB/TLSv13-10                171MB/s ± 0%  172MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/64MB/TLSv12-10                166MB/s ± 3%  174MB/s ± 0%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/64MB/TLSv13-10                171MB/s ± 1%  173MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/1MB/TLSv12-10             155MB/s ± 0%  155MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/1MB/TLSv13-10             153MB/s ± 1%  155MB/s ± 0%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/2MB/TLSv12-10             164MB/s ± 1%  164MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/2MB/TLSv13-10             163MB/s ± 1%  162MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/4MB/TLSv12-10             169MB/s ± 1%  169MB/s ± 0%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/4MB/TLSv13-10             167MB/s ± 1%  167MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/8MB/TLSv12-10             170MB/s ± 2%  171MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/8MB/TLSv13-10             170MB/s ± 1%  170MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/16MB/TLSv12-10            173MB/s ± 0%  171MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/16MB/TLSv13-10            170MB/s ± 1%  170MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/32MB/TLSv12-10            175MB/s ± 0%  170MB/s ± 5%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/32MB/TLSv13-10            173MB/s ± 0%  171MB/s ± 1%   ~     (p=0.300 n=3+3)
Throughput/DynamicPacket/64MB/TLSv12-10            174MB/s ± 1%  175MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/64MB/TLSv13-10            174MB/s ± 0%  173MB/s ± 0%   ~     (p=0.400 n=3+3)

Change-Id: Ifa79cce002011850ed8b2835edd34f60e014eea8
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-arm64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/580215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2024-04-19 16:55:49 +00:00
Michael Pratt
1a3682b4c1 runtime: use bootstrapRand to initialize hashkey
The seed for rand is not initialized until after alginit. Before
initialization, rand returns a deterministic sequence, making hashkey
deterministic across processes.

Switch to bootstrapRand, like other early rand calls, such as
initialization of aeskeysched.

Fixes #66885.

Change-Id: I5023a9161232b49fda2ebd1d5f9338bbdd17b1fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/580136
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-19 16:34:32 +00:00
khr@golang.org
1a0b86375f cmd/compile: remove redundant calls to cmpstring
The results of cmpstring are reuseable if the second call has the
same arguments and memory.

Note that this gets rid of cmpstring, but we still generate a
redundant </<= test and branch afterwards, because the compiler
doesn't know that cmpstring only ever returns -1,0,1.

Update #61725

Change-Id: I93a0d1ccca50d90b1e1a888240ffb75a3b10b59b
Reviewed-on: https://go-review.googlesource.com/c/go/+/578835
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>
2024-04-19 16:31:02 +00:00
Michael Pratt
d428a63875 internal/goexperiment: remove unused range experiment
This experiment was added mistakenly in https://go.dev/cl/537980,
probably as the result of a bad rebase on https://go.dev/cl/539277.

Change-Id: Ia3fc75725535ac70a2e6dd655440a2f515405c48
Reviewed-on: https://go-review.googlesource.com/c/go/+/580375
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 16:08:40 +00:00
Tobias Klauser
974b2011ca internal/syscall/unix: implement Eaccess on darwin
Like on other Unix-like platforms, use faccessat(AT_FDCWD, path, mode,
AT_EACCESS).

Change-Id: I6e04b4244f8e90bd3b35b1b8a9ca38fe845b34ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/579976
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-04-19 15:02:38 +00:00
Jacob
104c293ffe syscall/js: allocate arg slices on stack for small numbers of args
The existing implementation causes unnecessary heap allocations for
javascript syscalls: Call, Invoke, and New. The new change seeks to
hint the Go compiler to allocate arg slices with length <=16 to the
stack.

Original Work: CL 367045
- Calling a JavaScript function with 16 arguments or fewer will not
induce two additional heap allocations, at least with the current Go
compiler.
- Using syscall/js features with slices and strings of
statically-known length will not cause them to be escaped to the heap,
at least with the current Go compiler.
- The reduction in allocations has the additional benefit that the
garbage collector runs less often, blocking WebAssembly's one and only
thread less often.

Fixes #39740

Change-Id: I815047e1d4f8ada796318e2064d38d3e63f73098
GitHub-Last-Rev: 36df1b33a4
GitHub-Pull-Request: golang/go#66684
Reviewed-on: https://go-review.googlesource.com/c/go/+/576575
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-19 14:35:26 +00:00
Jes Cok
f31fcc7538 doc: make symbol links simpler for relnotes
This is a follow-up to CL 578195.

Change-Id: I6466ff8753f05a9424a8098cd88490aab6b236c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/580277
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-04-19 14:33:17 +00:00
Nuno Gonçalves
a63907808d net/http: add field Cookie.Quoted bool
The current implementation of the http package strips double quotes
from the cookie-value during parsing, resulting in the serialized
cookie not including them. This patch addresses this limitation by
introducing a new field to track whether the original value was
enclosed in quotes.

Additionally, the internal representation of a cookie in the cookiejar
package has been adjusted to align with the new representation.

The syntax of cookies is outlined in RFC 6265 Section 4.1.1:
https://datatracker.ietf.org/doc/html/rfc6265\#section-4.1.1

Fixes #46443

Change-Id: Iac12a56397d77a6060a75757ab0daeacc60457f3
GitHub-Last-Rev: a76440e741
GitHub-Pull-Request: golang/go#66752
Reviewed-on: https://go-review.googlesource.com/c/go/+/577755
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 00:32:19 +00:00
Alan Donovan
01064622a2 go/types: add Func.Signature method
Unfortunately we can't enforce the repr invariant
that Func.typ != nil without thinking about the
object color invariants. For now, return a trivial
Signature if typ == nil, which should never happen
in bug-free client code.

Fixes golang/go#65772

Change-Id: I7f89c6d8fdc8dcd4b8880572e54bb0ed9b6136eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/565375
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 22:17:27 +00:00
Michael Anthony Knyszek
dfc86e922c internal/weak: add package implementing weak pointers
This change adds the internal/weak package, which exposes GC-supported
weak pointers to the standard library. This is for the upcoming weak
package, but may be useful for other future constructs.

For #62483.

Change-Id: I4aa8fa9400110ad5ea022a43c094051699ccab9d
Reviewed-on: https://go-review.googlesource.com/c/go/+/576297
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 21:25:11 +00:00
Michael Anthony Knyszek
fa470f6245 internal/concurrent: add HashTrieMap
This change adds a concurrent hash-trie map implementation to the
standard library in the new internal/concurrent package, intended to
hold concurrent data structures. (The name comes from how Java names
their concurrent data structure library in the standard library.)

This data structure is created specially for the upcoming unique
package. It is built specifically around frequent successful lookups and
comparatively rare insertions and deletions.

A valid question is whether this is worth it over a simple locked map.
Some microbenchmarks in this new package show that yes, this extra
complexity appears to be worth it.

Single-threaded performance for LoadOrStore is comparable to a locked
map for a map with 128k small string elements. The map scales perfectly
up to 24 cores for Loads, which is the maximum available parallelism
on my machine. LoadOrStore operations scale less well. Small maps will
have a high degree of contention, but for the unique library, small maps
are very unlikely to stay small if there are a lot of inserts, since
they have a full GC cycle to grow.

For #62483.

Change-Id: I38e5ac958d19ebdd0c8c02e36720bb3338fe2e35
Reviewed-on: https://go-review.googlesource.com/c/go/+/573956
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 21:20:09 +00:00
Michael Pratt
68c0ad3a68 cmd/go: only attempt to match subset of $GOCACHE in test
This test attempted to be clever by looking for the entirety of $GOCACHE
in the compile command line to ensure that the profile was coming from
cache.

Unfortunately, on Windows $GOCACHE contains \, which needs extra
escaping in a regexp. As an approximate alternative, just look for the
"gocache" component specified when defining GOCACHE.

This fixes the Windows longtest builders.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest
Change-Id: If6c77cf066d8612431e0720405254e1fdf528e9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/580137
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
2024-04-18 18:28:25 +00:00
Robert Griesemer
ad87d44047 go/types, types2: use correct predicate when asserting comma-ok types
While at it and unrelated, up-date testdata/manual.go sample file so
we can just copy its contents into a test file after debugging, without
fixing the date.

Fixes #66878.

Change-Id: Ie49a341b78d99bdc0f1a0ba1ca42fa2d3a807bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/580075
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 17:42:47 +00:00
Jes Cok
a0205e650a doc: simplify symbol links for relnotes
This is a follow-up to CL 578195.

Change-Id: Iab38ee008df8b06c300b0027019cc0464bdadca1
Reviewed-on: https://go-review.googlesource.com/c/go/+/579796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-04-18 16:00:16 +00:00
Jes Cok
276d28fe40 net/http: add case for TestParseSetCookie
Updates #66008

Change-Id: Idd36a7f0b4128adfd0a3d7fe76eb6c2cea4306a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/579795
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2024-04-18 16:00:14 +00:00
Than McIntosh
e01b1eb289 cmd/compile/internal: stack slot merging region formation enhancements
This patch revises the algorithm/strategy used for overlapping the
stack slots of disjointly accessed local variables. The main change
here is to allow merging the stack slot of B into the slot for A if
B's size is less then A (prior to this they had to be identical), and
to also allow merging a non-pointer variables into pointer-variable
slots.

The new algorithm sorts the candidate list first by pointerness
(pointer variables first), then by alignment, then by size, and
finally by name. We no longer check that two variables have the same
GC shape before merging: since it should never be the case that we
have two vars X and Y both live across a given callsite where X and Y
share a stack slot, their gc shape doesn't matter.

Doing things this new way increases the total number of bytes saved
(across all functions) from 91256 to 124336 for the sweet benchmarks.

Updates #62737.
Updates #65532.
Updates #65495.

Change-Id: I1daaac1b1240aa47a6975e98ccd24e03304ab602
Reviewed-on: https://go-review.googlesource.com/c/go/+/577615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-18 15:43:53 +00:00
Michael Pratt
a973b4256e cmd/dist: allow arbitrary package renames for bootstrap imports
Import declaration matching currently has a list of specific cases. It
allows bare imports, dot imports, and renamed imports named "exec" and
"rtabi".

Keeping a specific allowlist of renamed imports is unnecessary and
causes annoyance for developers adding such imports, as the bootstrap
build errors do not make it clear that this is where the issue lies.

We can simplify this to be much more general. The body of the condition
will still only rewrite imports in cmd/ or in bootstrapDirs.

I believe the only downside of this change is that it makes it a bit
more likely to match and replace within comments. That said, there
should be no harm in replacements within comments.

This change results in no change to the resulting bootstrap source tree:

$ diff -u -r /tmp/bootstrap.before/src /tmp/bootstrap.after/src
diff -u -r /tmp/bootstrap.before/src/bootstrap/internal/buildcfg/zbootstrap.go /tmp/bootstrap.after/src/bootstrap/internal/buildcfg/zbootstrap.go
--- /tmp/bootstrap.before/src/bootstrap/internal/buildcfg/zbootstrap.go 2024-03-27 12:29:27.439540946 -0400
+++ /tmp/bootstrap.after/src/bootstrap/internal/buildcfg/zbootstrap.go  2024-03-27 12:28:08.516211238 -0400
@@ -20,6 +20,6 @@
 const defaultGOEXPERIMENT = ``
 const defaultGO_EXTLINK_ENABLED = ``
 const defaultGO_LDSO = ``
-const version = `devel go1.23-38087c80ae Wed Mar 27 12:09:16 2024 -0400`
+const version = `devel go1.23-fa64f04409 Wed Mar 27 12:22:52 2024 -0400`
 const defaultGOOS = runtime.GOOS
 const defaultGOARCH = runtime.GOARCH

Change-Id: Ia933c6373f366f2e607b28d900227c24cb214674
Reviewed-on: https://go-review.googlesource.com/c/go/+/574735
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
2024-04-18 15:41:07 +00:00
apocelipes
8d4abd788c net/http: add comments that servemux121.go should remain frozen
Change-Id: I6d1e02ffd07dbb722669abb2e72784dcb2bfffd0
GitHub-Last-Rev: 55a82f724a
GitHub-Pull-Request: golang/go#66848
Reviewed-on: https://go-review.googlesource.com/c/go/+/579118
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-04-18 15:40:38 +00:00
Michael Pratt
84fbdf01ff cmd/go: use cache for PGO preprocessing
This is the final CL in the series adding PGO preprocessing support to
cmd/go. Now that the tool is hooked up, we integrate with the build
cache to cache the result.

This is fairly straightforward. One difference is that the compile and
link do caching through updateBuildID. However, preprocessed PGO files
don't have a build ID, so it doesn't make much sense to hack our way
through that function when it is simple to just add to the cache
ourselves.

As as aside, we could add a build ID to the preproccessed file format,
though it is not clear if it is worthwhile. The one place a build ID
could be used is in buildActionID, which currently compute the file hash
of the preprocessed profile. With a build ID it could simply read the
build ID. This would save one complete read of the file per build
(cmd/go caches the hash), but each compile process also reads the entire
file, so this is a small change overall.

Fixes #58102.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I86e2999a08ccd264230fbb1c983192259b7288e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/569425
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 15:39:17 +00:00
Michael Pratt
081dc9fd8c cmd/go: preprocess PGO profiles
Following the previous CL, now actually run the preprofile tool to create the
preprocessed output.

There is still no build cache integration, so the tool will run on every
build even if nothing has changed.

For #58102.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I0414377a956889f457e50898737fcaa8a698658d
Reviewed-on: https://go-review.googlesource.com/c/go/+/569424
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-18 15:38:19 +00:00
Michael Pratt
4084bc1aa2 cmd/go: inital plumbing for PGO profiles preprocessing
The new go tool preprofile preprocesses a PGO pprof profile into an
intermediate representation that is more efficient for the compiler to
consume. Performing preprocessing avoids having every single compile
process from duplicating the same processing.

This CL prepares the initial plumbing to support automatic preprocessing
by cmd/go.

Each compile action takes a new dependency on a new "preprocess PGO
profile" action. The same action instance is shared by all compile
actions (assuming they have the same input profile), so the action only
executes once.

Builder.build retrieves the file to pass to -pgofile from the output of
the preprocessing action, rather than directly from
p.Internal.PGOProfile.

Builder.buildActionID also uses the preprocess output as the PGO
component of the cache key, rather than the original source. This
doesn't matter for normal toolchain releases, as the two files are
semantically equivalent, but it is useful for correct cache invalidation
in development. For example, if _only_ go tool preprofile changes
(potentially changing the output), then we must regenerate the output
and then rebuild all packages.

This CL does not actually invoke go tool preprocess. That will come in
the next CL. For now, it just copies the input pprof profile.

This CL shouldn't be submitted on its own, only with the children. Since
the new action doesn't yet use the build cache, every build (even fully
cached builds) unconditionally run the PGO action.

For #58102.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I594417cfb0164cd39439a03977c904e4c0c83b8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/569423
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 15:37:44 +00:00
Robert Griesemer
e718aee5f5 go/types: track gotypesalias non-default behavior
Fixes #66216.

Change-Id: I04d7389e5712b35db078844ce424e10f5b96156c
Reviewed-on: https://go-review.googlesource.com/c/go/+/579936
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>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-04-18 14:10:47 +00:00
Robert Griesemer
9101bf1916 go/types, types2: use types2.Config flag to control Alias node creation
Move Checker.enableAlias to Config.EnableAlias (for types2) and
Config._EnableAlias (for go/types), and adjust all uses.

Use Config.EnableAlias to control Alias creation for types2 and
with that remove dependencies on the gotypesalias GODEBUG setting
and problems during bootstrap. The only client is the compiler and
there we simply use the desired configuration; it is undesirable
for the compiler to be dependent on gotypesalias.

Use the gotypesalias GODEBUG setting to control Config._EnableAlias
for go/types (similar to before).

Adjust some related code. We plan to remove gotypesalias eventually
which will remove some of the new discrepancies between types2 and
go/types again.

Fixes #66874.

Change-Id: Id7cc4805e7ea0697e0d023c7f510867e59a24871
Reviewed-on: https://go-review.googlesource.com/c/go/+/579935
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-04-18 14:10:44 +00:00
Damien Neil
334ce51004 net/http: don't cancel Dials when requests are canceled
Currently, when a Transport creates a new connection for a request,
it uses the request's Context to make the Dial. If a request
times out or is canceled before a Dial completes, the Dial is
canceled.

Change this so that the lifetime of a Dial call is not bound
by the request that originated it.

This change avoids a scenario where a Transport can start and
then cancel many Dial calls in rapid succession:

  - Request starts a Dial.
  - A previous request completes, making its connection available.
  - The new request uses the now-idle connection, and completes.
  - The request Context is canceled, and the Dial is aborted.

Fixes #59017

Change-Id: I996ffabc56d3b1b43129cbfd9b3e9ea7d53d263c
Reviewed-on: https://go-review.googlesource.com/c/go/+/576555
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-17 21:11:57 +00:00
Michael Anthony Knyszek
4742c52e10 internal/abi: define EmptyInterface, TypeOf, and NoEscape
This change defines two commonly-defined functions and a
commonly-defined type in internal/abi to try and deduplicate some
definitions. This is motivated by a follow-up CL which will want access
to TypeOf in yet another package.

There still exist duplicate definitions of all three of these things in
the runtime, and this CL doesn't try to handle that yet. There are far
too many uses in the runtime to handle manually in a way that feels
comfortable; automated refactoring will help.

For #62483.

Change-Id: I02fc64a28f11af618f6071f94d27f45c135fa8ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/573955
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-17 21:09:59 +00:00
Roland Shoemaker
2073b35e07 crypto/tls: add a bogo shim
Run the BoGo test suite.

For now a number of tests are disabled, so that we can land the shim.
Once the shim is in the tree I'll work on fixing tests, and aligning
the TLS stack with the boringssl stack.

Eventually we should also remove the --loose-errors flag.

Fixes #51434

Change-Id: Ic8339fc34552936b798acf834011a129e375750e
Reviewed-on: https://go-review.googlesource.com/c/go/+/486495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2024-04-17 19:54:59 +00:00
Than McIntosh
c686783cab cmd/compile/internal/ssa: delay rewrite cycle detection for huge funcs
The SSA rewrite pass has some logic that looks to see whether a
suspiciously large number of rewrites is happening, and if so, turns
on logic to try to detect rewrite cycles. The cycle detection logic is
quite expensive (hashes the entire function), meaning that for very
large functions we might get a successful compilation in a minute or
two with no cycle detection, but take a couple of hours once cycle
detection kicks in.

This patch moves from a fixed limit of 1000 iterations to a limit set
partially based on the size of the function (meaning that we'll wait
longer before turning cycle detection for a large func).

Fixes #66773.

Change-Id: I72f8524d706f15b3f0150baf6abeab2a5d3e15c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/578215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-17 19:39:19 +00:00
Jes Cok
076166ab4e net/http: add ParseCookie, ParseSetCookie
Fixes #66008

Change-Id: I64acb7da47a03bdef955f394682004906245a18b
Reviewed-on: https://go-review.googlesource.com/c/go/+/578275
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-17 17:43:50 +00:00
guoguangwu
f367fea83a cmd/covdata: close cpu and mem profile
Change-Id: Iaf14989eb2981f724c4091f992ed99687ce3a60e
GitHub-Last-Rev: 6e6c82bb8f
GitHub-Pull-Request: golang/go#66852
Reviewed-on: https://go-review.googlesource.com/c/go/+/579255
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Than McIntosh <thanm@google.com>
2024-04-17 16:36:11 +00:00
Dmitri Shuralyov
626f6db588 all: update vendored golang.org/x/crypto
Pull in CL 578715:

	5defcc19 sha3: fix Sum results for SHAKE functions on s390x

Fixes #66804.

Change-Id: I72bb7862778c6e10a40b1aaeeafea49e1a0d80f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/579455
Reviewed-by: Michael Munday <mike.munday@lowrisc.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-04-17 16:35:04 +00:00
Lasse Folger
5bb4f49471 Revert "go/types, types2: track gotypesalias non-default behavior"
This reverts commit c51f6c6257.

Reason for revert: This breaks toolchain bootstrapping in Google. Root cause investigation is pending.

Error message is:

```
<unknown line number>: internal compiler error: panic: godebug: Value of name not listed in godebugs.All: gotypesalias
```

Change-Id: Ie3dff566a29b3b0846ebc8fe0a371c656a043a4c
Reviewed-on: https://go-review.googlesource.com/c/go/+/579575
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Lasse Folger <lassefolger@google.com>
2024-04-17 14:04:17 +00:00
Robert Griesemer
c51f6c6257 go/types, types2: track gotypesalias non-default behavior
Fixes #66216.

Change-Id: I2750a744d0dcf636a00d388299e1f2f993e5ac26
Reviewed-on: https://go-review.googlesource.com/c/go/+/572575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-04-16 22:41:00 +00:00
Robert Griesemer
15cec430d7 types2: flip the default value of GODEBUG=gotypesalias=1
This CL changes the interpretation of the unset value
of gotypesalias to not equal "0".

This is a port of CL 577715 from go/types to types2,
with adjustments to go/types to keep the source code
in sync. Specifically:

- Re-introduce testing of both modes (gotypesalias=0,
  gotypesalias=1) in go/types.
- Re-introduce setting of gotypesalias in some of the
  tests for explicit documentation in go/types.

The compiler still uses the (now) non-default setting
due to a panic with the default setting that needs to
be debugged.

Also, the type checkers still don't call IncNonDefault
when the non-default setting of gotypesalias is used.

Change-Id: I1feed3eb334c202950ac5aadf49a74adcce0d8c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/579076
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-04-16 21:06:56 +00:00
Alan Donovan
661f98141a go/internal/gcimporter: suppress 3 test cases when gotypesalias=1
CL 577715 caused these test cases to fail, but this was not
detected by CI because they are "long" tests.

Updates #66859

Change-Id: I84320d9091772540df2ab15f57d93031596bb89b
Reviewed-on: https://go-review.googlesource.com/c/go/+/579415
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-04-16 20:27:33 +00:00
David Chase
07496729c5 runtime/pprof: test for Darwin flake in TestVMInfo
If it contains
"No process corpse slots currently available, waiting to get one"
skip the test in short mode, so that run.bash works reliably
on developer laptops, but the flake is still recorded on builders.

The problem also seems to get better after a laptop reboot?

Updates #62352.

Change-Id: I12e8f594f0b830bacda5d8bfa594782345764c4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/579295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 19:59:50 +00:00
Lynn Boger
330bc95093 math/big: improve use of addze in mulAddVWW on ppc64x
Improve the use of addze to avoid unnecessary register
moves on ppc64x.

goos: linux
goarch: ppc64le
pkg: math/big
cpu: POWER10
                 │   old.out    │               new.out               │
                 │    sec/op    │    sec/op     vs base               │
MulAddVWW/1         4.524n ± 3%   4.248n ±  0%   -6.10% (p=0.002 n=6)
MulAddVWW/2         5.634n ± 0%   5.283n ±  0%   -6.24% (p=0.002 n=6)
MulAddVWW/3         6.406n ± 0%   5.918n ±  0%   -7.63% (p=0.002 n=6)
MulAddVWW/4         6.484n ± 0%   5.859n ±  0%   -9.64% (p=0.002 n=6)
MulAddVWW/5         7.363n ± 0%   6.766n ±  0%   -8.11% (p=0.002 n=6)
MulAddVWW/10       10.920n ± 0%   9.856n ±  0%   -9.75% (p=0.002 n=6)
MulAddVWW/100       83.46n ± 0%   66.95n ±  0%  -19.78% (p=0.002 n=6)
MulAddVWW/1000      856.0n ± 0%   681.6n ±  0%  -20.38% (p=0.002 n=6)
MulAddVWW/10000     8.589µ ± 1%   6.774µ ±  0%  -21.14% (p=0.002 n=6)
MulAddVWW/100000    86.22µ ± 0%   67.71µ ± 43%  -21.48% (p=0.065 n=6)
geomean             73.34n        63.62n        -13.26%


Change-Id: I95d6ac49ff6b64aa678e6896f57af9d85c923aad
Reviewed-on: https://go-review.googlesource.com/c/go/+/579235
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 17:59:58 +00:00
apocelipes
7a0e2db135 cmd,crypto/elliptic: fix typos in comments
Replace these incorrect fullwidth brackets with halfwidth brackets.

Change-Id: Ie17561c18334f9c07eedbff79e5f64ed4fc281bd
GitHub-Last-Rev: 94214be6ce
GitHub-Pull-Request: golang/go#66846
Reviewed-on: https://go-review.googlesource.com/c/go/+/579117
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 17:46:09 +00:00
Tobias Klauser
50c20dc382 os: remove unused issueNo field
It's no longer set since CL 31118.

Change-Id: Ibe77b1454b5e7fd02eaed432f04cf993f53791fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/579135
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-04-16 17:30:45 +00:00
Ian Lance Taylor
b1ae67501a doc: fix tense in godebug (s/revert/reverted)
Change-Id: Ida6ed22102a6da36739c7581aeab297fdd7bc9f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/561715
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 17:29:58 +00:00
Dmitri Shuralyov
f17b28de78 runtime: remove no-op slice operation in Caller
rpc was an array prior to CL 152537, so it was necessary to slice
it since callers accepts a slice. Now that rpc is already a slice,
slicing it is no longer required.

Change-Id: Ie646ef5e494323c9fb58f3a24f942e3b1ff639ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/579016
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-04-16 14:45:14 +00:00
Ian Lance Taylor
315b6ae682 debug/elf: define non-standard but well-known symbol types
Fixes #66836

Change-Id: I603faca2acd2bcffabbcaca8b8670d46387d2a5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/578995
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 00:01:16 +00:00