unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: andrewjmoreton@gmail.com, akrl@sdf.org
Cc: 60996@debbugs.gnu.org
Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline
Date: Tue, 24 Jan 2023 19:50:27 +0200	[thread overview]
Message-ID: <83k01bhlek.fsf@gnu.org> (raw)
In-Reply-To: <83wn5cgkgv.fsf@gnu.org> (message from Eli Zaretskii on Tue, 24 Jan 2023 14:56:00 +0200)

> 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?

Thanks.





  reply	other threads:[~2023-01-24 17:50 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 [this message]
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

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=83k01bhlek.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60996@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=andrewjmoreton@gmail.com \
    /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).