erlang / otp

Erlang/OTP

Home Page:http://erlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OTP 27.0 yielding_c_fun segfault on Debian armhf32

AnAccountForReportingBugs opened this issue · comments

Describe the bug
When attempting to build OTP 27.0 from source, the build process fails due to a Segmentation fault. When running make depend as the build, the “make depend” step GEN armv7l-unknown-Linux-gnueabihf/erl_db_insert_list.ycf.h has a segfault. Strace make V=1 shows the executable “yielding_c_fun” apparently faults immediately due to a failed execve EINVAL. Git bisect shows the problematic commit is 07cbdf4, “add support for remapping the .text segment using THP in Linux.”

To Reproduce
Extract tarball
cd to correct directory
Set ERL_TOP, CFLAGS, and CXXFLAGS
./configure —disable-year2038 —prefix=/mnt/drive2/opt
make

Expected behavior
Erlang builds successfully without segmentation faults.

Affected versions
27.0 and versions after commit 07cbdf4.

Additional context
Git bisect start OTP-27.0 OTP-26.2.5.1

Thanks for your report! We do not have access to suitable hardware however, so we would much appreciate it if you (or someone else) could narrow this down further.

I don’t know about remapping text segments or much programming in C. If there was something you would like me to try or logs to post, I’d be happy to help.

Looking at the code more carefully, I wonder if a compilation test for huge pages is wrong? That code snippet seems to compile just fine, but madvise returns an EINVAL error when run I tried running the snippet. Could that be because huge pages is disabled on 32 bit and not properly detected?

Looking through the bug tracker, I saw a bug about disabling huge pages for other executables. Absent other suggestions, I’m going to try a git bisect and see if that fixes this problem for yielding c fun. Hopefully that might narrow it down.

I removed the max-page-size and common-page-size arguments from LD_FLAGS manually from all the Makefiles. Make depend succeeds now. I’ll try a full build and see if the 27.0 tarball works with that change.