From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73318: 31.0.50; with-native-compilation=aot breaks exec -a emacs Date: Wed, 09 Oct 2024 15:13:06 +0300 Message-ID: <86msjd4gq5.fsf@gnu.org> References: <864j6eb29f.fsf@gnu.org> <861q1iayk6.fsf@gnu.org> <86wmja9iwi.fsf@gnu.org> <86plp19kei.fsf@gnu.org> <86ldz4xc93.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19301"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 73318@debbugs.gnu.org, schwab@linux-m68k.org, shipmints@gmail.com, larsi@gnus.org, acorallo@gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 09 14:14:12 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1syVa0-0004q6-9y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Oct 2024 14:14:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syVZi-0004aT-NV; Wed, 09 Oct 2024 08:13:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syVZg-0004a3-QZ for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 08:13:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syVZg-0002EV-9o for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 08:13:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=T9BN2PYK5/fxQzgFhKvaNsTzeksz4tlXNNLRbp8tmhU=; b=HvDunwbqLhDFowfylTLBlZl2Jp0gnenOMKP6Za7SgP4iqDNQXROx7K/LTJhAzbqfs4dOoA3GBqaPv0vouJGR/fkcO4pqxkN5Fk2zganCx0LFuRM0j+CKfonqJy/WnKujLumUHKKIU8QcecapaGfOfICGjqItK4xrKj6Q1PSWJLUcxZ8UMjlH5CknGmM6K6j69ybtoqmgevRe8l1XsXMOgXMxE3L380mVIA6LPeTQh+AaPwSgCbYFGKONL53tFURXcUKcDLohdyG107vbwkffrL9y2kYJLLp1MiaLfFuBMYMRP6il7aLsZPuI2ngy5AJOeqhvQHJtg7R1D/BedI7Z8A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syVZp-0003Y3-Pw for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 08:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2024 12:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73318 X-GNU-PR-Package: emacs Original-Received: via spool by 73318-submit@debbugs.gnu.org id=B73318.172847601313593 (code B ref 73318); Wed, 09 Oct 2024 12:14:01 +0000 Original-Received: (at 73318) by debbugs.gnu.org; 9 Oct 2024 12:13:33 +0000 Original-Received: from localhost ([127.0.0.1]:55876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syVZM-0003XB-Jo for submit@debbugs.gnu.org; Wed, 09 Oct 2024 08:13:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syVZK-0003Wv-3k for 73318@debbugs.gnu.org; Wed, 09 Oct 2024 08:13:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syVZ2-0002C2-6A; Wed, 09 Oct 2024 08:13:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=T9BN2PYK5/fxQzgFhKvaNsTzeksz4tlXNNLRbp8tmhU=; b=rX8Y7nndJXtz jZY5bk67bstc3OBFXiHvM5mMi/owvgMYOka6hjE3ZBChOrx0e4VBWra9zfXgapEv30BQjcNy32MA/ LYLQnY/5eMVxnLdqG1NmwT6Uhw7cZnN8a6wfo3FGTOPJLn35YujwkFL/0rZ029GUqsmF0HxwYw3nK yyPS2zTigf27GAE+PcPLMoBY/2uwajTHM6TnVhRmgJyvkP6mFjKRJd68DPJIK4fTSIJqOKDnb4vv6 hRhoB0+PD1UpxhCujKtSstCBKJSrjpsgDvmfszCpbSqgGCDMABHhxmjcj5In2a+7cSbSwk2YwdDHQ sOtuPmDRhjI4ooC1YzjIZg==; In-Reply-To: (message from Stefan Kangas on Tue, 8 Oct 2024 23:35:11 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293199 Archived-At: > From: Stefan Kangas > Date: Tue, 8 Oct 2024 23:35:11 +0000 > Cc: 73318@debbugs.gnu.org, larsi@gnus.org, acorallo@gnu.org, > schwab@linux-m68k.org, shipmints@gmail.com > > Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" 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?