Bus error after upgrading to Sonoma beta

Hey there!

I’m testing MacOS Sonoma 14.0 Beta (currently in a M1 MBPro) as I wanted to get hands on it for some future projects…
After the upgrade, I’ve discovered I cannot use iex, mix or any erlang related command anymore :scream:
I’ve tried with my current installation (asdf) and also installing elixir with brew. Any of them works unfortunately…

The error I get is the following:

mix compile
[1]    69035 bus error  mix compile

But I can still run python, ruby and the rest of my usual tools.

Has anyone run into the same problem?
Or do you know a way how could I debug better the error maybe?

Thanks a lot community!

5 Likes

Shenanigans of ARM vs. Intel processor instructions, maybe? :thinking: You got Rosetta installed? If so, have you made sure you’re running the ARM version of Erlang/Elixir?

thanks for answering!!
I don’t have Rosetta nope :confused: (or at least I wasn’t aware of it)
I was lucky enough that when I got the laptop this was already solved :+1:

Edit: running pgrep oahd returns me an int, so looks like I have it… the problem is that I haven’t changed anything about the versions installed (aside from MacOS) recently, so that’s why I was wondering if the update was the problem…

I am experiencing exactly the same problem…
Any updates on a potential fix?

Thanks!

1 Like

Not yet… Looks like not many people is upgrading so we don’t have much visibility…
I hope someone gives us some light on this soon :crossed_fingers:

1 Like

We don’t test under Rosetta (we only test native Intel JIT or native ARM JIT), so it’s possible that we missed something.

If someone could build from source and run bin/cerl -lldb and give us a view of the crash, that would be of great help.

Hey @jhogberg ! Thanks for trying to help us :+1:
I’ve just installed Erlang from source and it works correctly and without any errors (even in the smoke test).
Looks like this error could be coming then from ASDF and brew binaries maybe?
I will try now installing Elixir from source too!

Edit: Same for Elixir! Installing from source makes it work as expected.
@Raf1 you could do the same as a workaround for now :+1:

2 Likes

Let me know if I can do something to give you insights about non-source installations :pray:

Pasting here the smoke test results

asdf also builds Erlang from sources.

If you could attach lldb to the binaries that crash that’d also be helpful.

Yes, so it’s rather strange that one works and the other does not. Perhaps asdf runs under Rosetta for some reason?

How could I do that?
When I run bin/cerl -lldb as you said before, I don’t get any error, just the following:

$ bin/cerl -lldb

(lldb) target create "beam.smp"
Current executable set to 'beam.smp' (arm64).
(lldb) settings set -- target.run-args  "--" "-root" "/Users/xavierrodriguez/Downloads/otp_src_26.0" "-bindir" "/Users/xavierrodriguez/Downloads/otp_src_26.0/bin/aarch64-apple-darwin23.0.0" "-progname" "/Users/xavierrodriguez/Downloads/otp_src_26.0/bin/cerl" "--" "-home" "/Users/xavierrodriguez" "--"
(lldb) command source -s 0 '/tmp/.cerllldb.44427'
Executing commands in '/tmp/.cerllldb.44427'.
(lldb) env TERM=dumb
(lldb) command script import /Users/xavierrodriguez/Downloads/otp_src_26.0/erts/etc/unix/etp.py

If that’s the one installed with asdf, running process launch should start it and hopefully make it crash. At the crash, run x/5i $pc - 8 and info registers and paste the results here.

If that’s the one you built from source, it most likely won’t crash and you’ll need to wrangle lldb manually to start the asdf one. Start lldb and run the same commands as in the listing you pasted, albeit with the paths changed to the installation provided by asdf.

You won’t believe me now :slight_smile:
I’ve removed the source installations from Erlang & Elixir (from /usr/local/lib) in order to install ASDF’s plugins again.
Now, after reinstalling everything works and the bus error is not there anymore…
Also when running which elixir or which erl, it returns ASDF’s directory, so I’m not running “source” installations anymore.
What have I done?

I don’t know what to say other than that it’s weird. :laughing:

I’d appreciate it if someone could reproduce this, it’s good to know the cause even if it the problem turns out solely to be a problem with asdf, brew, or similar. :slight_smile:

1 Like

I was able to fix it, thanks! :grinning:
After uninstalling elixir and erlang with brew, asdf did the trick.

1 Like

Which version of Erlang were you able to get installed.

OTP 26 seems to work, but OTP 25 won’t compile for me. ASDF or from source.

It fails on “megaco_flex_scanner.erl”

1 Like

OTP 26 indeed, all other versions didn’t work for me as well.
The builds of prior versions failed when calling erlc program, which was installed using homebrew and causing a bus error.

The megaco_flex_scanner seems to be relying on the flex tool, maybe try to build flex from a release archive? Link install flex

1 Like

I had the same issue when upgrading to Sonoma. I use asdf to manage my versions. I’m using Elixir 1.14.4 and Erlang 26.0. Both worked fine before the upgrade, but something about the OS update (and dev tools update) broke my local installs.

For me I just had to uninstall/reinstall Elixir and Erlang to fix it.

1 Like

Hi, I compile Elixir using Brew, and here are the results:

MacBook-Pro-M1 Downloads % brew install --build-from-source elixir

Warning: You are using macOS 14.

We do not provide support for this pre-release version.

It is expected behaviour that some formulae will fail to build in this pre-release version.

It is expected behaviour that Homebrew will be buggy and slow.

Do not create any issues about this on Homebrew's GitHub repositories.

Do not create any issues even if you think this message is unrelated.

Any opened issues will be immediately closed without response.

Do not ask for help from Homebrew or its maintainers on social media.

You may ask for help in Homebrew's discussions but are unlikely to receive a response.

Try to figure out the problem yourself and submit a fix as a pull request.

We will review it but may or may not accept it.

==> **Fetching** **elixir**

==> **Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/e788b647a16c227cc25ccf3fd083bddbfb511f9f/Formula/elixir.rb**

Already downloaded: /Users/abc/Library/Caches/Homebrew/downloads/6e466b379d88889da61c353c2247fbf6a8540ed87043e93e1a042247fa9b3f1b--elixir.rb

==> **Downloading https://github.com/elixir-lang/elixir/archive/v1.14.5.tar.gz**

Already downloaded: /Users/abc/Library/Caches/Homebrew/downloads/064195155f862f3de2f7dc5fc802400e2b1627c832947247945f2e7a1b130e36--elixir-1.14.5.tar.gz

==> **make**

Last 15 lines from /Users/abc/Library/Logs/Homebrew/elixir/01.make:

2023-06-16 16:11:17 +0000

make

make: *** [lib/elixir/src/elixir_parser.erl] Bus error: 10

Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

Error: You are using macOS 14.

We do not provide support for this pre-release version.

It is expected behaviour that some formulae will fail to build in this pre-release version.

It is expected behaviour that Homebrew will be buggy and slow.

Do not create any issues about this on Homebrew's GitHub repositories.

Do not create any issues even if you think this message is unrelated.

Any opened issues will be immediately closed without response.

Do not ask for help from Homebrew or its maintainers on social media.

You may ask for help in Homebrew's discussions but are unlikely to receive a response.

Try to figure out the problem yourself and submit a fix as a pull request.

We will review it but may or may not accept it.

Tried it. Flex is probably a red herring. I suspect the error is coming from erlc for me as well.

It’s probably not worth the effort to figure out assuming ElixirLS support for OTP26 is coming soon.