go: runtime: bsdthread_register error on macOS 12
Everything has been working perfectly for a while until I decided to upgrade Mac OS to Monterey.
What version of Go are you using (go version)?
go version go1.17.2 darwin/amd64
Does this issue reproduce with the latest release?
Yes. I have tried updating go to the latest version, as well as updating to the latest of xcode and command tools. Also ran brew upgrade to make sure everything is updated. Also tried diffrent shells to see if that makes any difference. I am also running the latest version of docker.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/deanwronowski/Library/Caches/go-build" GOENV="/Users/deanwronowski/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/deanwronowski/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/deanwronowski/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.17.2/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.17.2/libexec/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.17.2" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1p/q77885x9157c_yvzss7zx1480000gn/T/go-build2753144081=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
When running the following command to connect to a server running docker it produces the error. It does not matter if the server is hosted on AWS EC2 or Digital Ocean droplets.
It seems this issue is not related just to Docker, as I am also getting this error when running a command in the terminal inside of VS.
eval "$(docker-machine env machinegoeshere)"
What did you expect to see?
Usually nothing displays which indicates its connected to the server.
What did you see instead?
fatal error: runtime: bsdthread_register error runtime stack: runtime.throw(0x20594e0, 0x21) /usr/local/go/src/runtime/panic.go:619 +0x81 fp=0x7ff7bfeff878 sp=0x7ff7bfeff858 pc=0x1029751 runtime.goenvs() /usr/local/go/src/runtime/os_darwin.go:129 +0x83 fp=0x7ff7bfeff8a8 sp=0x7ff7bfeff878 pc=0x10272d3 runtime.schedinit() /usr/local/go/src/runtime/proc.go:496 +0xa4 fp=0x7ff7bfeff900 sp=0x7ff7bfeff8a8 pc=0x102c014 runtime.rt0_go(0x7ff7bfeff930, 0x3, 0x7ff7bfeff930, 0x1000000, 0x3, 0x7ff7bfeffab0, 0x7ff7bfeffabf, 0x7ff7bfeffac3, 0x0, 0x7ff7bfeffacc, ...) /usr/local/go/src/runtime/asm_amd64.s:252 +0x1f4 fp=0x7ff7bfeff908 sp=0x7ff7bfeff900 pc=0x1052c64
I have seen reports starting to appear with similar issues as well
- https://stackoverflow.com/questions/69844856/how-to-fix-vs-code-fatal-error-runtime-bsdthread-register-error-on-macos-mon
- https://github.com/golang/go/issues/49138#issuecomment-960994361
- https://github.com/rancher/rancher/issues/35346
I noticed this error popped up a few years ago, I wonder if its just a case of waiting for everyone to recompile their code again, although surprised this has not been done yet?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 68
- Comments: 48 (16 by maintainers)
If anyone still have this issue, I installed the last official version of the deprecated project, they had a last release in Sep 02, 2019, with the Gitlab fork some machines with older hosts were not working. Install one liner:
a reminder of our no +1 policy please use the voting at the top if you have nothing to add
I’ve started getting the same error with git
2.30.1after upgrading to MacOS Monterey12.3.1. The following error only happened togit commitand no other git commands:Following the tips above about 1) this being caused by an old version of some go program and 2) git isn’t a go program itself therefore there must be some hook in place, I found an old hook in my
core.hookspathglobal git configuration and managed to fix this error removing it viagit config --global --unset core.hookspathAm still getting this error while trying to use git commit, can some one please help to see how I can resolve it git version: 2.35.0 go version: go1.17.6 darwin/amd64
Hi all, I am also facing the same issue
I have upgraded to macos monteray and I am just running simple git command so getting this below error
Can someone please help?
Update: turns out that the problem is solved if
aws-iam-authenticatorgets installed viahomebrew. Not exactly sure why, but my guess is they have an updated version in homebrew. So as for me, everything is working now. They must be using an older version ofgoor something. 🤷With regards to
docker-machinenot working. I found a fork repo from Gitlab that has kept the docker-machine project active, with builds using more up to date Go versions. This has fixed my issue.The link to the builds are here https://gitlab-docker-machine-downloads.s3.amazonaws.com/main/docker-machine-Darwin-x86_64
@justme-sports it’s totally not a fix, reformatting or deleting some stuff
Just updated with Software Updates to
macOS Monterey 12.2.1and each binary became broken. Tested with eithergo@1.17orgo@1.13usingbrew.I can confirm having this issue after upgrade to
macOS Monterey Version 12.2 (21D49)with https://github.com/shyiko/kubesec . It’s latest version of binary compiled for macOS back in 2019 was built withgo 1.9.1…@justme-sports you can copy GOROOT/bin/gofmt to /usr/local/bin/, where GOROOT is the top-level directory of your Go 1.17.6 installation.
@justme-sports git by itself is not a Go program. You probably have git commit hook installed, for example, gofmt, or some checker. You’ll need to find out what that is (such as by looking at .git/hooks) and rebuild that program with a newer version of Go.