knqyf263 / pet

Simple command-line snippet manager
MIT License
4.44k stars 223 forks source link

`pet search` broken on macOS 12 Monterey with all the available binaries #199

Closed varenc closed 2 years ago

varenc commented 2 years ago

I get this error when I run pet search. This is an issue with many go binaries on macOS 12.

fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x11cc477, 0x21)
    /usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:596 +0x95 fp=0x7ff7bfefee90 sp=0x7ff7bfefee70
runtime.goenvs()
    /usr/local/Cellar/go/1.8/libexec/src/runtime/os_darwin.go:108 +0xa0 fp=0x7ff7bfefeec0 sp=0x7ff7bfefee90
runtime.schedinit()
    /usr/local/Cellar/go/1.8/libexec/src/runtime/proc.go:486 +0xa1 fp=0x7ff7bfefef00 sp=0x7ff7bfefeec0
runtime.rt0_go(0x7ff7bfefef38, 0x1, 0x7ff7bfefef38, 0x0, 0x1000000, 0x1, 0x7ff7bfeff1f8, 0x0, 0x7ff7bfeff1fd, 0x7ff7bfeff214, ...)
    /usr/local/Cellar/go/1.8/libexec/src/runtime/asm_amd64.s:158 +0x183 fp=0x7ff7bfefef08 sp=0x7ff7bfefef00

It seems like all go binaries compiled before a certain version are seeing this on macOS 12. There's a dedicate page for this on the Go wiki: https://github.com/golang/go/wiki/MacOS12BSDThreadRegisterIssue

The github release and homebrew binaries have this problem. The fix seems to be re-compiling pet with the latest version of go.

Edit: I just tried compiling pet myself with go1.18 and the resulting pet binary still fails the same way for pet search. So not sure what's going on. Also I'm not sure where the /usr/local/Cellar/go/1.8/ path is coming from since that doesn't exist on my system. I'm likely just compiling it wrong, or possibly there's something else off about my environment that's causing this error.

varenc commented 2 years ago

nvm... this is caused by the peco binary having this issue, which pet just calls out to. Doh!