Louisclmt

Louisclmt

Hello, I have the same problem with my mac M1

louisclement@MacBook-Air-de-Louis T-POO-700-LIL_3 % iex
zsh: segmentation fault  iex
0
Post #21
dimitarvp

dimitarvp

You guys should check if you (a) have Rosetta 2 and (b) are running the ARM version of Erlang/Elixir and not the Intel one.

1
Post #22
LostKobrakai

LostKobrakai

Also make sure the terminals don’t run using rosetta.

1
Post #23
kartheek

kartheek

This scenario is happening when someone migrates to a new ARM based MacBook from an Intel based one. I had encountered it - very difficult to even realise that this is happening as apple starts Rosetta emulation without any user preference (I remember that way - i might be wrong).

Its better to reset the home brew and start fresh when migrating to ARM based macbooks.

This post helped me diagnose when i was looking at asdf logs. I tried the usual wxwidgets, javac, etc without much help - i was not seeing any usual errors in the log. I was encountering segmentation fault and a search on google, github was returning 0 hits for this error. That’s when I realised that something else was wrong.

/bin/sh: line 1: 96426 Segmentation fault: 11  erlc -W -Werror +debug_info -DUSE_ESOCK=true -DENABLE_MEGACO_FLEX_SCANNER=true -DMEGACO_REENTRANT_FLEX_SCANNER=true -Dmegaco_parser_inline -pa /Users/home/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/et/ebin -pa /Users/home/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/megaco/ebin +'{parse_transform,sys_pre_attributes}' +'{attribute,insert,app_vsn,"megaco-4.0"}' -I../../include -o../../ebin megaco_flex_scanner_handler.erl
make[5]: *** [../../ebin/megaco_flex_scanner_handler.beam] Error 139
make[5]: *** Waiting for unfinished jobs....
/bin/sh: line 1: 96425 Segmentation fault: 11  erlc -W -Werror +debug_info -DUSE_ESOCK=true -DENABLE_MEGACO_FLEX_SCANNER=true -DMEGACO_REENTRANT_FLEX_SCANNER=true -Dmegaco_parser_inline -pa /Users/home/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/et/ebin -pa /Users/home/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/megaco/ebin +'{parse_transform,sys_pre_attributes}' +'{attribute,insert,app_vsn,"megaco-4.0"}' -I../../include -o../../ebin megaco_flex_scanner.erl

Finally I have uninstalled homebrew and installed it again. That fixed it. Resetting homebrew removed my default login shell - bash from homebrew. Another bump in the road - iTerm and terminal were erroring out. Had to switch to zsh and install homebrew and switch back to bash.

Post marked as solution does work (also one has to consider and plan things when removing homebrew):

1
Post #24
paulstatezny

paulstatezny

To anyone reading this thread and wondering, “how can I know for sure if my terminal is running in Rosetta mode?” Here’s an article that helped me.

Doesn’t seem quick and easy to find on Google, so thought I’d share.

3
Post #25
enkr1

enkr1

Hi community,

I recently did a software update and after updating, I can’t no longer run my Elixir Phoenix project …

Screenshot 2023-06-15 at 17.54.53
Screenshot 2023-06-15 at 17.54.53784×1190 34.3 KB

18:56:$ iex
Segmentation fault: 11
18:56:$ elixir -v
Segmentation fault: 11
18:56:$ elixir
Usage: elixir [options] [.exs file] [data]

## General options

  -e "COMMAND"                 Evaluates the given command (*)
  -h, --help                   Prints this message (standalone)
  -r "FILE"                    Requires the given files/patterns (*)
  -S SCRIPT                    Finds and executes the given script in $PATH
  -pr "FILE"                   Requires the given files/patterns in parallel (*)
  -pa "PATH"                   Prepends the given path to Erlang code path (*)
  -pz "PATH"                   Appends the given path to Erlang code path (*)
  -v, --version                Prints Erlang/OTP and Elixir versions (standalone)
 # ...

Notice that i get Segmentation fault: 11 for almost everything except elixir.

Some infos:

  • I have tried to reinstall the whole brew
  • this is where my elixir is
18:58:$ which elixir
/opt/homebrew/bin/elixir

Thank you in advanced!!

Best wishes,
Jing Hui P.

0
Post #26
benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @enkr1 I would consider uninstalling and recompiling your Elixir and Erlang.

0
Post #27
enkr1

enkr1

Hi @benwilson512,

I have tried multiple times and even deleted my brew and reinstall it. but still exists …

0
Post #28
enkr1

enkr1

Update: Seems like it only happens to me … my coworker just did a software update and nothing happens…

I have been trying to reinstall everything (unsymlinked, delete folders, etc.) but no luck …

Please help. :frowning:

0
Post #29
dimitarvp

dimitarvp

Native ARM vs. Rosetta, maybe? Seems to regularly catch people off-guard.

0
Post #30