Filippo Valsorda [Mon, 22 May 2023 08:49:07 +0000 (10:49 +0200)]
crypto/tls: add WrapSession and UnwrapSession
There was a bug in TestResumption: the first ExpiredSessionTicket was
inserting a ticket far in the future, so the second ExpiredSessionTicket
wasn't actually supposed to fail. However, there was a bug in
checkForResumption->sendSessionTicket, too: if a session was not resumed
because it was too old, its createdAt was still persisted in the next
ticket. The two bugs used to cancel each other out.
For #60105
Fixes #19199
Change-Id: Ic9b2aab943dcbf0de62b8758a6195319dc286e2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/496821
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Filippo Valsorda [Sat, 20 May 2023 15:49:21 +0000 (17:49 +0200)]
crypto/tls: add SessionState and use it on the server side
This change by itself is useless, because the application has no way to
access or provide SessionStates to crypto/tls, but they will be provided
in following CLs.
Filippo Valsorda [Fri, 19 May 2023 21:28:43 +0000 (23:28 +0200)]
crypto/tls: reduce session ticket linkability
Ever since session ticket key rotation was introduced in CL 9072, we've
been including a prefix in every ticket to identify what key it's
encrypted with. It's a small privacy gain, but the cost of trial
decryptions is also small, especially since the first key is probably
the most frequently used.
Also reissue tickets on every resumption so that the next connection
can't be linked to all the previous ones. Again the privacy gain is
small but the performance cost is small and it comes with a reduction in
complexity.
For #60105
Change-Id: I852f297162d2b79a3d9bf61f6171e8ce94b2537a
Reviewed-on: https://go-review.googlesource.com/c/go/+/496817 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The existing implementation allocates a new 4KB buffer each time it opens flate-encoded file in a zip archive. This commit allows the flate reader to reuse the buffer on call Reset instead of allocating a new one.
It is noticeable when a zip archive contains a huge amount of files, e.g. zip archive has 50_000 files, for each file 4KB buffer is allocated, so it is 200MB memory allocations. If files are read sequentially only one buffer is needed.
Fixes #59774
Change-Id: Ib16336b101ba58e8f0f30a45dc5fd4eeebc801a1
GitHub-Last-Rev: f3f395b2ad95b7ad7ce9df6f5e49c7b6a0627627
GitHub-Pull-Request: golang/go#59775
Reviewed-on: https://go-review.googlesource.com/c/go/+/487675
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Alan Donovan [Wed, 24 May 2023 18:16:38 +0000 (14:16 -0400)]
go/types: set correct Pos for T in struct{p.T}
Previously, the field Var for T created for struct{p.T}
would use the Pos of the ast.Field, which coincides with p.
This change makes it use the Pos of T.
Errors about the field type are still reported at the
position of the ast.Field (e.g. *p.T) not the field T.
Fixes #60372
Change-Id: I06000874f2018d47159493626da3d16e6716f4c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/497882 Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Tobias Klauser [Wed, 24 May 2023 17:49:24 +0000 (19:49 +0200)]
os: add dirFs.ReadDir to implement fs.ReadDirFS for DirFS
Follow CL 416775 which added dirFs.ReadFile.
Fixes #53761
Change-Id: Iec19a815ab7c37a3206be141518cc587a588de20
Reviewed-on: https://go-review.googlesource.com/c/go/+/498015
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Mateusz Poliwczak [Mon, 15 May 2023 09:33:40 +0000 (09:33 +0000)]
net: root the nodata test domain to avoid search domains
I came across similar issue in CL 455275.
Without rooting this, the search domains might affect
the query, so the test might not prove the right thing.
The search domain will cause a change from no data
to NXDOMAIN error.
Change-Id: I59f4de2635f03c69adf29b74e25e4ebd71e7413b
GitHub-Last-Rev: 3a086c74f1453e4d1f2e88631ac835389984da17
GitHub-Pull-Request: golang/go#60197
Reviewed-on: https://go-review.googlesource.com/c/go/+/494896
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Filippo Valsorda [Fri, 5 May 2023 09:29:39 +0000 (11:29 +0200)]
crypto/rsa,crypto/internal/bigmod: optimized short exponentiations
RSA encryption and verification performs an exponentiation by a value
usually just a few bits long. The current strategy with table
precomputation is not efficient.
Add an ExpShort bigmod method, and use it in RSA public key operations.
After this, almost all CPU time in encryption/verification is spent
preparing the constants for the modulus, because PublicKey doesn't have
a Precompute function.
This speeds up signing a bit too, because it performs a verification to
protect against faults.
Filippo Valsorda [Sat, 25 Feb 2023 18:09:11 +0000 (19:09 +0100)]
crypto/internal/bigmod: switch to saturated limbs
Turns out that unsaturated limbs being more performant for Montgomery
multiplication was true in portable C89, but is now a misconception.
With add-with-carry instructions, it's possible to run the carry chain
across the limbs, instead of needing the limb-by-limb product to fit in
two words.
Switch to saturated limbs, and import the same Montgomery loop as
math/big, along with its assembly for some architectures. Since here we
know the sizes we care about, we can drop most of the assembly
scaffolding. For amd64, ported to avo, too.
We recover all the Go 1.20 performance loss on private key operations on
both Intel Xeon and AMD EPYC, with even a 10% improvement over Go 1.19
(which used variable-time math/big) for some operations.
Robert Griesemer [Wed, 24 May 2023 18:42:57 +0000 (11:42 -0700)]
spec: re-order built-ins sections alphabetically (more or less)
Put the sections for the various built-ins into alphabetical order
based on the built-in name, while keeping built-ins that belong
together together.
The order is now (captialized letter determines order):
- Append
- Clear
- Close
- Complex, real, imag
- Delete
- Len, cap
- Make
- Min, max (to be inserted here)
- New
- Panic, recover
- Print, println
There are some white space adjustments but no changes to the prose
of the moved sections.
Change-Id: Iaec509918c6bc965df3f28656374de03279bdc9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/498135 Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Derek Parker [Mon, 8 May 2023 21:28:43 +0000 (21:28 +0000)]
cmd/compile: prioritize non-CALL struct member comparisons
This patch optimizes reflectdata.geneq to pick apart structs in array
equality and prioritize non-CALL comparisons over those which involve
a runtime function call. This is similar to how arrays of strings
operate currently. Instead of looping over the entire array of structs
once, if there are any comparisons which involve a runtime function
call we instead loop twice. The first loop is all simple, quick
comparisons. If no inequality is found in the first loop the second loop
calls runtime functions for larger memory comparison, which is more
expensive.
miller [Mon, 8 May 2023 15:56:21 +0000 (16:56 +0100)]
cmd/go: quote entries in list-valued variables for go env in plan9
When 'go env' without an argument prints environment variables as
a script which can be executed by the shell, variables with a
list value in Plan 9 (such as GOPATH) need to be printed with each
element enclosed in single quotes in case it contains characters
significant to the Plan 9 shell (such as ' ' or '=').
For #58508
Change-Id: Ia30f51307cc6d07a7e3ada6bf9d60bf9951982ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/493535
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Tobias Klauser [Wed, 24 May 2023 10:28:25 +0000 (12:28 +0200)]
maps: move test funcs to maps_test.go
keysForBenchmarking and valuesForBenchmarking are only used in benchmark
tests.
Change-Id: Ie4fcb81e0470cc8627b395644787429b79952538
Reviewed-on: https://go-review.googlesource.com/c/go/+/497380 Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Joe Tsai [Tue, 21 Mar 2023 03:28:47 +0000 (20:28 -0700)]
net/http/pprof: adjust URL in package doc
The indentation makes the URL be treated as a code block,
thus preventing automatic detection of this URL.
Avoid using a code block for this.
Change-Id: Ie37ae18ec0969ef2d5a6e3b92b2512dac093dbf6
Reviewed-on: https://go-review.googlesource.com/c/go/+/478015
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Pratt [Wed, 24 May 2023 15:25:12 +0000 (11:25 -0400)]
os: explicitly check for invalid FD in NewFile
CL 497075 refactored NewFile to unconditionally dereference the file
returned by newFile. However, newFile can return nil if passed a
negative FD, which now causes a crash.
Resolve this by moving the invalid check earlier in NewFile, which also
lets us avoid a useless fcntl syscall on a negative FD.
Since we convert to int to check sign, adjust newFile to take an int
rather than uintptr, which cleans up a lot of conversions.
Fixes #60406
Change-Id: I382a74e22f1cc01f7a2dcf1ff4efca6a79c4dd57
Reviewed-on: https://go-review.googlesource.com/c/go/+/497877
Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Russ Cox [Tue, 23 May 2023 18:23:31 +0000 (14:23 -0400)]
cmd/go: implement 'toolchain local'
The actual selection code already worked
(except for the x/mod parser not reading the file),
so all that is necessary is a test.
For the test, move the version check up before
the module line presence check.
Mark Ryan [Fri, 19 May 2023 12:00:10 +0000 (14:00 +0200)]
runtime: fix alignment code in memclr_riscv64.s
The existing code incorrectly determines whether the pointer passed to
memclrNoHeapPointers is 8 byte aligned (it currently checks to see whether
it's 4 byte aligned).
In addition, the code that aligns the pointer, by individually filling
the first few bytes of the buffer with zeros, is also incorrect. It adjusts
the pointer by the wrong number of bytes, resulting in most cases, in
an unaligned pointer.
This commit fixes both of these issues by anding the pointer with 7
rather than 3 to determine its alignment, and by individually filling
the first (8 - (pointer & 7)) bytes with 0 to align the buffer, rather
than the first (pointer & 3) bytes.
We also remove an unnecessary immediate MOV instruction.
A new benchmark is added to test the performance of memclrNoHeapPointers
on non-aligned pointers. Results of the existing and the new benchmark
on a SiFive HiFive Unmatched A00 with 16GB of RAM running Ubuntu 23.04
are presented below.
Change-Id: I3b958a1d8e8f5ef205052e6b985a5ce21e92ef85
Reviewed-on: https://go-review.googlesource.com/c/go/+/496455
Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org> Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Paul Jolly [Wed, 24 May 2023 04:51:09 +0000 (05:51 +0100)]
fmt: correct documentation for Formatter
Before this CL, the documentation for Formatter suggested that
implementers of Format(f State, verb rune) could use Fprint(f) or
Sprint(f) to generate output. The Sprint(f) suggestion however is
invalid.
Fix that by simply suggesting Sprint() alongside Fprint(f).
Fixes #60358
Change-Id: I024e996f6360b812968ef2cd5073cb4c223459e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/497379 Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Michael Anthony Knyszek [Wed, 24 May 2023 16:43:47 +0000 (16:43 +0000)]
runtime: ensure consistency of /gc/scan/*
Currently /gc/scan/total:bytes is computed as a separate sum. Compute it
using the same inputs so it's always consistent with the sum of
everything else in /gc/scan/*.
For #56857.
Change-Id: I43d9148a23b1d2eb948ae990193dca1da85df8a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/497880
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Dmitri Shuralyov [Mon, 22 May 2023 16:56:28 +0000 (12:56 -0400)]
cmd/dist: copy trailing text more directly in testJSONFilter.process
Use io.Copy¹ that matches the comment more closely, avoids the
possibility of needing a bigger array, and is slightly shorter.
Its downside is that it takes two w.Write calls instead of one.
¹ Admittedly, it was temping to use io.CopyBuffer since the 'data'
byte slice becomes a viable buffer after its contents are written.
I resisted that temptation for two reasons.
One, it would need the io.Reader returned by dec.Buffered() (currently
a *bytes.Reader) to not implement the io.WriterTo interface for any
chance of making a positive difference. This seems not very likely.
Two, to avoid burdening anyone with determining that io.CopyBuffer
won't panic without 'if len(data) == 0 && data != nil { data = nil }'
because json.Marshal never returns an empty but non-nil byte slice.
Change-Id: I33c53d9d990f6ee79cd3ab90f12e3b575b9ebe72
Reviewed-on: https://go-review.googlesource.com/c/go/+/497736 Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Dmitri Shuralyov [Sat, 20 May 2023 03:20:43 +0000 (23:20 -0400)]
cmd/dist: make two related panic messages more consistent
In contrast to the HasSuffix argument, there's no need or benefit in
having a ":" before the "racebench" variant mentioned in the message.
(The variant comes after the colon separator—it doesn't include it.)
Change-Id: Ie9948104de9449422037bf39245944255b98f1b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/497735
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Michael Pratt [Wed, 24 May 2023 16:43:09 +0000 (12:43 -0400)]
cmd/go: fix PGO script flag matching
build_pgo.txt hard-coded a check for / rather than using ${/}, causing a
failure on Windows
The failure in build_pgo_auto_multi.txt is more interesting. If the
first argument to stdout starts with `-` the script engine expects it to
be a flag to grep, and thus doesn't regexp-escape `\` in the expansion
of `${/}`.
The script engine doesn't _require_ that these are flags to grep, so it
is still possible to use them for matching, but this ideally will change
in the future, so change all patterns to avoid starting with `-`.
Fixes #60408.
Change-Id: Ie4041a730d22ce40a4436abae7713f211dcb42e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/497881 Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Michael Anthony Knyszek [Fri, 19 May 2023 19:12:35 +0000 (19:12 +0000)]
runtime: cache inner pinner on P
This change caches the *pinner on the P to pool it and reduce the chance
that a new allocation is made. It also makes the *pinner no longer drop
its refs array on unpin, also to avoid reallocating.
The Pinner benchmark results before and after this CL are attached at
the bottom of the commit message.
Note that these results are biased toward the current change because of
the last two benchmark changes. Reusing the pinner in the benchmark
itself achieves similar performance before this change. The benchmark
results thus basically just confirm that this change does cache the
inner pinner in a useful way. Using the previous benchmarks there's
actually a slight regression from the extra check in the cache, however
the long pole is still setPinned itself.
Michael Anthony Knyszek [Tue, 23 May 2023 21:02:36 +0000 (21:02 +0000)]
runtime: move pinned object out of inner loop for benchmarks
In theory by allocating new objects every time, the benchmark is
including the performance of allocating new pinner bits for a span. In
practice however, most of the time each span already does have pinner
bits allocated (it's still a rare operation).
We can get a better sense of the raw cost of pinning an object (minus
pinner bits allocation) by moving the object allocation out of the inner
loop.
Change-Id: I2869fa6c3f353b726fe8440d2e6b7f89902f9364
Reviewed-on: https://go-review.googlesource.com/c/go/+/497620
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Roland Shoemaker [Tue, 21 Mar 2023 20:45:18 +0000 (13:45 -0700)]
crypto/x509: properly apply name constrains to roots and intermediates
Name constraints are checked during path building. When a new
certificate is considered for inclusion in a chain we check if it has
name constraints, and if it does, check that they apply to the certs
already in the chain, discarding it if the current chain violates any
of the constraints the candidate introduces.
This check was not acting as intended in two ways. The first was that
we only checked that the constraints on the candidate certificate
applied to the leaf certificate, and not the rest of the certiifcates in
the chain. This was the intended behavior pre-1.19, but in 1.19 we
intended for the constraints to be applied to the entire chain (although
obviously they were not).
The second was that we checked that the candidates constraints applied
to the candidate itself. This is not conformant with RFC 5280, which
says that during path building the constraint should only be applied to
the certificates which follow the certificate which introduces the
constraint (e.g. in the chain A -> B -> C, if certificate Bcontains a
name constraint, the constraint should only apply to certificate C).
The intended behavior introduced in 1.19 was mainly intended to reject
dubious chains which the WebPKI disallows, and are relatively rare, but
don't have significant security impact. Since the constraints were
properly applied to the leaf certificate, there should be no real impact
to the majority of users.
Fixes #59171
Change-Id: Ie6def55b8ab7f14d6ed2c09351f664e148a4160d
Reviewed-on: https://go-review.googlesource.com/c/go/+/478216 Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Sean Liao [Sat, 9 Jul 2022 18:08:59 +0000 (19:08 +0100)]
os: implement fs.ReadFileFS for DirFS
Use the os.ReadFile implementation to handle
sysfs files not reporting size properly via stat.
Fixes #53761
Change-Id: I6f34515e8a211e3659f4f6c3598fae7ec0c86975
Reviewed-on: https://go-review.googlesource.com/c/go/+/416775
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Rob Pike <r@golang.org> Reviewed-by: hopehook <hopehook@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
cui fliter [Wed, 24 May 2023 02:45:15 +0000 (10:45 +0800)]
all: fix unavailable url
RISC-V modified the address of github and the suffix of the file.
The previous link is no longer accessible. use latest link.
Change-Id: I5e33ea8447a59b8183658248df05c79ddd380cba
Reviewed-on: https://go-review.googlesource.com/c/go/+/497378
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: shuang cui <imcusg@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Wed, 24 May 2023 13:51:33 +0000 (13:51 +0000)]
runtime: skip TestCPUMetricsSleep as flaky
This test is fundamentally flaky because of a mismatch between how
internal idle time is calculated and how the test expects it to be
calculated. It's unclear how to resolve this mismatch, given that it's
perfectly valid for a goroutine to remain asleep while background
goroutines (e.g. the scavenger) run. In practice, we might be able to
set some generous lower-bound, but until we can confirm that on the
affected platforms, skip the test as flaky unconditionally.
Michael Pratt [Mon, 22 May 2023 18:14:44 +0000 (14:14 -0400)]
cmd/go: update build info when updating PGO file
setPGOProfilePath sets Package.Internal.PGOProfile very late in package
loading (because it may split/copy packages). Build info was computed
long before this, causing PGO packages to miss -pgo from their build
settings.
Adjust BuildInfo to be stored as *debug.BuildInfo rather than eagerly
converting to a string. This enables setPGOProfilePath to update the
BuildInfo at the same point that it sets PGOProfile.
Change-Id: Ic12266309bfd0f8ec440b0dc94d4df813b27cb04
Reviewed-on: https://go-review.googlesource.com/c/go/+/496958
Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
name old time/op new time/op delta
Values-10 8.67ms ± 0% 7.19ms ± 2% -17.05% (p=0.000 n=9+10)
name old alloc/op new alloc/op delta
Values-10 58.2kB ± 2% 48.3kB ± 2% -17.14% (p=0.000 n=9+10)
name old allocs/op new allocs/op delta
Values-10 0.00 0.00 ~ (all equal)
Change-Id: Idd35ea37514a21d97bdd6191c8fb8a478c00e414
Reviewed-on: https://go-review.googlesource.com/c/go/+/481436 Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: xie cui <523516579@qq.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Ian Lance Taylor [Tue, 9 May 2023 22:10:26 +0000 (15:10 -0700)]
testing: only report subtest races once
Before this CL the code would record the number of race detector
errors seen before starting a test, and then report an error
if there were more race detector errors after the test completed.
That approach did not work well for subtests or parallel tests.
Race detector errors could be reported multiple times at each
level of subtest, and parallel tests could accidentally drop
race detector errors.
Instead, report each race detector error at most once, associated
with whatever test noticed the new error. This is still imperfect,
as it may report race detector errors for the wrong parallel test.
But it shouldn't drop any errors entirely, and it shouldn't report
any errors more than once.
Fixes #60083
Change-Id: Ic9afea5c692b6553896757766f631cd0e86192ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/494057 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Brad Fitzpatrick [Tue, 23 May 2023 22:12:47 +0000 (15:12 -0700)]
database/sql: make RawBytes safely usable with contexts
sql.RawBytes was added the very first Go release, Go 1. Its docs
say:
> RawBytes is a byte slice that holds a reference to memory owned by
> the database itself. After a Scan into a RawBytes, the slice is only
> valid until the next call to Next, Scan, or Close.
That "only valid until the next call" bit was true at the time,
until contexts were added to database/sql in Go 1.8.
In the past ~dozen releases it's been unsafe to use QueryContext with
a context that might become Done to get an *sql.Rows that's scanning
into a RawBytes. The Scan can succeed, but then while the caller's
reading the memory, a database/sql-managed goroutine can see the
context becoming done and call Close on the database/sql/driver and
make the caller's view of the RawBytes memory no longer valid,
introducing races, crashes, or database corruption. See #60304
and #53970 for details.
This change does the minimal surgery on database/sql to make it safe
again: Rows.Scan was already acquiring a mutex to check whether the
rows had been closed, so this change make Rows.Scan notice whether
*RawBytes was used and, if so, doesn't release the mutex on exit
before returning. That mean it's still locked while the user code
operates on the RawBytes memory and the concurrent context-watching
goroutine to close the database still runs, but if it fires, it then
gets blocked on the mutex until the next call to a Rows method (Next,
NextResultSet, Err, Close).
Updates #60304
Updates #53970 (earlier one I'd missed)
Change-Id: Ie41c0c6f32c24887b2f53ec3686c2aab73a1bfff
Reviewed-on: https://go-review.googlesource.com/c/go/+/497675
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
Carlos Amedee [Wed, 17 May 2023 21:45:37 +0000 (17:45 -0400)]
internal/types/errors: generate Markdown files for compiler errors
This change adds a generator which creates a Markdown file for each
compiler error code which includes its associated documentation. The
Markdown files will be added to the x/website repository and used
to generate short error links on the Go website.
Change-Id: Ibabc3388d6ecc7f19151f3931554f72561e30b22
Reviewed-on: https://go-review.googlesource.com/c/go/+/495858 Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
sparse conditional constant propagation can discover optimization opportunities that cannot be found by just combining constant folding and constant propagation and dead code elimination separately.
Updates #59399
Change-Id: Ia954e906480654a6f0cc065d75b5912f96f36b2e
GitHub-Last-Rev: 90fc02db99f817b7f0ce5c584642ab1b166e62d7
GitHub-Pull-Request: golang/go#59575
Reviewed-on: https://go-review.googlesource.com/c/go/+/483875 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
cmd/asm: refine some APIs related to Prog.RestArgs[]
Before this CL, we use GetFrom3&SetFrom3 to get or set a source operand
which not fit into Prog.Reg. Those APIs operate the first element in
Prog.RestArgs without checking the type so they're fragile to break if
we have more than one different type of operands in the slice, which
will be a common case in Arm64.
This CL deprecates & renames some APIs related to Prog.RestArgs to make
those APIs more reasonable and robust than before.
Change-Id: I70d56edc1f23ccfffbcd6df34844e2cef2288432
Reviewed-on: https://go-review.googlesource.com/c/go/+/493355 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
Li [Mon, 22 May 2023 09:00:40 +0000 (17:00 +0800)]
runtime: pad work.full and pad.empty to avoid false sharing
With the Garbage collector (GC), we observed a false-sharing between
work.full and work.empty. (referenced most from runtime.gcDrain and
runtime.getempty)
This false-sharing becomes worse and impact performance on multi core
system. On Intel Xeon 8480+ and default GC setting(GC=100), we can
observed top HITM>4% (by perf c2c)caused by it.
After resolveed this false-sharing issue, we can get performance 8%~9.7%
improved. Verify workloads:
DeathStarBench/hotelReservation: 9.7% of RPS improved
https://github.com/delimitrou/DeathStarBench/tree/master/hotelReservation
gRPC-go/benchmark: 8% of RPS improved
https://github.com/grpc/grpc-go/tree/master/benchmark
miller [Wed, 1 Mar 2023 16:55:45 +0000 (16:55 +0000)]
os: make TestProgWideChdir detect more possible failure cases
This test is meant to detect the effect of Chdir not being
observed in other concurrent goroutines, possible in Plan 9
because each M runs in a separate OS process with its own
working directory. The test depends on Getwd to report the
correct working directory, but if Chdir fails then Getwd
may fail for the same reasons. We add a consistency check
that Stat(Getwd()) and Stat(".") refer to the same file.
Also change channel usage and add a sync.WaitGroup to
ensure test goroutines are not left blocked or running
when the main test function exits.
For #58802
Change-Id: I80d554fcf3617427c28bbe16e5e396367dcfe673
Reviewed-on: https://go-review.googlesource.com/c/go/+/472555 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David du Colombier <0intro@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Robert Griesemer [Tue, 23 May 2023 22:50:13 +0000 (15:50 -0700)]
cmd/compile: report an error URL with error messages
In the type checkers, add Config.ErrorURL (or Config._ErrorURL for
go/types) to configure whether and how an error message should report
a URL for errors that have an error code.
In the compiler, configure types2 to report an error URL of the form
" [go.dev/e/XXX]", where XXX stands for the error code, with the URL
appended to the first line of an error.
Rename the compiler flag -url to -errorurl. At the moment this flag
is disabled by default.
Example for a one-line error message:
<pos>: undefined: f [go.dev/e/UndeclaredName]
Example for a multi-line error message:
<pos>: not enough arguments in call to min [go.dev/e/WrongArgCount]
have ()
want (P, P)
Change-Id: I26651ce2c92ad32fddd641f003db37fe12fdb1cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/497715
Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Eli Bendersky [Fri, 19 May 2023 17:10:21 +0000 (10:10 -0700)]
slices: add sorting and comparison functions
Now that the `cmp` package exists, sorting and comparison functions from
`x/exp/slices` can be ported to the standard library, using the
`cmp.Ordered` type and the `cmp.Less` and `cmp.Compare` functions.
This move also includes adjustments to the discussions in #60091 w.r.t.
NaN handling and cmp vs. less functions, and adds Min/Max functions.
The final API is taken from
https://github.com/golang/go/issues/60091#issuecomment-1553850782
Updates #60091
Change-Id: Id7e6c88035b60d4ddd0c48dd82add8e8bc4e22d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/496078 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
Run-TryBot: Eli Bendersky <eliben@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Robert Griesemer [Tue, 23 May 2023 21:29:12 +0000 (14:29 -0700)]
go/types, types2: consider shared methods when unifying against interfaces
When unifying two types A and B where one or both of them are
interfaces, consider the shared method signatures in unification.
1) If a defined interface (an interface with a type name) is unified
with another (defined) interface, currently they must originate
in the same type declaration (same origin) for unification to
succeed. This is more restrictive than necessary for assignments:
when interfaces are assigned to each other, corresponding methods
must match, but the interfaces don't have to be identical.
In unification, we don't know which direction the assignment is
happening (or if we have an assignment in the first place), but
in any case one interface must implement the other. Thus, we
check that one interface has a subset of the methods of the other
and that corresponding method signatures unify.
The assignment or instantiation may still not be possible but that
will be checked when instantiation and parameter passing is checked.
If two interfaces are compared as part of another type during
unification, the types must be equal. If they are not, unifying
a method subset may still succeed (and possibly produce more type
arguments), but that is ok: again, subsequent instantiation and
assignment will fail if the types are indeed not identical.
2) In a non-interface type is unified with an interface, currently
unification fails. If this unification is a consequence of an
assignment (parameter passing), this is again too restrictive:
the non-interface type must only implement the interface (possibly
among other type set requirements). In any case, all methods of the
interface type must be present in the non-interface type and unify
with the corresponding interface methods. If they don't, unification
will fail either way. If they do, we may infer additional type
arguments. Again, the resulting types may still not be correct but
that will be determined by the instantiation and parameter passing
or assignment checks. If the non-interface type and the interface
type appear as component of another type, unification may now
produce additional type arguments. But that is again ok because the
respective types won't pass instantiation or assignment checks since
they are different types.
This CL introduces a new unifier flag, enableInterfaceInference, to
enable this new behavior. It is currently disabled.
For #60353.
For #41176.
For #57192.
Change-Id: I983d0ad5f043c7fe9d377dbb95f6b9342f36f45f
Reviewed-on: https://go-review.googlesource.com/c/go/+/497656
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Paul E. Murphy [Mon, 22 May 2023 15:38:12 +0000 (10:38 -0500)]
debug/elf: define R_PPC64_REL24_P9NOTOC
This relocation is not (yet?) defined in ELFv2, but has been added to
gnu gas a couple years ago. It is the same reloc as
R_PPC64_REL24_NOTOC, but hints power10 instructions should not be
emitted.
Michael Anthony Knyszek [Tue, 23 May 2023 19:17:51 +0000 (19:17 +0000)]
runtime: move pinner variable into inner loop for benchmarks
Currently the pinner is created outside of the benchmarking loop.
However, this means that we get to reuse the same pinner for each loop;
in general, users are expected to create a pinner for a e.g. a cgo
call and then that variable will expire with the frame it lives in. (If
they can reuse the variable, great! However, I don't expect that to be
common.)
In essence, this benchmarks a harder case. It's not more right or wrong
than the previous version, but the fact that it's a slightly harder case
(that still mostly captures what the original version was capturing) is
useful.
Change-Id: I94987127f54d7bfecd7b8e6a5e632631ea57ad24
Reviewed-on: https://go-review.googlesource.com/c/go/+/497616
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Robert Griesemer [Fri, 19 May 2023 15:28:24 +0000 (08:28 -0700)]
go/types, types2: consider shared methods when unifying against interfaces
When unifying two types A and B where one or both of them are
interfaces, consider the shared method signatures in unification.
1) If a defined interface (an interface with a type name) is unified
with another (defined) interface, currently they must originate
in the same type declaration (same origin) for unification to
succeed. This is more restrictive than necessary for assignments:
when interfaces are assigned to each other, corresponding methods
must match, but the interfaces don't have to be identical.
In unification, we don't know which direction the assignment is
happening (or if we have an assignment in the first place), but
in any case one interface must implement the other. Thus, we
check that one interface has a subset of the methods of the other
and that corresponding method signatures unify.
The assignment or instantiation may still not be possible but that
will be checked when instantiation and parameter passing is checked.
If two interfaces are compared as part of another type during
unification, the types must be equal. If they are not, unifying
a method subset may still succeed (and possibly produce more type
arguments), but that is ok: again, subsequent instantiation and
assignment will fail if the types are indeed not identical.
2) In a non-interface type is unified with an interface, currently
unification fails. If this unification is a consequence of an
assignment (parameter passing), this is again too restrictive:
the non-interface type must only implement the interface (possibly
among other type set requirements). In any case, all methods of the
interface type must be present in the non-interface type and unify
with the corresponding interface methods. If they don't, unification
will fail either way. If they do, we may infer additional type
arguments. Again, the resulting types may still not be correct but
that will be determined by the instantiation and parameter passing
or assignment checks. If the non-interface type and the interface
type appear as component of another type, unification may now
produce additional type arguments. But that is again ok because the
respective types won't pass instantiation or assignment checks since
they are different types.
This CL introduces a new Config flag, EnableInterfaceInference, to
enable this new behavior. If not set, unification remains unchanged.
To be able to test the flag durign unification, a *Checker is passed
and stored with the unifier.
For #60353.
Fixes #41176.
Fixes #57192.
Change-Id: I6b167a9afa378d0682e9b101d9d86f5777308af7
Reviewed-on: https://go-review.googlesource.com/c/go/+/497015
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Egon Elbre [Mon, 22 May 2023 19:40:47 +0000 (22:40 +0300)]
fmt,math/big,net/url: fixes to old Benchmarks
b.ResetTimer used to also stop the timer, however it does not anymore.
These benchmarks hadn't been fixed and as a result ended up measuring
some additional things.
Also, make some for loops more conventional.
Change-Id: I76ca68456d85eec51722a80587e5b2c9f5d836a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/496996
Run-TryBot: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Change-Id: I8a903b76d80f451b498b145b14c97f96191e05f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/486775 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Sean Liao [Sun, 21 May 2023 14:16:48 +0000 (15:16 +0100)]
encoding: document when marshaling methods can be added
Fixes #10275
Change-Id: I2b3d54f3eb0f85d65324ddc3c3b2a797d42a16c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/496537
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Tobias Klauser [Mon, 22 May 2023 18:37:05 +0000 (20:37 +0200)]
os: avoid second fcntl syscall in NewFile on unix
CL 494915 introduced an additional fcntl(F_GETFL) syscall to determine
whether the file is in append-only mode. The existing unix.IsNonblock
call also issues an fcntl(F_GETFL) syscall. The two can be combined and
both the append-only mode and the non-blocking flags can be determined
from that syscall's result.
Rob Findley [Fri, 14 Apr 2023 00:52:53 +0000 (20:52 -0400)]
go/types: update TestStdlib to type-check concurrently
In order to have some test coverage of concurrent use of the go/types
APIs, update the Stdlib test to type-check concurrently. In combination
with non-deterministic ordering, this should hopefully provide moderate
test coverage of concurrent use.
Also, remove the arbitrary 10ms timeout in short mode, in favor of
simply not running.
After this change, TestStdlib went from taking 16s on my laptop to 2s,
in part because of the parallelism and in part because we are no longer
type-checking twice (once for the import er, once for the test).
Fixes golang/go#47729
Change-Id: Ie49743947ab2d5aec051c3d09ce045acf5b94ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/484540 Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Ian Lance Taylor [Tue, 23 May 2023 18:54:44 +0000 (11:54 -0700)]
cmd/internal/objabi: regenerate RelocType strings
Change-Id: I6c9a8decb5b261be4548f148739b44e8860c5f8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/497595
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Thu, 18 May 2023 16:35:11 +0000 (16:35 +0000)]
runtime/metrics: refactor CPU stats accumulation
Currently the CPU stats are only updated once every mark termination,
but for writing robust tests, it's often useful to force this update.
Refactor the CPU stats accumulation out of gcMarkTermination and into
its own function. This is also a step toward real-time CPU stats.
While we're here, fix some incorrect documentation about dedicated GC
CPU time.
For #59749.
For #60276.
Change-Id: I8c1a9aca45fcce6ce7999702ae4e082853a69711
Reviewed-on: https://go-review.googlesource.com/c/go/+/487215
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Thu, 18 May 2023 15:51:57 +0000 (15:51 +0000)]
runtime: fix usage of stale "now" value for netpolling Ms
Currently pidleget gets passed "now" from before the M goes into
netpoll, resulting in incorrect accounting of idle CPU time.
lastpoll is also stored with a stale "now": the mistake was added in the
same CL it was added for pidleget.
Recompute "now" after returning from netpoll.
Also, start tracking idle time on js/wasm at all.
Credit to Rhys Hiltner for the test case.
Fixes #60276.
Change-Id: I5dd677471f74c915dfcf3d01621430876c3ff307
Reviewed-on: https://go-review.googlesource.com/c/go/+/496183 Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Austin Clements [Mon, 22 May 2023 23:12:54 +0000 (19:12 -0400)]
runtime: symbolize wrappers as a last resort in race tracebacks
CL 466099 rewrote stack symbolization in race reports. Prior to this
CL, physical frames consisting entirely of wrapper logical frame would
print the wrapper, even though in other cases we try to avoid
printing wrappers. CL 466099 unintentionally changed this behavior and
now physical frames consisting entirely of wrapper frames instead fail
to symbolize and print "??()".
Fix this by taking the outermost wrapper frame if the entire logical
frame expansion consists of wrappers.
Russ Cox [Tue, 23 May 2023 16:37:01 +0000 (12:37 -0400)]
cmd/go: set default GOTOOLCHAIN in GOROOT/go.env
As part of the work for #57179 we moved configurable defaults
to GOROOT/go.env, so that packagers don't have to modify
source code to change those defaults. Since packagers may want
to modify GOTOOLCHAIN's default, move it to go.env too.
This CL modifies 'go env' to print GOTOOLCHAIN by default.
It also refines CL 496957 from yesterday to recognize any env
var in either go.env or the user go/env, not just the user go/env.
When I put GOTOOLCHAIN in go.env, but before I added it to
the default printing list, 'go env GOTOOLCHAIN' was printing
an empty string, and it was incredibly confusing.
For #57001.
Fixes #60361 while we're here.
Also includes a fix for a review comment on CL 497079 that I forgot to mail.
Michael Anthony Knyszek [Tue, 23 May 2023 17:15:21 +0000 (17:15 +0000)]
runtime: add partial lock order between mspanSpecial and gcBitsArenas
CL 493275 started using gcBits for pinner bits. This means gcBits can be
allocated while holding the mspanSpecial lock. This is safe because
these were just parallel in the partial order, but now they need an
explicit edge between them.
For #58277.
Change-Id: I37917730e12d59cf0580f198d732198413a56424
Reviewed-on: https://go-review.googlesource.com/c/go/+/497475
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Cherry Mui [Mon, 15 May 2023 20:42:45 +0000 (16:42 -0400)]
cmd/compile: build compiler with PGO
Reapples CL 495596, which was reverted at CL 496185. The x/tools
failure, #60263, has been resolved. The ppc64 failures, #60368, have
_not_ been resolved, but are believed to be specific to that port. This
CL will make ppc64 flaky while the issue is investigated, but give more
soak time on primary ports.
Build the compiler with PGO. As go build -pgo=auto is enabled by
default, we just need to store a profile in the compiler's
directory.
The profile is collected from building all std and cmd packages on
Linux/AMD64 machine, using profile.sh.
Roland Shoemaker [Fri, 17 Feb 2023 19:14:49 +0000 (11:14 -0800)]
crypto/rsa: make DecryptPKCS1v15SessionKey warning more dire
Updates the DecryptPKCS1v15SessionKey function comment to be less cut
and dry about its protections against Bleichenbacher attacks. In
particular note that the protocol using this method must be explicitly
designed with these mitigations in mind, and call out usages which
may cause the migiations to be useless.
Change-Id: I06fd25157f12a3afb401bb08dff4faef7fb0a9b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/469235 Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: David Chase <drchase@google.com>