GNU bug report logs - #73318
31.0.50; with-native-compilation=aot breaks exec -a emacs

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 17 Sep 2024 15:20:01 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: sbaugh <at> janestreet.com, 73318 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, shipmints <at> gmail.com, larsi <at> gnus.org, acorallo <at> gnu.org
Subject: bug#73318: 31.0.50; with-native-compilation=aot breaks exec -a emacs
Date: Wed, 09 Oct 2024 15:13:06 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 8 Oct 2024 23:35:11 +0000
> Cc: 73318 <at> debbugs.gnu.org, larsi <at> gnus.org, acorallo <at> gnu.org, 
> 	schwab <at> linux-m68k.org, shipmints <at> gmail.com
> 
> Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
> 
> > Yes, I'm persuaded now that if we use /proc/self/exe, we should also use
> > argv[0].  As Po Lu said, /proc can be unmounted, so we must have some
> > other mechanism besides just /proc/self/exe.
> [...]
> > If we use /proc/self/exe, I'm fine with it being a fallback if all other
> > mechanisms fail.  That should make these cases still work fine, right?
> 
> Did we discard the idea to check for /proc/self/exe first (on systems
> that support it, of course), and falling back to argv[0] if that fails?

This will have to somehow resolve the potential problems I listed in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73318#32 (and perhaps
some others I didn't mention there).  That is not trivial, and will
probably need to do something we already do, just without using
/proc/self/exe.

So I very much dislike this alternative.  At the time Daniel coded the
initial version of this code, he decided (and others generally agreed)
that use of /proc/self/exe does not bring us any advantages.  The code
which was written then and improved and enhanced since then is solid,
supports quite a few use patterns (some of them quite surprising), and
was tested by 3 Emacs releases.  Significant modifications of the
code's logic (which will be necessary of /proc/self/exe is the first
method to be used) will basically set us back to where we were in
Emacs 28, something I'd like to avoid.

> Could we use getauxval(AT_EXECFN) when we have glibc?

Isn't that the same method as /proc/self/exe, just thinly disguised?




This bug report was last modified 288 days ago.

Previous Next


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