Segmentation fault after update elixir and erlang

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 Like