both arm64 and amd64 builds succeed the go build through docker, as they did with go 1.18
What did you see instead?
The errors differ each time but seem to revolve around: mallocgc called without a P or outside bootstrapping
I was able to reproduce this issue on two machines as well, both M1s. I was also able to build the code successfully on an actual md64 machine on go1.19 without issue. This appears to only be an issue when go is invoked through docker+qemu+amd64.
We've generally had problems with bugs in qemu. It is not a supported platform. See #1508 for details.
I'm not sure there is anything we can do here. I would guess it is some sort of bug in qemu threads. Please reopen if you can reproduce without qemu, or if someone can investigate and determine it is something suspicious in the runtime (e.g. depending on something not guaranteed by posix).