Bug 237465 - lang/erlang-runtime21: build on ARM throws Segmentation Fault
Summary: lang/erlang-runtime21: build on ARM throws Segmentation Fault
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: freebsd-erlang (Nobody)
Keywords: needs-qa
Depends on:
Reported: 2019-04-22 11:29 UTC by Leo Schneider
Modified: 2019-08-29 04:37 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (erlang)

Issue evidence (97.43 KB, image/png)
2019-04-22 11:29 UTC, Leo Schneider
no flags Details
Build config (51.06 KB, image/png)
2019-04-22 12:13 UTC, Leo Schneider
no flags Details
Config ignoring options to disable HIPE and CORBA (56.01 KB, image/png)
2019-04-22 12:23 UTC, Leo Schneider
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Schneider 2019-04-22 11:29:54 UTC
Created attachment 203893 [details]
Issue evidence

Ordinary build of this port in an ARM 32bits machine throws a segmentation fault and the port can't be compiled.
Comment 1 Bugzilla Automation freebsd_committer 2019-04-22 11:29:54 UTC
Maintainer informed via mail
Comment 2 Leo Schneider 2019-04-22 12:13:29 UTC
Created attachment 203894 [details]
Build config
Comment 3 Leo Schneider 2019-04-22 12:15:43 UTC
I tried to disable the "HIPE" build during the port pre-build configuration however, seems that the port is ignoring anything I select in the config. 

For instance, if I de-select HIPE or CORBA, it downloads and builds CORBA anyway.
Comment 4 Leo Schneider 2019-04-22 12:23:49 UTC
Created attachment 203896 [details]
Config ignoring options to disable HIPE and CORBA
Comment 5 Mikael Urankar freebsd_committer 2019-04-22 18:58:22 UTC
It works here, FreeBSD 13.0-CURRENT r343768, armv7
Erlang/OTP 21 [erts-10.3.4] [source] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Eshell V10.3.4  (abort with ^G)

Can you give us more details?
Comment 6 Leo Schneider 2019-04-23 04:05:46 UTC
(In reply to mikael.urankar from comment #5)
I'm running FreeBSD 12.0-RELEASE r341666 GENERIC on a Beaglebone black.

fornax erlang-runtime21 # make showconfig
===> The following configuration options are available for erlang-runtime21-21.3.6:
     CORBA=off: Enable Corba support
     DIRTY=on: Enable Dirty schedulers
     HIPE=off: Build native HiPE compiler
     JAVA=off: Java platform support
     KQUEUE=on: Enable Kernel Poll (kqueue) support
     NATIVE=off: Enable native libraries
     ODBC=off: ODBC database backend
     OPENSSL=on: SSL/TLS support via OpenSSL
     SCTP=on: Enable SCTP support
     THREADS=on: Threading support
     WX=off: Enable WX application
===> Use 'make config' to modify these settings

But I'm still getting 

=== Entering application hipe
gmake[5]: Entering directory '/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/lib/hipe/misc'
 ERLC	../ebin/hipe_consttab.beam
gmake[5]: *** [/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/make/armv7-unknown-freebsd12.0-gnueabihf/otp.mk:132: ../ebin/hipe_consttab.beam] Segmentation fault (core dumped)
gmake[5]: Leaving directory '/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/lib/hipe/misc'
gmake[4]: *** [/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/make/otp_subdir.mk:29: opt] Error 2
gmake[4]: Leaving directory '/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/lib/hipe'
gmake[3]: *** [/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/make/otp_subdir.mk:29: opt] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6/lib'
gmake[2]: *** [Makefile:583: secondary_bootstrap_build] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/erlang-runtime21/work/otp-OTP-21.3.6'
*** Error code 1

make[1]: stopped in /usr/ports/lang/erlang-runtime21
*** Error code 1

make: stopped in /usr/ports/lang/erlang-runtime21
Comment 7 Mikael Urankar freebsd_committer 2019-04-25 16:14:20 UTC
I confirm it crashes on 12.0-RELEASE.
Comment 8 Mikael Urankar freebsd_committer 2019-05-19 17:29:42 UTC
fwiw it builds fine with CFLAGS+= -O0
Comment 9 Bertrand Petit 2019-05-24 04:27:46 UTC
Please see this related PR which tries to handle the same issue for lang/erlang and has a proposed patch: