Subject: Request for fixing randomize_va_space build issues

From: Philippe Vaucher <[email-masked]>
Date: Fri, 13 May 2016 14:18:52 +0200

Hello,

When /proc/sys/kernel/randomize_va_space is 2, emacs fails to build:

    Dumping under the name emacs
    **************************************************
    Warning: Your system has a gap between BSS and the
    heap (20865783 bytes).  This usually means that exec-shield
    or something similar is in effect.  The dump may
    fail because of this.  See the section about
    exec-shield in etc/PROBLEMS for more information.
    **************************************************
    /bin/bash: line 7:  8981 Segmentation fault      (core dumped)
./temacs --batch --load loadup bootstrap
    Makefile:815: recipe for target 'bootstrap-emacs' failed
    make[1]: *** [bootstrap-emacs] Error 1
    make[1]: Leaving directory '/tmp/emacs/src'

This is a somewhat known bug:

https://debbugs.gnu.org/db/13/13964.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598234
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566947
https://bugzilla.redhat.com/show_bug.cgi?id=160814

I know there is a workaround that goes like:

    echo 0 > /proc/sys/kernel/randomize_va_space
    make
    echo 2 > /proc/sys/kernel/randomize_va_space

But in my case this is not possible, I'm building as a user with
limited privileges.

The file /etc/PROBLEMS mention another workaround:

    setarch x86_64 -R make

But this fails with the same error.

I'm far from being the only one with this problem:

https://github.com/boot2docker/boot2docker/issues/1136
https://github.com/ensime/ensime-emacs/issues/369
https://github.com/proot-me/PRoot/issues/52

And basically the workaround is always "set randomize_va_space to 0".

Can someone explain what the real issue is and what we could do to
_really_ fix it? One should be able to compile emacs without changing
kernel parameters!

Thanks in advance,
Philippe