GNU bug report logs - #32083
26.1.50; temacs bootstrap execs itself forever on alpha-unknown-linux-gnu

Previous Next

Package: emacs;

Reported by: Ulrich Mueller <ulm <at> gentoo.org>

Date: Sat, 7 Jul 2018 15:29:01 UTC

Severity: important

Tags: patch

Found in version 26.1.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32083 in the body.
You can then email your comments to 32083 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32083; Package emacs. (Sat, 07 Jul 2018 15:29:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Mueller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Jul 2018 15:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, Tobias Klausmann <klausman <at> gentoo.org>
Subject: 26.1.50;
 temacs bootstrap execs itself forever on alpha-unknown-linux-gnu
Date: Sat, 7 Jul 2018 17:28:22 +0200
Forwarding Gentoo bug https://bugs.gentoo.org/660448:

Tobias Klausmann has reported a problem with building Emacs 26.1 on an
Alpha machine under GNU/Linux:

make -C ../lisp update-subdirs
make[2]: Entering directory '/space/portage-tmp/portage/app-editors/emacs-26.1/work/emacs-26.1/lisp'
for file in . ./calc ./calendar ./emacs-lisp ./emulation ./erc ./eshell ./gnus ./image ./international ./language ./mail ./mh-e ./net ./nxml ./obsolete ./org ./play ./progmodes ./term ./textmodes ./url ./vc; do \
   ./../build-aux/update-subdirs $file; \
done;
make[2]: Leaving directory '/space/portage-tmp/portage/app-editors/emacs-26.1/work/emacs-26.1/lisp'
./temacs --batch  --load loadup bootstrap
[Build aborted with C-c after waiting for a long time.]

Seemingly temacs hangs there indefinitely, but gdb shows that it is
executing itself forever:

(gdb) run
Starting program: /space/homedirs/ulm/emacs/src/temacs --batch --load loadup bootstrap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
process 859 is executing new program: /space/homedirs/ulm/emacs/src/temacs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
process 859 is executing new program: /space/homedirs/ulm/emacs/src/temacs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
process 859 is executing new program: /space/homedirs/ulm/emacs/src/temacs
^C
Program received signal SIGINT, Interrupt.
0x00000200000010f0 in ?? () from /lib/ld-linux.so.2

Setting a breakpoint in disable_address_randomization() shows the
following values:

   pers = 0
   desired_pers = 262144
   personality(desired_pers) = 0
   personality(0xffffffff) = 262144

So apparently, setting the persona to ADDR_NO_RANDOMIZE succeeds?
However, after the execvp, the above values are the same as before
again (especially pers = 0).

Git bisecting shows that the problem was introduced by this commit:

commit e95b023163e96538b15f030b7176b7ec59cf86f5
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Fri Jul 15 13:07:09 2016 +0200

    Port to glibc 2.24 (pre-release) + ppc64

    Inspired by a suggestion by Florian Weimer in:
    https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
    * configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE):
    Rename from HAVE_PERSONALITY_LINUX32, and check for
    ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
    All uses changed.
    * src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]:
    Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
    flag ourselves.  Just set that flag, rather than also setting the
    persona.  When doing it, avoid functions like putenv that may
    allocate memory.


In GNU Emacs 26.1.50 (build 1, alpha-unknown-linux-gnu)
 of 2018-07-07 built on monolith
Repository revision: b73cde5e2815c531df7f5fd13e214a7d92f78239

Configured using:
 'configure --prefix=/usr --build=alpha-unknown-linux-gnu
 --host=alpha-unknown-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-26.1
 --htmldir=/usr/share/doc/emacs-26.1/html --libdir=/usr/lib
 --program-suffix=-emacs-26 --infodir=/usr/share/info/emacs-26
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --enable-acl --without-dbus
 --without-modules --without-gameuser --without-gpm --without-kerberos
 --without-kerberos5 --without-lcms2 --without-xml2 --without-mailutils
 --without-selinux --with-gnutls --without-libsystemd --with-threads
 --without-wide-int --with-zlib --with-sound=no --without-x
 --without-ns'

Configured features:
NOTIFY ACL GNUTLS ZLIB THREADS




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32083; Package emacs. (Sat, 07 Jul 2018 16:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 32083 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: 32083 <at> debbugs.gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, Tobias Klausmann <klausman <at> gentoo.org>
Subject: Re: 26.1.50;
 temacs bootstrap execs itself forever on alpha-unknown-linux-gnu
Date: Sat, 7 Jul 2018 18:05:55 +0200
Maybe worth mentioning that the build succeeds if I unconditionally
set disable_aslr = false in emacs.c. It shows the warning box but
produces a working emacs executable in spite of this:

Dumping under the name emacs
**************************************************
Warning: Your system has a gap between BSS and the
heap (34147687 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.
**************************************************




Severity set to 'important' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 07 Jul 2018 16:46:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32083; Package emacs. (Sat, 07 Jul 2018 18:04:01 GMT) Full text and rfc822 format available.

Message #13 received at 32083 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ulrich Mueller <ulm <at> gentoo.org>, 32083 <at> debbugs.gnu.org
Cc: Tobias Klausmann <klausman <at> gentoo.org>
Subject: Re: 26.1.50; temacs bootstrap execs itself forever on
 alpha-unknown-linux-gnu
Date: Sat, 7 Jul 2018 11:03:40 -0700
[Message part 1 (text/plain, inline)]
Thanks for the bug report. Please try the attached patch; if it works around the 
bug for you, I'll install it on the emacs-26 branch and it should appear in the 
next Emacs release.

It would also be helpful to file a bug report with the Alpha Linux kernel folks, 
as there does seem to be a kernel bug here (or at least, an unexpected 
inconsistency with x86-64 with respect to how process personalities survive exec).
[0001-Fix-bootstrap-infloop-in-GNU-Linux-alpha.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 07 Jul 2018 20:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32083; Package emacs. (Sat, 07 Jul 2018 22:31:03 GMT) Full text and rfc822 format available.

Message #18 received at 32083 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 32083 <at> debbugs.gnu.org, Tobias Klausmann <klausman <at> gentoo.org>
Subject: Re: 26.1.50; temacs bootstrap execs itself forever on
 alpha-unknown-linux-gnu
Date: Sun, 8 Jul 2018 00:30:28 +0200
>>>>> On Sat, 7 Jul 2018, Paul Eggert wrote:

> Thanks for the bug report. Please try the attached patch; if it
> works around the bug for you, I'll install it on the emacs-26 branch
> and it should appear in the next Emacs release.

Thank you. The patch fixes the problem here.

> It would also be helpful to file a bug report with the Alpha Linux
> kernel folks, as there does seem to be a kernel bug here (or at
> least, an unexpected inconsistency with x86-64 with respect to how
> process personalities survive exec).

Indeed it is different. In Linux, the SET_PERSONALITY macro in
arch/alpha/include/asm/elf.h simply does:

   set_personality(PER_LINUX)

whereas elsewhere (e.g., ppc) the same macro has additional masking
(with PER_MASK being the lowest 8 bits, so ADDR_NO_RANDOMIZE would be
preserved):

   set_personality(PER_LINUX | (current->personality & (~PER_MASK)))

We'll investigate and report a bug to Linux upstream.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 08 Jul 2018 16:07:02 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Mueller <ulm <at> gentoo.org>:
bug acknowledged by developer. (Sun, 08 Jul 2018 16:07:03 GMT) Full text and rfc822 format available.

Message #23 received at 32083-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ulrich Mueller <ulm <at> gentoo.org>
Cc: Tobias Klausmann <klausman <at> gentoo.org>, 32083-done <at> debbugs.gnu.org
Subject: Re: 26.1.50; temacs bootstrap execs itself forever on
 alpha-unknown-linux-gnu
Date: Sun, 8 Jul 2018 09:05:55 -0700
Ulrich Mueller wrote:
> The patch fixes the problem here.

Thanks for checking, and for following up on the kernel side. I pushed the Emacs 
patch into the emacs-26 branch and am marking the Emacs bug as done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32083; Package emacs. (Sun, 08 Jul 2018 18:52:02 GMT) Full text and rfc822 format available.

Message #26 received at 32083 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 32083 <at> debbugs.gnu.org
Subject: Re: 26.1.50; temacs bootstrap execs itself forever on
 alpha-unknown-linux-gnu
Date: Sun, 8 Jul 2018 11:51:19 -0700
Here's the URL for how Ulrich followed up on the linux-alpha bug, for those 
interested in spelunking this:

https://marc.info/?m=153102886305111




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 06 Aug 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.