Skip to content

Update to go-m1cpu 0.2.1 to avoid M5 segfault - #1055

Open
netshade wants to merge 1 commit into
cirruslabs:mainfrom
netshade:update-go-m1cpu
Open

Update to go-m1cpu 0.2.1 to avoid M5 segfault#1055
netshade wants to merge 1 commit into
cirruslabs:mainfrom
netshade:update-go-m1cpu

Conversation

@netshade

Copy link
Copy Markdown

When running cirrus on an M5 CPU, the program segfaults immediately:

SIGSEGV: segmentation violation
PC=0x18db1b1a8 m=0 sigcode=2 addr=0x0
signal arrived during cgo execution

goroutine 1 gp=0x140000021c0 m=0 mp=0x106f57020 [syscall, locked to thread]:
runtime.cgocall(0x105b6e960, 0x140000a6e08)
        /opt/homebrew/Cellar/go/1.25.5/libexec/src/runtime/cgocall.go:167 +0x44 fp=0x140000a6dd0 sp=0x140000a6d90 pc=0x104da39d4
github.com/shoenig/go-m1cpu._Cfunc_initialize()
        _cgo_gotypes.go:150 +0x2c fp=0x140000a6e00 sp=0x140000a6dd0 pc=0x105472a7c
github.com/shoenig/go-m1cpu.init.0()
        /Users/admin/go/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:148 +0x1c fp=0x140000a6e10 sp=0x140000a6e00 pc=0x105472abc
runtime.doInit1(0x106e82040)
        /opt/homebrew/Cellar/go/1.25.5/libexec/src/runtime/proc.go:7670 +0xc4 fp=0x140000a6f40 sp=0x140000a6e10 pc=0x104d834f4
runtime.doInit(...)
        /opt/homebrew/Cellar/go/1.25.5/libexec/src/runtime/proc.go:7637
runtime.main()
        /opt/homebrew/Cellar/go/1.25.5/libexec/src/runtime/proc.go:256 +0x338 fp=0x140000a6fd0 sp=0x140000a6f40 pc=0x104d73668
runtime.goexit({})
        /opt/homebrew/Cellar/go/1.25.5/libexec/src/runtime/asm_arm64.s:1268 +0x4 fp=0x140000a6fd0 sp=0x140000a6fd0 pc=0x104daf024

It appears that this is caused by a bug in go-m1cpu that has been fixed in 0.2.1. This PR updates the dependency to prevent the segfault and allow running the binary.

Tested and confirmed on an M5 CPU.

@netshade
netshade requested a review from fkorotkov as a code owner April 21, 2026 20:56
@iamszabo

iamszabo commented Apr 29, 2026

Copy link
Copy Markdown

I'm also experiencing the same issue on M5 Pro while trying to install it with homebrew.

@iamszabo

Copy link
Copy Markdown

@fkorotkov Would it be possible to merge this PR? Without this PR it's not possible to run cirrus on new MacBooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants