fix: bump gopsutil v3 → v4 to drop go-m1cpu cgo init crash on macOS 26#56
Open
mmoscosa wants to merge 1 commit into
Open
fix: bump gopsutil v3 → v4 to drop go-m1cpu cgo init crash on macOS 26#56mmoscosa wants to merge 1 commit into
mmoscosa wants to merge 1 commit into
Conversation
gopsutil/v3 pulls github.com/shoenig/go-m1cpu (indirect), which reads
P/E-core frequencies from IOKit in a cgo init(). On macOS 26 (Tahoe,
Apple Silicon) that cgo init segfaults, so every demux invocation —
including `demux --version` and `--help` — dies with SIGSEGV before
main(). No CLI flag can avoid a package-init crash.
gopsutil/v4 replaced the go-m1cpu cgo path with sysctl, so the
dependency is gone entirely. demux only imports gopsutil/v3/process in
two files (internal/proc/{cwd,snapshot}.go); the v4 process API is
source-compatible, so the change is import-path + module bumps only.
Verified on macOS 26.5.1 / go 1.26.4 / Apple Silicon:
- builds with CGO_ENABLED=1 (the config that crashed) and runs cleanly
- go-m1cpu fully removed from the dependency graph
- `go vet ./...` clean, full `go test ./...` green
Fixes rtalexk#55.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS 26 (Tahoe), Apple Silicon, every demux invocation crashes with
SIGSEGVbeforemain()— includingdemux --versionanddemux --help:go.modpinsgopsutil/v3, which pullsgo-m1cpu(indirect). go-m1cpu reads P/E-core frequencies from IOKit in a cgoinit(), and that init segfaults on macOS 26. Because it runs at package-init time, it kills the process before any code executes — no CLI flag avoids it, andCGO_ENABLED=0is the only workaround (at the cost of losing gopsutil's libproc-backed process detection, so panes read as idle /procs: 0).Tracked in #55.
Fix
Bump
gopsutil/v3→gopsutil/v4. v4 dropped the go-m1cpu cgo dependency in favor of sysctl, removing the crash entirely. demux imports gopsutil in only two files (internal/proc/{cwd,snapshot}.go), using onlygopsutil/v3/process, and the v4processAPI is source-compatible — so this is import-path + module bumps only (4 files, +15/-18).Verification (macOS 26.5.1 / go 1.26.4 / Apple Silicon)
CGO_ENABLED=1(the config that crashed) and--versionruns cleanly — no segfault.go-m1cpuis fully removed from the dependency graph (go.sum).go vet ./...clean; fullgo test ./...green.With cgo back on, per-pane process detection works again — no more blanket idle /
procs: 0.Fixes #55.