Repository: go
Issue: runtime: "sweep increased allocation count" on darwin-arm64-corellium builder
Labels: NeedsInvestigation,compiler/runtime

From https://build.golang.org/log/f06119002ee0fe160d0b78b3e67ce274e468a96d:
(Note that the failure occurred during bootstrapping, in the `toolchain3` phase.)

This might be blocked on #21729.

<details>

```
darwin-arm64-corellium at ed7a92bab459806c958459264f8c88495ea6c4ba

:: Running /bin/bash with args ["bash" "/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/make.bash"] and env ["SHELL=/bin/sh" "TMUX=/private/var/tmp/tmux-501/default,13591,0" "GOROOT_BOOTSTRAP=/tmp/workdir-host-darwin-arm64-corellium-ios/go1.4" "PWD=/var/mobile" "RSYNC_RSH=ssh" "LOGNAME=mobile" "HOME=/var/mobile" "LANG=en_US.UTF-8" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" "GO_BUILDER_ENV=host-darwin-arm64-corellium-ios" "CLICOLOR=" "SSH_CONNECTION=10.11.3.2 64144 10.11.0.1 22" "TERM=screen" "USER=mobile" "TMUX_PANE=%0" "SHLVL=2" "SSH_CLIENT=10.11.3.2 64144 22" "PATH=/var/mobile/bin:/var/mobile/bin:/var/mobile/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games" "CC=/var/mobile/bin/clangsign" "MAIL=/var/mail/mobile" "SSH_TTY=/dev/ttys001" "_=/var/mobile/go/bin/buildlet" "WORKDIR=/tmp/workdir-host-darwin-arm64-corellium-ios" "GO_BUILDER_NAME=darwin-arm64-corellium" "GOROOT_BOOTSTRAP=/var/mobile/go-darwin-arm64-bootstrap" "GOBIN=" "TMPDIR=/tmp/workdir-host-darwin-arm64-corellium-ios/tmp" "GOCACHE=/tmp/workdir-host-darwin-arm64-corellium-ios/gocache" "GOROOT_BOOTSTRAP=/var/mobile/go-darwin-arm64-bootstrap"] in dir /tmp/workdir-host-darwin-arm64-corellium-ios/go/src

Building Go cmd/dist using /var/mobile/go-darwin-arm64-bootstrap.
Building Go toolchain1 using /var/mobile/go-darwin-arm64-bootstrap.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
warning: unable to find runtime/cgo.a
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
# os
runtime: nelems=3 nalloc=2 previous allocCount=1 nfreed=65535
fatal error: sweep increased allocation count

runtime stack:
runtime.throw(0x1009ed10d, 0x20)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/panic.go:714 +0x4c
runtime.(*mspan).sweep(0x103a5a380, 0x103a5a300, 0x16ff0ab00)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/mgcsweep.go:329 +0x864
runtime.(*mcentral).uncacheSpan(0x101149560, 0x103a5a380)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/mcentral.go:197 +0x114
runtime.(*mcache).releaseAll(0x1017006d0)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/mcache.go:155 +0x68
runtime.(*mcache).prepareForSweep(0x1017006d0)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/mcache.go:182 +0x44
runtime.acquirep(0x130030500)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:4114 +0x30
runtime.stopm()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:1930 +0xc0
runtime.gcstopm()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:2125 +0xbc
runtime.schedule()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:2481 +0x430
runtime.goschedImpl(0x130000180)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:2625 +0xe0
runtime.gopreempt_m(0x130000180)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/proc.go:2653 +0x30
runtime.newstack()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/stack.go:1033 +0x1f4
runtime.morestack()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/runtime/asm_arm64.s:310 +0x70

goroutine 1 [runnable]:
cmd/compile/internal/ssa.(*poset).lookup(0x1303ab400, 0x1309754f0, 0x100000079)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/poset.go:263 +0xe0
cmd/compile/internal/ssa.(*poset).setOrder(0x1303ab400, 0x1309754f0, 0x130972540, 0x13106cc00, 0xffffffffffffff00)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/poset.go:865 +0x40
cmd/compile/internal/ssa.(*poset).SetOrderOrEqual(...)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/poset.go:999
cmd/compile/internal/ssa.(*factsTable).update(0x131097580, 0x1309a8e60, 0x1309754f0, 0x130972540, 0x1, 0x3)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/prove.go:233 +0x1b14
cmd/compile/internal/ssa.addRestrictions(0x1309a8e60, 0x131097580, 0x1, 0x1309754f0, 0x130972540, 0x3)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/prove.go:983 +0x6c
cmd/compile/internal/ssa.addBranchRestrictions(0x131097580, 0x1309a8e60, 0x1)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/prove.go:956 +0x188
cmd/compile/internal/ssa.prove(0x131084580)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/prove.go:822 +0xbd8
cmd/compile/internal/ssa.Compile(0x131084580)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/ssa/compile.go:92 +0x808
cmd/compile/internal/gc.buildssa(0x1306b9760, 0x0, 0x0)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/gc/ssa.go:288 +0xb10
cmd/compile/internal/gc.compileSSA(0x1306b9760, 0x0)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/gc/pgen.go:297 +0x28
cmd/compile/internal/gc.compile(0x1306b9760)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/gc/pgen.go:276 +0x34c
cmd/compile/internal/gc.funccompile(0x1306b9760)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/gc/pgen.go:221 +0xbc
cmd/compile/internal/gc.Main(0x1009fdbe8)
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/internal/gc/main.go:676 +0x31a4
main.main()
	/private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/src/cmd/compile/main.go:51 +0xa8
go tool dist: FAILED: /private/var/tmp/workdir-host-darwin-arm64-corellium-ios/go/pkg/tool/darwin_arm64/go_bootstrap install -gcflags=all= -ldflags=all= -a -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2
```

</details><br>