zsh: segmentation fault | using AHOY

Machine - MacBook Pro 13 with Apple M1 chip

Hi team,
Just wanted to get some help in sorting Ahoy installation on new MacBook Pro 13 with Apple M1 chip.
I ran "brew install ahoy" but got a message saying "bottle not available"
I have been able to build it from source and as per log below, it seems to have installed.

But when I run any commands, I am getting a "zsh: segmentation fault ahoy help" error and unable to run any ahoy commands.


NOTE: MacBook CONSOLE LOG added below.

CONSOLE ERROR LOG -
  • ++++++++++++++++++++++++++++++++++++++++

Process: ahoy [1840]
Path: /opt/homebrew/*/ahoy
Identifier: ahoy
Version: ???
Code Type: X86-64 (Translated)
Parent Process: zsh [1748]
Responsible: Terminal [1746]
User ID: 501

Date/Time: 2021-02-15 12:23:20.982 +1100
OS Version: macOS 11.2.1 (20D74)
Report Version: 12
Anonymous UUID: D7AF3B6F-CFAB-F9ED-0E45-DC1AD1784827

Sleep/Wake UUID: 1689D6DE-2DD8-496C-AAC6-A6BE6699BBE9

Time Awake Since Boot: 6300 seconds
Time Since Wake: 1500 seconds

System Integrity Protection: enabled

Crashed Thread: 0

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1840]

VM Regions Near 0x18:
  • ->

__TEXT 1000000-125f000 [ 2428K] r-x/rwx SM=COW

Application Specific Information:
dyld2 mode

Thread 0 Crashed:
0 runtime 0x00007ffdfff70bb0 0x7ffdfff5f000 + 72624
1 0x00000000010518fd runtime.bsdthread_register + 29
2 0x00000000010295d1 runtime.schedinit + 161

Thread 1:: com.apple.rosetta.exceptionserver
0 runtime 0x00007ffdfff61238 0x7ffdfff5f000 + 8760
1 runtime 0x00007ffdfff6b354 0x7ffdfff5f000 + 50004
2 runtime 0x00007ffdfff6c1f8 0x7ffdfff5f000 + 53752

Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x800000010000fb90 x1: 0x00000000010518a0 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x000000c42000a020
x8: 0x00007ffdfffd4a00 x9: 0x00007ffdfffd4a08 x10: 0x0000000000000000 x11: 0x00000000ffffffff
x12: 0x0000000000000000 x13: 0x00000000ffffffee x14: 0x0000000000000140 x15: 0x0000000000000100
x16: 0x000000000000016e x17: 0x0000000000000000 x18: 0x800000010000fb90 x19: 0x0000000100000000
x20: 0x00000000000007ff x21: 0x0000000100014fc0 x22: 0x00000002055eaac8 x23: 0x000000000150e224
x24: 0x00000000010243b0 x25: 0x00000000013022d0 x26: 0x00000000012f8cd8 x27: 0x0000000000000000
x28: 0x00000000010518fd fp: 0x00007ffdfff70b98 lr: 0x000000000150e254
sp: 0x000000010000fb90 pc: 0x00007ffdfff70bb0 cpsr: 0x80000000
far: 0x0000000000000018 esr: 0x92000006


Binary Images:
0x1000000 - 0x125efff + (???)
0x1014d3000 - 0x10156efff dyld (832.7.3) <0D4EA85F-7E30-338B-9215-314A5A5539B6> /usr/lib/dyld
0x7ffdfff5f000 - 0x7ffdfffd2fff +runtime (203.30) <C98E75A6-BDC8-3D5C-B95B-6422005E96D8> /Library/Apple/*/runtime

External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 4298
thread_create: 0
thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=3972K resident=0K(0%) swapped_out_or_unallocated=3972K(100%)
Writable regions: Total=150.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=150.7M(100%)
Code Block
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Rosetta Arena 2048K 1
Rosetta Generic 584K 143
Rosetta IndirectBranch 32K 1
Rosetta JIT 128.0M 1
Rosetta Return Stack 20K 2
Rosetta Thread Context 20K 2
VM_ALLOCATE 528.5G 9
VM_ALLOCATE (reserved) 8K 2 reserved VM address space (unallocated)
__DATA 488K 6
__DATA_CONST 32K 1
__LINKEDIT 492K 5
__TEXT 3516K 3
mapped file 4.7G 12
=========== ======= =======
TOTAL 533.3G 188
TOTAL, minus reserved VM space 533.3G 188

Tried to answer in a comment and that was not ideal. See my answer.

I recently migrated to an M1 MacBook Pro and was seeing [1] 23255 segmentation fault ahoy [command] when running an ahoy command.

I was able to get things working again with the following:

  • First, I installed Xcode. This likely had no effect, but mentioning it just in case.
  • This is my Terminal log for fixing after trying to install with Homebrew again.
➜ ~ brew install ahoy
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
swiftplantuml
==> Updated Formulae
Updated 56 formulae.
==> Updated Casks
Updated 10 casks.

Warning: ahoy 2.0.0 is already installed, it's just not linked.
To link this version, run:
 brew link ahoy
➜ ~ brew link ahoy
Linking /usr/local/Cellar/ahoy/2.0.0... 
Error: Could not symlink bin/ahoy
Target /usr/local/bin/ahoy
already exists. You may want to remove it:
 rm '/usr/local/bin/ahoy'

To force the link and overwrite all conflicting files:
 brew link --overwrite ahoy

To list all files that would be deleted:
 brew link --overwrite --dry-run ahoy
➜ ~ rm '/usr/local/bin/ahoy'
➜ ~ brew link ahoy      
Linking /usr/local/Cellar/ahoy/2.0.0... 1 symlinks created.

Hope this helps.

zsh: segmentation fault | using AHOY
 
 
Q