Skip to content

[pull] master from golang:master - #196

Merged
pull[bot] merged 23 commits into
trailofbits:masterfrom
golang:master
Sep 3, 2026
Merged

[pull] master from golang:master#196
pull[bot] merged 23 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull

@pull pull Bot commented Sep 3, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

derekparker and others added 23 commits September 2, 2026 18:34
randHeapBasePrefixMask clears the top byte at heapAddrBits-8 (bit 40 on
amd64), but hint generation places the randomized prefix byte at
randHeapAddrBits-8 (bit 38): randHeapAddrBits is heapAddrBits-1 on most
platforms and heapAddrBits-2 on amd64. The randHeapBase bits between
those two positions survive the mask and are OR'd into the prefix's low
bits in

        p = prefix | (randHeapBase & randHeapBasePrefixMask)

so wherever one of those stray bits is 1 (~75% of process launches),
the corresponding bit of every generated prefix is forced to 1.
Distinct prefix values randHeapBasePrefix+i then collapse to the same
address in pairs or quads, and the arena hint chain carries duplicate
and non-monotonically-spaced hint addresses at doubled or quadrupled
spacing. The heap still works because hints are only mmap placement
fallbacks, but the layout the randomization intends (64 distinct,
evenly spaced heap hints) is silently violated, duplicate hints waste
mmap retries, and two bits of intended address-space structure are
lost.

Define the mask from a hoisted randHeapAddrBits constant instead, and
drop mallocinit's now-duplicate local.

The new TestArenaHintChainGeneration asserts the hint chain holds
pairwise distinct addresses with at most one non-ascending step (the
prefix byte's single mod-256 wraparound); it fails on 10/10 launches
with the old mask and passes with the fix. The test is skipped when
randomizeHeapBase is false: in race mode the hint chain deliberately
repeats addresses within TSAN's narrow heap range, and on 32-bit the
chain is built dynamically by sysAlloc from adjacent up/down hints.

Change-Id: I9aec248b1b606a95f0ff88e7083734a982aa36d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/823944
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Add Sub to the scalable SVE vector types, lowering to ZSUB and ZFSUB. It
is the first non-commutative operation with a merging-predicated form,
which folds more restrictively: only a select whose "else" operand is the
minuend matches, with no mirrored and no MOVPRFX-prefixed rule, and
ZSUBMerging is pinned resultInArg0; see sveMergingPeephole in
gen_simdrules.go.

Also assert in the shared ssa-to-prog helper that a resultInArg0 op never
reaches the source-swapping path, which would silently compute y-x for a
non-commutative op; see simdZ2kvPred in arm64/ssa.go.

For #79781.

Change-Id: Ifa2ee4dee0bbd11a928284f48a9254a25cb91211
Reviewed-on: https://go-review.googlesource.com/c/go/+/820760
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
…dicate

Add Abs to the scalable SVE vector types, lowering to ZABS. It is the
first operation with no unpredicated encoding: the Go API runs it under
a synthesized all-true predicate, and a select over it folds by putting
the select's mask in that predicate's place,

	(ZSELB (ZABSB x <all-true>) z mask) => (ZABSMergingB z x mask)

so IfElse costs no extra instruction and Masked costs only its zero
vector. ABS is constructive, so its merging form carries the merge value
as a resultInArg0 operand and needs no MOVPRFX.

Only the merging encoding is used: zeroing predication here is an
Armv9.6-A extension that baseline SVE hardware traps, and nothing the
XML parser exposes distinguishes it; see groupPredicatedOnly in
sve/load.go.

For #79781.

Change-Id: I1547a3c513edca52b11039bcce8023d900027dce
Reviewed-on: https://go-review.googlesource.com/c/go/+/820761
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZSQSUB and ZUQSUB. Both have unpredicated and merging-predicated
encodings, so the existing machinery derives the non-commutative merging
fold; the peepholes are exercised by the Add/Sub/Abs tests already.

For #79781.

Change-Id: I1561e53ce9970207ca068d9931193b9dd163e13f
Reviewed-on: https://go-review.googlesource.com/c/go/+/822925
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Lower to ZNEG and ZFNEG, both predicated-only like ZABS: the Go API runs
them under a synthesized all-true predicate, and selects fold into the
merging form via the existing machinery.

For #79781.

Change-Id: I115580252857cae0a522278371dac122f0624fc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/822926
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZFABS, predicated-only like ZABS, for parity with the NEON and
amd64 Abs API surface.

For #79781.

Change-Id: I259c705758f5b6ae0b40139e0dee0e2f689b3ec0
Reviewed-on: https://go-review.googlesource.com/c/go/+/822927
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZFSQRT, predicated-only like ZFABS.

For #79781.

Change-Id: I71a88f0e3135dae3905dab04c248e8336be0060e
Reviewed-on: https://go-review.googlesource.com/c/go/+/822928
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Lower to ZFRINTP, predicated-only like ZFSQRT.

For #79781.

Change-Id: Ic405ba37bde1b4890a85b9edeb8b772a7af98814
Reviewed-on: https://go-review.googlesource.com/c/go/+/822929
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Lower to ZFRINTM, predicated-only like ZFSQRT.

For #79781.

Change-Id: Ibc60df151b44ad3327d5ab10cf66d431ef5d730d
Reviewed-on: https://go-review.googlesource.com/c/go/+/822930
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Lower to ZFRINTZ, predicated-only like ZFSQRT.

For #79781.

Change-Id: If1d5329bbcd156e596611cfe72f7e41f40148462
Reviewed-on: https://go-review.googlesource.com/c/go/+/822931
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Lower to ZFRINTN (round to nearest, ties to even), predicated-only like
ZFSQRT, matching the NEON Round mapping.

For #79781.

Change-Id: Ib73cefd4313e1382a73a2e0f6d20dc96a89fab56
Reviewed-on: https://go-review.googlesource.com/c/go/+/822932
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZCMPHI and ZFCMGT, predicated-only like ZCMPGT, for parity with
the NEON Greater API surface.

For #79781.

Change-Id: Ibe5fb3f9061ee890c783f326b2c57be45b3e6051
Reviewed-on: https://go-review.googlesource.com/c/go/+/822933
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Lower to ZCMPEQ for both integer signednesses and ZFCMEQ for floats,
predicated-only like ZCMPGT.

For #79781.

Change-Id: I5a98a1adfd2b4afe8f7b6c4266de0ff006ca59bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/822934
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Lower to ZCMPNE for both integer signednesses and ZFCMNE for floats,
predicated-only like ZCMPGT. NEON has no native not-equal compare; SVE
does, so the API is provided directly.

For #79781.

Change-Id: Id58641731b0ea682b699015c3a2eda0d8563b568
Reviewed-on: https://go-review.googlesource.com/c/go/+/822935
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZCMPGE (signed), ZCMPHS (unsigned), and ZFCMGE (float),
predicated-only like ZCMPGT.

For #79781.

Change-Id: Ica18c8987d099afaf2dad5f95196faea3258d4f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/822936
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: David Chase <drchase@google.com>
Lower to ZAND. A bitwise vector operation's unpredicated encoding is a
single width-agnostic .D instruction, while its merging-predicated sibling
is per-<T>; the loader now emits a def per element width for such
operations (recognized by the spec's "Bitwise " brief, as the NEON loader
does) and simdgen collapses their unpredicated machine op back to the one
.D instruction, keeping the per-width merging forms:

	(AndInt8s x y) => (ZANDD x y)
	(ZSELB (ZANDD x y) x mask) => (ZANDMergingB x y mask)

For #79781.

Change-Id: I5e6caa56ab72c868e58775127d4441345ed5bede
Reviewed-on: https://go-review.googlesource.com/c/go/+/822937
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Bypass: David Chase <drchase@google.com>
Shared promoted wrapper symbols used the outer receiver's package and a
short name for the wrapped receiver. Same-named receiver types from
separate packages could therefore collide, causing the linker to use a
wrapper with an incompatible method signature.

For example, both a.W.M and b.W.M produced:

    main..embed.W.M.1.0

Put wrappers in the wrapped receiver's package, and end their names with
the ordinary wrapped method symbol, producing:

    foo.bar/a..embed.1.0.foo.bar/a.W.M
    foo.bar/b..embed.1.0.foo.bar/b.W.M

The trailing method symbol also lets consumers such as go-cmp's NameOf
recover bytes.Buffer.Write instead of returning an empty name.

Fixes #81286

Change-Id: Ibd7ab2767c0c1a07f9b9445d326258ff5507a644
Reviewed-on: https://go-review.googlesource.com/c/go/+/826084
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
Lower to ZORR, width-agnostic bitwise like ZAND.

For #79781.

Change-Id: I7936182383cd2b71eef542ecd965e57feaa29fcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/822938
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Lower to ZEOR, width-agnostic bitwise like ZAND.

For #79781.

Change-Id: I01eaa7c8aa8c3b77fabe7d42320043d20c7961b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/822939
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Change-Id: Ie68c00da89df118ebda2a49f773686c6a7b64167
Reviewed-on: https://go-review.googlesource.com/c/go/+/806825
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Fix the misspelling of "instruction" in the identical comments on
simdVgpvImm and simdVgpImm. Comment-only change; no functional
changes.

Change-Id: Ib4ccd1950876050c588e9be64c8e030f6180bb77
Reviewed-on: https://go-review.googlesource.com/c/go/+/818600
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
…rompt

TestAfterQueuing dates to CL 3416043, which reimplemented After to keep a
queue of pending deadlines instead of spending a goroutine and a host
process per call. The property it means to check is that timers created
in one order but with deadlines in another fire in deadline order.

It never checked that. It started 13 goroutines, each blocking on one
After channel and then sending the result on a shared channel, and
required the sends to arrive in slot order. Which goroutine reaches the
shared channel first is up to the scheduler, so on a machine where a
woken goroutine can be delayed the test fails even though the timers
were queued and fired correctly. That is what has been happening on
linux/s390x: 94 failures since 2025-05-13, every one an ordering
complaint, and in every one all five attempts failed, so the retry loop
never helped. The arrival time check that follows was never reached in
any of them.

There were also previous attempts at deflaking in CL 4335042 (2011)
and CL 9795 (2015).

Sort the results by the time each timer reported instead. That is the
order the timers fired in, it does not depend on the scheduler, and it
lets the arrival time check run. The retry loop stays, since that check
does depend on the machine keeping up, but it is no longer papering over
the ordering check.

Also pass the after parameter through to the goroutines. CL 3366171
added it so the test could cover both the channel and the AfterFunc
implementations, but the call kept using the package level After, so
impl=func has been a second copy of impl=chan and newTimerFunc was never
reached. Verified by making newTimerFunc panic: with the old call
impl=func passes and never reaches it, with this change it does.

For #9903.
For #10680.
For #58901.
For #80294.

Change-Id: I7b3a5db3268612c3d515a090714fca1b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/822724
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
The test constructed its synthetic tool directory using GOOS and GOARCH,
while testgo located installed tools using TESTGO_GOHOSTOS and
TESTGO_GOHOSTARCH. When these architectures differed, `go install`
failed with `go: no such tool "compile"`.

Preserve the installed host tool directory as the symlink source, then
make testgo use its runtime tuple within the synthetic GOROOT.

Change-Id: Ia132fffa8acb842ec6de98c2c166294886b8a231
Reviewed-on: https://go-review.googlesource.com/c/go/+/826364
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
@pull pull Bot locked and limited conversation to collaborators Sep 3, 2026
@pull pull Bot added the ⤵️ pull label Sep 3, 2026
@pull
pull Bot merged commit e0a569a into trailofbits:master Sep 3, 2026
9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants