Skip to content

fix: update go-m1cpu to fix SIGSEGV on Apple M5 - #1368

Closed
chrispassas wants to merge 10 commits into
projectdiscovery:devfrom
chrispassas:fix/go-m1cpu-m5-sigsegv
Closed

fix: update go-m1cpu to fix SIGSEGV on Apple M5#1368
chrispassas wants to merge 10 commits into
projectdiscovery:devfrom
chrispassas:fix/go-m1cpu-m5-sigsegv

Conversation

@chrispassas

@chrispassas chrispassas commented Apr 29, 2026

Copy link
Copy Markdown

go-m1cpu v0.1.6 crashes via cgo on M5 Macs during package init(). Updating to latest resolves the segfault.

When trying to compile and run interactsh-server or interactsh-client I get a stack trace. I'm using an Apple M5 Max Macbook Pro.

After doing the following the crash is fixed

go get github.com/shoenig/go-m1cpu@latest
go mod tidy

Example

interactsh-server -domain [localhost](http://localhost) -sa
SIGSEGV: segmentation violation
PC=0x188e0b1a8 m=0 sigcode=2 addr=0x0
signal arrived during cgo execution
goroutine 1 gp=0x1c649271c1e0 m=0 mp=0x10219ce60 [syscall, locked to thread]:
runtime.cgocall(0x10104b800, 0x1c64927d0e08)
        /usr/local/go/src/runtime/cgocall.go:167 +0x44 fp=0x1c64927d0dd0 sp=0x1c64927d0d90 pc=0x1005dd754
github.com/shoenig/go-m1cpu._Cfunc_initialize()
        _cgo_gotypes.go:138 +0x2c fp=0x1c64927d0e00 sp=0x1c64927d0dd0 pc=0x100e995ec
github.com/shoenig/go-m1cpu.init.0()
        /Users/chrispassas/go/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:148 +0x1c fp=0x1c64927d0e10 sp=0x1c64927d0e00 pc=0x100e9962c
runtime.doInit1(0x101fb0e80)
        /usr/local/go/src/runtime/proc.go:8103 +0xc4 fp=0x1c64927d0f30 sp=0x1c64927d0e10 pc=0x1005bb184
runtime.doInit(...)
        /usr/local/go/src/runtime/proc.go:8070
runtime.main()
        /usr/local/go/src/runtime/proc.go:258 +0x244 fp=0x1c64927d0fd0 sp=0x1c64927d0f30 pc=0x1005ab1c4
runtime.goexit({})
        /usr/local/go/src/runtime/asm_arm64.s:1447 +0x4 fp=0x1c64927d0fd0 sp=0x1c64927d0fd0 pc=0x1005e89f4
goroutine 2 gp=0x1c649271cd20 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:462 +0xbc fp=0x1c64927c2f90 sp=0x1c64927c2f70 pc=0x1005e0e6c
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:468
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:375 +0xb4 fp=0x1c64927c2fd0 sp=0x1c64927c2f90 pc=0x1005ab554
runtime.goexit({})
        /usr/local/go/src/runtime/asm_arm64.s:1447 +0x4 fp=0x1c64927c2fd0 sp=0x1c64927c2fd0 pc=0x1005e89f4
created by runtime.init.7 in goroutine 1
        /usr/local/go/src/runtime/proc.go:363 +0x24
goroutine 18 gp=0x1c64928043c0 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:462 +0xbc fp=0x1c64927be770 sp=0x1c64927be750 pc=0x1005e0e6c
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:468
runtime.bgsweep(0x1c6492812000)
        /usr/local/go/src/runtime/mgcsweep.go:279 +0x9c fp=0x1c64927be7b0 sp=0x1c64927be770 pc=0x100593ddc
runtime.gcenable.gowrap1()
        /usr/local/go/src/runtime/mgc.go:214 +0x20 fp=0x1c64927be7d0 sp=0x1c64927be7b0 pc=0x100585300
runtime.goexit({})
        /usr/local/go/src/runtime/asm_arm64.s:1447 +0x4 fp=0x1c64927be7d0 sp=0x1c64927be7d0 pc=0x1005e89f4
created by runtime.gcenable in goroutine 1
        /usr/local/go/src/runtime/mgc.go:214 +0x6c
goroutine 19 gp=0x1c64928045a0 m=nil [GC scavenge wait]:
runtime.gopark(0x1c6492812000?, 0x101316f50?, 0x1?, 0x0?, 0x1c64928045a0?)
        /usr/local/go/src/runtime/proc.go:462 +0xbc fp=0x1c64927bef60 sp=0x1c64927bef40 pc=0x1005e0e6c
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:468
runtime.(*scavengerState).park(0x10219ac40)
        /usr/local/go/src/runtime/mgcscavenge.go:425 +0x5c fp=0x1c64927bef90 sp=0x1c64927bef60 pc=0x1005919cc
runtime.bgscavenge(0x1c6492812000)
        /usr/local/go/src/runtime/mgcscavenge.go:653 +0x44 fp=0x1c64927befb0 sp=0x1c64927bef90 pc=0x100591f04
runtime.gcenable.gowrap2()
        /usr/local/go/src/runtime/mgc.go:215 +0x20 fp=0x1c64927befd0 sp=0x1c64927befb0 pc=0x1005852c0
runtime.goexit({})
        /usr/local/go/src/runtime/asm_arm64.s:1447 +0x4 fp=0x1c64927befd0 sp=0x1c64927befd0 pc=0x1005e89f4
created by runtime.gcenable in goroutine 1
        /usr/local/go/src/runtime/mgc.go:215 +0xac
r0      0x14
r1      0x0
r2      0x0
r3      0x16f8a2560
r4      0xffffffff9542bf30
r5      0x20
r6      0x48
r7      0x0
r8      0xea9ac2ad1c210013
r9      0xea9ac2ad1c210013
r10     0x7ffffffffffff8
r11     0x0
r12     0x100000003
r13     0xa6e
r14     0x52
r15     0x11
r16     0x188cd5ef8
r17     0x1f60bcca8
r18     0x0
r19     0x0
r20     0x465000
r21     0x104cce400
r22     0x1021cad14
r23     0x1f4a871a0
r24     0x0
r25     0x3d
r26     0x101fb0e88
r27     0x810
r28     0x10219b5e0
r29     0x16f8a2590
lr      0x188cd5f1c
sp      0x16f8a2580
pc      0x188e0b1a8
fault   0x0

Summary by CodeRabbit

  • Chores
    • Updated a project dependency to a newer version for improved compatibility and stability.

orr-a-security and others added 10 commits November 10, 2025 15:25
…ion-strategy

feat(server) added eviction strategy
…-1275-feature/eviction-strategy

Revert "feat(server) added eviction strategy"
Bumps [github.com/refraction-networking/utls](https://github.com/refraction-networking/utls) from 1.8.0 to 1.8.2.
- [Release notes](https://github.com/refraction-networking/utls/releases)
- [Commits](refraction-networking/utls@v1.8.0...v1.8.2)

---
updated-dependencies:
- dependency-name: github.com/refraction-networking/utls
  dependency-version: 1.8.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…abot/go_modules/github.com/refraction-networking/utls-1.8.2

chore(deps): bump github.com/refraction-networking/utls from 1.8.0 to 1.8.2
go-m1cpu v0.1.6 crashes via cgo on M5 Macs during package init().
Updating to latest resolves the segfault.
@neo-by-projectdiscovery-dev

neo-by-projectdiscovery-dev Bot commented Apr 29, 2026

Copy link
Copy Markdown

Neo - PR Security Review

Caution

Neo couldn't finish analyzing this pull request during this run. Please run the review again.

Comment @pdneo help for available commands. · Open in Neo

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a87ca5ae-b1ab-443b-aa52-01f3c41b0db5

📥 Commits

Reviewing files that changed from the base of the PR and between 810180a and 0b2369c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod

Walkthrough

The go.mod file is updated to bump the indirect dependency github.com/shoenig/go-m1cpu from version v0.1.6 to v0.2.1, updating the resolved version for builds.

Changes

Cohort / File(s) Summary
Dependency Version Update
go.mod
Bumped indirect dependency github.com/shoenig/go-m1cpu from v0.1.6 to v0.2.1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A single line hopped into place,
Dependencies updated with grace,
From point-one-six to point-two-one,
The version bump dance is done! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating go-m1cpu dependency to fix a segmentation fault (SIGSEGV) on Apple M5 systems, which is exactly what the changeset accomplishes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mzack9999
Mzack9999 changed the base branch from main to dev May 7, 2026 21:10
@Mzack9999

Copy link
Copy Markdown
Member

Thanks for the fix @chrispassas! 🙏

Closing this PR as the underlying issue has already been resolved on dev via a different route: we migrated from github.com/shirou/gopsutil/v3 to gopsutil/v4 (v4.26.3), which no longer depends on github.com/shoenig/go-m1cpu at all. Since the SIGSEGV originated in go-m1cpu's cgo init() on Apple M5, dropping the dependency entirely makes the crash impossible to recur, so no go-m1cpu bump is needed on top.

Thanks again for tracking down the root cause. It helped confirm the v4 migration was the right call.

@Mzack9999 Mzack9999 closed this May 7, 2026
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.

4 participants