From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline Date: Thu, 26 Jan 2023 16:57:44 +0000 Message-ID: References: <74d13c46-5b26-9dd8-45dc-32b7fda25421@gmail.com> <833583ks9t.fsf@gnu.org> <86wn5evv70.fsf@gmail.com> <83r0vli9gr.fsf@gnu.org> <86edrku3w6.fsf@gmail.com> <83wn5cgkgv.fsf@gnu.org> <83k01bhlek.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13511"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: andrewjmoreton@gmail.com, 60996@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 26 17:58:34 2023 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 1pL5a6-0003PN-N6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Jan 2023 17:58:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL5Zd-0003CX-66; Thu, 26 Jan 2023 11:58:05 -0500 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 1pL5Zb-0003CK-2F for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 11:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pL5Za-0003VM-Qf for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 11:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pL5Za-0005IF-DU for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 11:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Jan 2023 16:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60996 X-GNU-PR-Package: emacs Original-Received: via spool by 60996-submit@debbugs.gnu.org id=B60996.167475226720325 (code B ref 60996); Thu, 26 Jan 2023 16:58:02 +0000 Original-Received: (at 60996) by debbugs.gnu.org; 26 Jan 2023 16:57:47 +0000 Original-Received: from localhost ([127.0.0.1]:36049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL5ZK-0005Hl-Qe for submit@debbugs.gnu.org; Thu, 26 Jan 2023 11:57:47 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:62817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL5ZJ-0005Hc-6b for 60996@debbugs.gnu.org; Thu, 26 Jan 2023 11:57:45 -0500 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 30QGviGk025480 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Thu, 26 Jan 2023 16:57:44 GMT In-Reply-To: <83k01bhlek.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Jan 2023 19:50:27 +0200") 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:254219 Archived-At: Eli Zaretskii writes: >> Cc: 60996@debbugs.gnu.org >> Date: Tue, 24 Jan 2023 14:56:00 +0200 >> From: Eli Zaretskii >>=20 >> But first, I'd like to understand whether indeed it could happen that >> we are deleting a temporary .eln file for a trampoline we just >> compiled when we are still using that .eln file. If this happens, >> we'd need to find a way to delay the deletion till Emacs is about to >> exit or something. > > I keep looking at the backtraces you provided, this: > >> Debugger entered--Lisp error: (permission-denied "Removing old name"=20 >> "Permission denied" "c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr.= ..") >> delete-file("c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr...") >> =C2=A0 #f(compiled-function () #)() >> =C2=A0 comp--native-compile((lambda (arg0 &optional arg1 arg2 arg3) (le= t ((f=20 >> #'format-mode-line)) (funcall f arg0 arg1 arg2 arg3))) nil nil) >> =C2=A0 comp-trampoline-compile(format-mode-line) >> =C2=A0 comp-subr-trampoline-install(format-mode-line) >> =C2=A0 advice--add-function(:around (#f(compiled-function () #> 0x3c5d8019df7e91>) . #f(compiled-function (gv--val) #> 0x8fdecbbba7cb3c2>)) delight--format-mode-line nil) >> =C2=A0 advice-add(format-mode-line :around delight--format-mode-line) >> =C2=A0 require(delight nil t) > > And this: > >> delete file("path/to/comp-lambda-XXXXX.eln") >> comp--native-compile((lambda (...) ...)) >> comp-trampoline-compile(function-name) >> comp-subr-trampoline-install(function-name) >> advice--add-function(...) >> advice-add(function-name ...) > > and I still don't have a clear picture regarding which code calls > delete-file and why. For example, the first backtrace above says that > comp--native-compile calls delete-file via some byte-compiled > function, not directly. But what is that byte-compiled function? can > you figure that out? > > There is a direct call to delete-file in comp--native-compile, but is > that the call which fails? And if so, why does it fail? Which code > created the .eln file that comp--native-compile tries to delete? > > Andrea, can you please describe in detail what happens, step by step, > when comp-subr-trampoline-install is called like above, to compile a > trampoline for an advised function? What is that file which > comp--native-compile is deleting at the end? Hi Eli, comp-subr-trampoline-install just search for an existing trampoline with comp-trampoline-search, if this is not found is using comp-trampoline-compile to produce that. Once the trampoline is found or created it gets installed. In this case as the trampoline is not found and so comp-trampoline-compile is invoking comp--native-compile to produce one. Please see my other reply into this thread for more, as there might be more to investigate here. BR Andrea