Closed
Description
Go version
go version go1.24.4 darwin/arm64
Output of go env
in your module/workspace:
N/A
What did you do?
While I ran into the issue in real code, it's somewhat obscure and impossible to reproduce using https://go.dev/play, since it requires passing -ldflags=-checklinkname=0
to go build
.
In short, I called sysReserveAlignedSbrk(65536, 0)
twice.
What did you see happen?
The lock taken here wasn't released during the first call, because this return is hit, leading to a panic in the second call.
What did you expect to see?
The lock to always be released, presumably by adding unlock(&memlock)
before each return.
It's not clear to me whether this is reachable without pull-mode linking of sysReserveAlignedSbrk
or sysReserveAligned
, since the former is only called by the latter, and the latter seems unused—but I might certainly be missing usages of either or both.