Erlang > 19 stopped working on mac

Hi,
I used to use erlang/elixir installed by homebrew and kiex on my mac. But couple of days ago it stoped working. I tried uninstall everything and install it again. It didn’t help. Right now I tried asdf and same issue. Erlang 19 is working but everything newer not. It start, show something in console but that’s it, it’s only start consuming memory and cpu, it takes about 12-20 GB of memory and 120 % cpu. Any ideax what can be wrong please?

asdf install erlang 20.3.8.9
Downloading OTP-20.3.8.9.tar.gz to /Users/quatermain/.asdf/plugins/erlang/kerl-home/archives
######################################################################## 100.0%
Extracting source code
Building Erlang/OTP 20.3.8.9 (asdf_20.3.8.9), please wait...
DOCUMENTATION INFORMATION (See: /Users/quatermain/.asdf/plugins/erlang/kerl-home/builds/asdf_20.3.8.9/otp_build_20.3.8.9.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Erlang/OTP 20.3.8.9 (asdf_20.3.8.9) has been successfully built
Installing Erlang/OTP 20.3.8.9 (asdf_20.3.8.9) in /Users/quatermain/.asdf/installs/erlang/20.3.8.9...
You can activate this installation running the following command:
. /Users/quatermain/.asdf/installs/erlang/20.3.8.9/activate
Later on, you can leave the installation typing:
kerl_deactivate
Cleaning up compilation products for 
Cleaned up compilation products for  under /Users/quatermain/.asdf/plugins/erlang/kerl-home/builds

Erlang 20.3.8.9 has been installed. Activate globally with:

    asdf global erlang 20.3.8.9

Activate locally in the current folder with:

    asdf local erlang 20.3.8.9

➜  ~ asdf global erlang 20.3.8.9
➜  ~ erl -v
Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

[1]    10253 killed     erl -v
                              %   

As a start, make sure to run this in your console, just in case:

xcode-select --install

And then retry installing Erlang through asdf.

Thanks, I already did so:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

and I opened XCode just to be sure everything is ok, because sometimes it finish installation after you open it.

Then I’m not really sure. Have you tried 21? And 22.0.1 in particular?

Yes, only 19.x works and elixir 1.8 need > 20

I created new user and I installed erlang and elixir with asdf and it works. So I have to have something wrong with my user’s “namespace”. Maybe zsh has some wrong setup.

I removed this line from .zshrc file and it works
export ERL_AFLAGS="-kernel shell_history enabled"

2 Likes

Hmm, I wonder why, I still have those in my shell environment…

1 Like

In the elixir-lang slack I already suggested that the history file might be broken, @quatermain didn’t report back their though.

1 Like

Hmm, do you have a link to a BEAM bug report about this?

No, I wanted to check first with @quatermain if moving the history file away would help before filing/searching a bug report.

1 Like

Hi guys, sorry for delay. I’m pretty sure it’s problem with history, but I can not find where is that history file. Can you navigate me please?
When I turn off that flag it works, when I turn on, erlang doesn’t work. Even without recompiling. So it has to be problem with that history “file”

Default place seems to be ~/.cache/erlang-history.

If you backup and delete that folder, does it work with that flags enabled?

Keeping the faulty history might be beneficial for a potential bug report.

but problem is that I don’t have that file :upside_down_face:
I tried this:
sudo find / -type f -name "erlang-history"
and not results.

It is a directory, and I was very explicit with the path…

~/.cache/erlang-history should be available. ls -ld ~/.cache/erlang-history.

Well, unless erlang does use the XDG environment vars to alter the location and it is put somewhere else for that reason, but then you should still be able to find it using -type d for find.

Found it.
~/Library/Caches/erlang-history/

I moved all files inside, allowed history and it works. So problem is with these files.

So you have not backed them up for introspection?

yes, I have it. is it save to upload here or? not sure what is inside

I’m not sure as well. But they will probably contain major parts of your erlang and elixir shell history and if you are in doubt even might contain passwords you used as function arguments.

@bjorng, @rvirding do you know more, or if there is already something known that malformed/corrupted histories can cause the erl to allocate a lot of memory while consuming a lot of CPU?

1 Like
 la ~/Library/Caches/erlang-history-old
total 1016
-rw-r--r--@ 1 quatermain  staff   6.0K Jun  5 11:27 .DS_Store
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.1
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.10
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.2
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.3
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.4
-rw-r--r--  1 quatermain  staff    51K May 28 11:27 erlang-shell-log.5
-rw-r--r--  1 quatermain  staff    24K Jun  5 11:24 erlang-shell-log.6
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.7
-rw-r--r--  1 quatermain  staff    50K May 28 11:25 erlang-shell-log.8
-rw-r--r--  1 quatermain  staff    51K May 28 11:25 erlang-shell-log.9
-rw-r--r--  1 quatermain  staff    90B Jun  5 11:24 erlang-shell-log.idx
-rw-r--r--  1 quatermain  staff    13B Jun  5 11:24 erlang-shell-log.siz

maybe this help somehow