Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700182 - app-editors/emacs-vcs-27.0.9999 - src_compile() should not need SANDBOX_ON=0
Summary: app-editors/emacs-vcs-27.0.9999 - src_compile() should not need SANDBOX_ON=0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: GNU Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-15 17:48 UTC by Michael Rohleder (mroh)
Modified: 2019-11-20 08:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rohleder (mroh) 2019-11-15 17:48:26 UTC
since emacs uses pdumper per default, this

src_compile() {
        # Disable sandbox when dumping. For the unbelievers, see bug #131505
        emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
}

isnt needed anymore and could be:

src_compile() {
   default
}


Reproducible: Always
Comment 1 Ulrich Müller gentoo-dev 2019-11-16 11:54:35 UTC
There is no support for the portable dumper in the emacs-26 branch, i.e. emacs-26.3 is still using unexec.
Comment 2 Ulrich Müller gentoo-dev 2019-11-18 09:58:12 UTC
Reopening for app-editors/emacs-vcs-27.0.9999 which uses the portable dumper by default.

However, I am getting different emacs.pdmp files with and without the sandbox (even different length, so it's not a simple matter of timestamps):

# ls -l /usr/libexec/emacs/27.0.50/x86_64-pc-linux-gnu/emacs.pdmp  # sandbox off
-rw-r--r-- 1 root root 10563352 Nov 18 10:34 /usr/libexec/emacs/27.0.50/x86_64-pc-linux-gnu/emacs.pdmp

# ls -l /usr/libexec/emacs/27.0.50/x86_64-pc-linux-gnu/emacs.pdmp  # sandbox on
-rw-r--r-- 1 root root 10563704 Nov 18 10:41 /usr/libexec/emacs/27.0.50/x86_64-pc-linux-gnu/emacs.pdmp

At first glance, I'm not noticing any problems at runtime. Still, I'm going to investigate the cause of this difference.
Comment 3 Ulrich Müller gentoo-dev 2019-11-18 15:36:57 UTC
Looks like the size of emacs.pdmp slightly varies between different builds, even if nothing is changed. So I'm going to give it a try and remove the sandbox hack in the live ebuild. 

Thanks for reporting!
Comment 4 Larry the Git Cow gentoo-dev 2019-11-18 15:38:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49d30402fafa3571d4d3e1a79b4d08cc90318224

commit 49d30402fafa3571d4d3e1a79b4d08cc90318224
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-11-18 15:36:59 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-11-18 15:37:43 +0000

    app-editors/emacs-vcs: Remove sandbox hack in src_compile.
    
    Configure with explicit option --with-dumping=pdumper to make sure
    that the portable dumper is used, even for the (unlikely) case that
    the upstream default would change.
    
    Note that (as of today) --with-dumping=unexec breaks the build
    process, therefore controlling this option with a USE flag wouldn't
    make sense.
    
    Closes: https://bugs.gentoo.org/700182
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-editors/emacs-vcs/emacs-vcs-27.0.9999.ebuild | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Comment 5 Ulrich Müller gentoo-dev 2019-11-20 08:25:41 UTC
I've reported the changing size of emacs.pdmp upstream. After the following commit:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0fce8e9391fd107f9267188a36b85aea778b8440

commit 0fce8e9391fd107f9267188a36b85aea778b8440
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue Nov 19 18:23:01 2019 -0800

    Make .pdmp file more reproducible
    
    Problem reported by Ulrich Müller
    <https://lists.gnu.org/r/emacs-devel/2019-11/msg00757.html>
    and diagnosed by Andreas Schwab
    <https://lists.gnu.org/r/emacs-devel/2019-11/msg00774.html>.
    * src/sysdep.c (maybe_disable_address_randomization):
    Disable ASLR if any kind of dumping, instead of merely if
    unexec dumping.  Omit first arg for simplicity; all uses changed.

... I get a reproducible size between builds.

However, with sandbox disabled and enabled, emacs.pdmp still has slightly different size (10563576 and 10563568 bytes, respectively).