From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: andrewjmoreton@gmail.com, 60996@debbugs.gnu.org
Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline
Date: Thu, 26 Jan 2023 16:57:44 +0000 [thread overview]
Message-ID: <xjf7cx9nshj.fsf@ma.sdf.org> (raw)
In-Reply-To: <83k01bhlek.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Jan 2023 19:50:27 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> Cc: 60996@debbugs.gnu.org
>> Date: Tue, 24 Jan 2023 14:56:00 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>>
>> 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"
>> "Permission denied" "c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr...")
>> delete-file("c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr...")
>> #f(compiled-function () #<bytecode 0xb2aa5c0c9e24501>)()
>> comp--native-compile((lambda (arg0 &optional arg1 arg2 arg3) (let ((f
>> #'format-mode-line)) (funcall f arg0 arg1 arg2 arg3))) nil nil)
>> comp-trampoline-compile(format-mode-line)
>> comp-subr-trampoline-install(format-mode-line)
>> advice--add-function(:around (#f(compiled-function () #<bytecode
>> 0x3c5d8019df7e91>) . #f(compiled-function (gv--val) #<bytecode
>> 0x8fdecbbba7cb3c2>)) delight--format-mode-line nil)
>> advice-add(format-mode-line :around delight--format-mode-line)
>> 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
prev parent reply other threads:[~2023-01-26 16:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-21 22:12 bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline Andy Moreton
2023-01-22 6:17 ` Eli Zaretskii
2023-01-22 12:51 ` Andy Moreton
2023-01-23 17:04 ` Andrea Corallo
2023-01-23 17:11 ` Eli Zaretskii
2023-01-26 16:50 ` Andrea Corallo
2023-01-26 18:38 ` Eli Zaretskii
2023-01-26 19:46 ` Andrea Corallo
2023-01-26 20:03 ` Eli Zaretskii
2023-01-26 20:25 ` Andrea Corallo
2023-01-27 13:00 ` Eli Zaretskii
2023-01-27 13:56 ` Andrea Corallo
2023-01-26 20:35 ` Eli Zaretskii
2023-01-27 9:51 ` Andrea Corallo
2023-01-28 21:15 ` Andy Moreton
2023-01-29 7:01 ` Eli Zaretskii
2023-01-29 7:23 ` Eli Zaretskii
2023-01-30 10:11 ` Andrea Corallo
2023-01-29 7:47 ` Eli Zaretskii
2023-01-29 11:37 ` Andy Moreton
2023-01-29 13:50 ` Eli Zaretskii
2023-01-29 13:50 ` Eli Zaretskii
2023-01-23 2:30 ` Andy Moreton
2023-01-23 14:58 ` Eli Zaretskii
2023-01-24 1:18 ` Andy Moreton
2023-01-24 12:56 ` Eli Zaretskii
2023-01-24 17:50 ` Eli Zaretskii
2023-01-24 19:12 ` Eli Zaretskii
2023-01-24 22:32 ` Andy Moreton
2023-01-25 11:58 ` Eli Zaretskii
2023-01-25 23:49 ` Andy Moreton
2023-01-26 6:51 ` Eli Zaretskii
2023-01-26 16:57 ` Andrea Corallo [this message]
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=xjf7cx9nshj.fsf@ma.sdf.org \
--to=akrl@sdf.org \
--cc=60996@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
--cc=eliz@gnu.org \
/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).