Bug 237465 - lang/erlang-runtime21: build on ARM throws Segmentation Fault
Summary: lang/erlang-runtime21: build on ARM throws Segmentation Fault
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: Dave Cottlehuber
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-04-22 11:29 UTC by Leo Schneider
Modified: 2021-10-04 07:32 UTC (History)
4 users (show)

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


Attachments
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 freebsd_triage 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 freebsd_triage 2019-04-22 18:58:22 UTC
It works here, FreeBSD 13.0-CURRENT r343768, armv7
/usr/local/lib/erlang21/bin/erl
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)
1>

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

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

Stop.
make: stopped in /usr/ports/lang/erlang-runtime21
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2019-04-25 16:14:20 UTC
I confirm it crashes on 12.0-RELEASE.
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 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:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237960
Comment 10 Dave Cottlehuber freebsd_committer freebsd_triage 2021-10-01 14:22:53 UTC
NB https://bugs.erlang.org/projects/ERL/issues/ERL-958 should have resolved this upstream now. As this is  now 2 years old, please let us know if you can re-test on arm6 or arm7 so we can pull in your patch, against e.g. lang/erlang or erlang-runtime21 still.

I appreciate that a BBB is not a particularly fast compile target...
Comment 11 Dave Cottlehuber freebsd_committer freebsd_triage 2021-10-04 07:32:20 UTC
I don't have a BBB or other arm32 system to test this against, please re-open if this is reproducible on the latest lang/erlang configs. thanks for the report!