unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philippe Vaucher <philippe.vaucher@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 23529@debbugs.gnu.org
Subject: bug#23529: Request for fixing randomize_va_space build issues
Date: Wed, 18 May 2016 10:44:37 +0200	[thread overview]
Message-ID: <CAGK7Mr77fanGCxd1UuaKO19buq7XYCPDWvXaY=oGo+MmAW5mkg@mail.gmail.com> (raw)
In-Reply-To: <573C2601.3030308@cs.ucla.edu>

> Some background: Emacs has an 'undump' function that saves the Emacs state as an
> executable: when you run the executable, you get an Emacs with the same (or
> nearly the same) state. This makes Emacs startup considerably faster. Objects in
> the restored state must be in the same location as when they were saved, so the
> executable cannot be subject to ASLR.

Alright, that makes sense now.

> I don't know all the ins and outs of why it is necessary for Emacs to invoke
> 'personality'. As I understand it, the build procedure should invoke the shell
> command 'setfattr -n user.pax.flags -v er temacs' immediately after building
> temacs, and I don't know why this doesn't make the 'personality' call
> unnecessary. Perhaps you can consult a seccomp expert who can tell you what's
> going on, as seccomp is not well-documented. If there is some way to disable
> ASLR without calling 'personality', that should fix your problem.

I'll try to debug the `setfattr` part to see what it does. I seems
that `setarch -R` and `personality` both "works" return-status wise
but in practice inside docker they don't change anything (and thus
don't disable ASLR). It looks like eventually the problem will be
fixed on the docker side... but maybe the debug session will yield
some emacs patch.

> Regardless, the advice in etc/PROBLEMS is clearly obsolete here, so I installed
> the attached patch to try to make things clearer. We're not going to greatly
> alter the dumping procedure before Emacs 25 comes out (it's too late in the
> release process) but we should do better in the future. For now we should at
> least document the issues better.

Ah, good patch! About the dumping procedure, do you mean there *is* a
plan to alter it after Emacs 25 comes out? The building behavior on
this issue about ASLR between 24.5 and 25.0.93 seems very similar from
my experience.

>> I tried to run "./temacs --batch --load loadup bootstrap" inside GDB
>> to get more insights about why it segfaults there, but somehow gdb
>> fails to catch it. Maybe because of spawned processes?
>
> Yes, the code you highlighted does an execvp. You might try fiddling with GDB's
> follow-exec-mode variable; see
> <https://sourceware.org/gdb/onlinedocs/gdb/Forks.html>.

I'll play with it. Thanks!
Philippe





  reply	other threads:[~2016-05-18  8:44 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 12:18 bug#23529: Request for fixing randomize_va_space build issues Philippe Vaucher
2016-05-13 15:58 ` Paul Eggert
2016-05-17 16:38   ` Philippe Vaucher
2016-05-18  7:53     ` Philippe Vaucher
2016-05-18  8:21     ` Paul Eggert
2016-05-18  8:44       ` Philippe Vaucher [this message]
2016-05-20 17:52         ` Paul Eggert
2016-09-06  9:22           ` Philipp Stephani
2016-09-06 17:21             ` Paul Eggert
2016-09-06 17:40               ` Eli Zaretskii
2016-09-06 17:46                 ` Philippe Vaucher
2016-09-06 17:55                   ` Philipp Stephani
2016-09-06 18:04                     ` Eli Zaretskii
2016-09-06 17:59                   ` Eli Zaretskii
2016-09-06 18:03                     ` Philipp Stephani
2016-09-06 18:32                       ` Eli Zaretskii
2016-09-06 19:01                         ` Philipp Stephani
2016-09-06 18:24                     ` Philippe Vaucher
2016-09-06 19:11                       ` Eli Zaretskii
2016-09-06 18:18                 ` Clément Pit--Claudel
2016-09-06 19:09                   ` Eli Zaretskii
2016-09-06 19:59                     ` Clément Pit--Claudel
2016-09-06 18:44                 ` Paul Eggert
2016-09-06 19:18                   ` Eli Zaretskii
2016-09-06 20:37                     ` Paul Eggert
2016-09-07  7:12                       ` Philippe Vaucher
2016-09-07  7:40                         ` Paul Eggert
2016-09-07 11:01                           ` Philipp Stephani
2016-09-07 14:21                       ` Eli Zaretskii
2016-09-07 16:11                         ` Paul Eggert
2016-09-07 17:10                           ` Eli Zaretskii
2016-09-07 17:40                             ` Paul Eggert
2016-09-07 18:11                               ` Eli Zaretskii
2016-09-07 20:12                                 ` Paul Eggert
2016-09-09  5:40                                   ` Eli Zaretskii
2016-09-09  7:10                                     ` Paul Eggert
2016-09-09  7:50                                       ` Eli Zaretskii
2016-09-09  8:54                                         ` Paul Eggert
2016-09-09  9:09                                           ` Eli Zaretskii
2016-09-09 16:16                                             ` Paul Eggert
2016-09-09 18:45                                               ` Eli Zaretskii
2016-09-09 19:59                                                 ` Paul Eggert
2016-09-10  6:06                                                   ` Eli Zaretskii
2016-09-10  7:52                                                     ` Paul Eggert
2016-09-10 10:19                                                       ` Eli Zaretskii
2016-09-10 23:01                                                         ` Paul Eggert
2016-09-11 15:23                                                           ` Eli Zaretskii
2016-09-11 16:59                                                             ` Paul Eggert
2016-09-11 17:19                                                               ` Eli Zaretskii
2016-09-11 19:32                                                             ` Philippe Vaucher
2016-09-12  2:30                                                               ` Eli Zaretskii
2016-09-12  2:58                                                                 ` Clément Pit--Claudel
2016-09-12  6:09                                                                   ` Philipp Stephani
2016-09-12 17:04                                                                     ` Eli Zaretskii
2016-09-12 14:10                                                                 ` Philippe Vaucher
2016-09-12 14:18                                                                   ` Philippe Vaucher
2016-09-13 14:47                                                                     ` Eli Zaretskii
2016-09-13 15:21                                                                       ` Philippe Vaucher
2016-09-13 15:55                                                                         ` Eli Zaretskii
2016-09-13 15:51                                                                       ` Paul Eggert
2016-09-13 19:24                                                                         ` Eli Zaretskii
2016-09-09 20:00                                               ` Philippe Vaucher
2016-09-10  6:13                                                 ` Eli Zaretskii
2016-09-09 18:29                                     ` Andreas Schwab
2016-09-09 18:56                                       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2019-09-14  4:18 bug#13964: " Stefan Kangas
2019-09-14  8:52 ` Philippe Vaucher
2019-09-14 10:39   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGK7Mr77fanGCxd1UuaKO19buq7XYCPDWvXaY=oGo+MmAW5mkg@mail.gmail.com' \
    --to=philippe.vaucher@gmail.com \
    --cc=23529@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).