expert icon indicating copy to clipboard operation
expert copied to clipboard

Engine Compilation Causing Crash Dump

Open heywhy opened this issue 4 months ago • 0 comments

First of all, thank you for the great work of building a unified language server for Elixir; hopefully, this fosters ease of adoption for newcomers.


I am running Mac M1 and using asdf to set up Erlang and Elixir.

> asdf current
Name            Version
elixir          1.18.4-otp-28
erlang          28.0.2
  • I'm using the nightly build of the Expert LS, downloaded using gh.
  • Set up the LSP in Neovim 0.11

When I open an Elixir project, the .expert folder is created alongside the expert.log file, while the client (neovim) receives the $/client event, but it gets stuck at the Project Node event, and no other folder (build & indexes) is created in the .expert folder. After digging around, I found an erl_crash.dump file in the ~/Library/Application Support/.burrito/expert_erts-15.2.7_0.1.0-57abaff/lib/xp_expert-0.1.0-57abaff/priv/engine_source/apps/engine directory.

Going through the erl_crash.dump file and the Expert codebase, I got to discover that the LSP is using the ~/.asdf/installs/elixir/1.18.4-otp-28/bin/elixir executable, but because my global erlang version (using a .tool-versions in home directory) is 27.2, the engine build step crashes. The only way I was able to fix this was by setting my global Erlang version to 28.0, and everything then works fine.

The proposed solution I have in mind is that when building the engine, a .tool-versions file should be generated, setting the Erlang version to match that which the Elixir executable is built for. Basically, the Expert.Port module exposes an erlang_executable method, and we can use the returned executable to grab the Erlang version to use.

heywhy avatar Aug 30 '25 01:08 heywhy