asdf-erlang: Build Fails on macOS 10.15 Catalina

note: this is different from the SSL issues noted in #105

Took me a while to track it down but I think this might be an upstream issue to do with version identification that is already fixed in kerl and that could hopefully be solved by updating the kerl version used.

See the kerl PR here: https://github.com/kerl/kerl/pull/324

2 additional points…

  1. I was hoping there would be a way to set a custom kerl version using an env var so I could test the build before opening this issue but it looks like the version is hardcoded and validated here
  2. It looks like there is a new kerl release 1.8.6 see here But it doesn’t look like it’s been tagged in git as previous versions were so the https://raw.githubusercontent.com/kerl/kerl/1.8.6/kerl isn’t working like it does for 1.8.5.

In case it helps or I have identified the issue incorrectly…

config

KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl@1.1/1.1.1d"

asdf install erlang 21.3.8

Downloading OTP-21.3.8.tar.gz to /Users/andy/.asdf/plugins/erlang/kerl-home/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    451      0 --:--:-- --:--:-- --:--:--   451
100 51.5M    0 51.5M    0     0  8641k      0 --:--:--  0:00:06 --:--:-- 11.3M
Extracting source code
Building Erlang/OTP 21.3.8 (asdf_21.3.8), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * jinterface     : Java compiler disabled by user

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 MAKE	emulator
 MAKE	opt
 GEN	x86_64-apple-darwin19.0.0/gen_git_version.mk
 PROFILE beam.prof.smp
/bin/sh: line 1: 32416 Segmentation fault: 11  LLVM_PROFILE_FILE="obj/x86_64-apple-darwin19.0.0/opt/smp/erlc-%m.profraw" ERL_FLAGS="-emu_type prof +S 1" erlc -W -DPGO -o obj/x86_64-apple-darwin19.0.0/opt/smp test/estone_SUITE.erl > obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE_LOG
make[4]: *** [obj/x86_64-apple-darwin19.0.0/opt/smp/PROFILE] Error 139
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_21.3.8/otp_build_21.3.8.log for full details.

asdf install erlang 22.1.1

Downloading kerl...
Downloading OTP-22.1.1.tar.gz to /Users/andy/.asdf/plugins/erlang/kerl-home/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    437      0 --:--:-- --:--:-- --:--:--   437
100 52.4M    0 52.4M    0     0  8495k      0 --:--:--  0:00:06 --:--:-- 10.5M
Extracting source code
Building Erlang/OTP 22.1.1 (asdf_22.1.1), please wait...
APPLICATIONS DISABLED (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * jinterface     : Java compiler disabled by user

DOCUMENTATION INFORMATION (See: /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
make[3]: *** [../ebin/hipe_icode2rtl.beam] Error 139
/bin/sh: line 1: 99049 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_tagscheme.erl
make[3]: *** [../ebin/hipe_tagscheme.beam] Error 139
/bin/sh: line 1: 99070 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_cfg.erl
make[3]: *** [../ebin/hipe_rtl_cfg.beam] Error 139
/bin/sh: line 1: 99047 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true +inline +warn_unused_import +warn_export_vars -Werror -o../ebin hipe_rtl_arch.erl
make[3]: *** [../ebin/hipe_rtl_arch.beam] Error 139
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

Please see /Users/andy/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log for full details.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 20
  • Comments: 74 (13 by maintainers)

Most upvoted comments

Here is a workaround to get OTP to build on Catalina:

export MACOSX_DEPLOYMENT_TARGET=10.14

We will continue to investigate the problem.

I have pushed a pull request that fixes the crash:

https://github.com/erlang/otp/pull/2413

In my case, I had to install an old version of Erlang 20.2, what worked for me:

export CFLAGS="-O2 -g -fno-stack-check"
KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t" asdf install erlang 20.2

This worked for me (crossposted from kerl/kerl)

MacOS Catalina (10.15.1) There is an issue in the compilation phase of the process. The workaround is this:

export KERL_CONFIGURE_OPTIONS=“–without-javac --with-ssl=$(brew --prefix openssl)” export CFLAGS=“-O2 -g -fno-stack-check” asdf install erlang 22.1 asdf global erlang 22.1

@benoitc Whatever is printed to stdout to start with 😃

I wonder what the OS X people broke/changed this time…

In my case, I had to install an old version of Erlang 20.2, what worked for me:

export CFLAGS="-O2 -g -fno-stack-check"
KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t" asdf install erlang 20.2

worked for me, thank you

They said the fix won’t make it in until 22.1.4 @dc0d

Confirmed that I could build erlang 22.1.4 with asdf v0.7.4 / asdf-erlang 274e4154fed0674140efa6f4c4ad7a9be0b63291 on macOS 10.15 Catalina.

@drebits that was my solution as well. the key for me was the --disable hipe flag.

I’m having a similar issue, and though the explicit failure isn’t a segfault, it’s a memory issue of some sort and feels related. Feel free to tell me to open a separate issue if need be.

Building Erlang/OTP 20.1 (asdf_20.1), please wait...
Build failed.
make[3]: *** [../ebin/hipe_rtl_arch.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_mk_switch.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_primops.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_cfg.beam] Error 1
make[3]: *** [../ebin/hipe_tagscheme.beam] Error 1
erts_mmap: Failed to create super carrier of size 512 MB
make[3]: *** [../ebin/hipe_rtl_arith_32.beam] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

22.0.7 installs fine, with no extra config params needed. 20.1 chokes. I’ve tried the settings above, and it’s always a similar failure. What’s interesting is that the message varies slightly failure to failure – the error is the same, but the text gets mangled. Here’s another example:

Build failed.
make[3]: *** [../ebin/hipe_rtl_liveness.beam] Error 1
erts_mmap: Failed to create super carrier of size erts_mmap: Failed to create super carrier of size e5512 MB
rts_mmap: Failed to create super carrier of size 12 MB
512 MB
make[3]: *** [../ebin/hipe_rtl_binary_construct.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_exceptions.beam] Error 1
make[3]: *** [../ebin/hipe_rtl_symbolic.beam] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2

The machine itself is a fresh install, fwiw.

I’ve verified that I’m running the latest versions of asdf, the erlang plugin (and by extension – kerl)

Those can be removed I think without affecting the compile result as the no-stack-check option is the one that actually fixes this issue, but I left them from the snippet I found in the internet.

They should not be removed. When you set CFLAGS when compiling any/most autoconf projects you overwrite the default CFLAGS. The default CFLAGS are “-O2 -g”. So if you only set “-fno-stack-check” you will get an un-optimized Erlang system without debug info.

@Stratus3D this did the trick for me. Thanks!

asdf-erlang has been updated to use kerl version 1.8.6. Can you try updating asdf-erlang and see if that fixes the problem? asdf plugin-update erlang should do the trick.

  • Delete archive of failed build from ~/.asdf/plugins/erlang/kerl-home/archives (not sure if this is necessary though)
  • asdf plugin-update erlang
  • asdf install erlang 22.3.4.12

yes @Stratus3D , i created an issue here just in case explaining the situation

https://github.com/asdf-vm/asdf-erlang/issues/167

@r-guimaraes those are gcc options for compile time. I am not an expert but the -g is to add debug symbols and the O2 is the level of optimizations. (https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html#Optimize-Options) Those can be removed I think without affecting the compile result as the no-stack-check option is the one that actually fixes this issue, but I left them from the snippet I found in the internet.

Trying to asdf install erlang 22.1.3 on MacOS Catalina.

Done:

brew reinstall coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

brew link coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

Set export PATH="/usr/local/Cellar/openssl/1.0.2t/bin:$PATH" and export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2t". Build failed.

Still getting:

 * crypto         : No usable OpenSSL found
 * jinterface     : No Java compiler found
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

Am I missing something?

i am usi g the same flags and the erlc is still falling unfortunately 😕

On Tue 8 Oct 2019 at 19:10, BSKY notifications@github.com wrote:

Probably this build setup will help us. https://github.com/Homebrew/homebrew-core/blob/master/Formula/erlang.rb

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asdf-vm/asdf-erlang/issues/116?email_source=notifications&email_token=AAADRITGVN7WBH5F3XYB6ULQNS5JLA5CNFSM4I5QC7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAU5HKA#issuecomment-539612072, or mute the thread https://github.com/notifications/unsubscribe-auth/AAADRIQ7EXESKPI7SHKCY3DQNS5JLANCNFSM4I5QC7JA .

– Sent from my Mobile

Thanks @benoitc, so they have changed something with time… seems like the monotonic time primitive from the kernel does not return monotonic time values… this is not going to be an easy thing to fix…

@garazdawi Is this to be ran from a freshly cloned erlang/otp repo?

No, in a repo that already had failed to build. In a clean repo do this:

cd otp && export ERL_TOP=`pwd`
./otp_build autoconf
./configure --disable-pgo
make

I don’t know why HIPE is failing to build but I do not it’s not going to be fully supported by upstream in OTP 22: http://erlang.org/download/otp_src_22.0.readme

It is not HiPE that fails, it is erlc that segfaults. HiPE just happens to be the first application to be compiled.

I don’t know why HIPE is failing to build but I do not it’s not going to be fully supported by upstream in OTP 22: http://erlang.org/download/otp_src_22.0.readme

As far as the javac pop-up - that is provoked by autoconf not kerl. As far as I am aware, there is no way to disable probing for javac no matter what OTP build flags are passed through.