From: Andy Moreton <andrewjmoreton@gmail.com>
To: 60996@debbugs.gnu.org
Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline
Date: Sun, 22 Jan 2023 12:51:34 +0000 [thread overview]
Message-ID: <86tu0iwx49.fsf@gmail.com> (raw)
In-Reply-To: <74d13c46-5b26-9dd8-45dc-32b7fda25421@gmail.com>
On Sun 22 Jan 2023, Eli Zaretskii wrote:
>> Date: Sat, 21 Jan 2023 22:12:10 +0000
>> From: Andy Moreton <andrewjmoreton@gmail.com>
>>
>> Recently emacs 29 (and master) has started showing an error and
>> backtrace during startup:
>>
>> 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...")
>
> We need a reproducible recipe to investigate this, or results of such
> investigation by you: which code has the file open when we try
> deleting it, and why that other code has it open?
>
> For a recipe, it should be enough to present a minimal init file which
> causes the problem (but pleased make it really minimal: as few lines
> as strictly needed for reproduction)
It may take considerable time and effort to reduce my init file down to a
simple reproducer...
> Btw, "comp-lambda-MTAMbr..." seems to tell that it's some part of
> comp.el, which sounds strange: comp.el is supposed to be
> natively-compiled during the build, and that includes the trampolines
> for it. Hmm...
The backtrace always seems to contain:
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 ...)
So it looks very much like compiling trampolines is involved.
>> Tracing execution of emacs with Process Explorer shows that the temp
>> file used to native compile trampolines is opened and closed repeatedly
>> by emacs, and at the point of the backtrace is still open by the same
>> emacs process.
>
> We need to know which code opened it the last time and didn't close
> it. Can you figure that out? All the files Emacs opens go through 2
> functions in w32.c: sys_fopen and sys_open, so by running with 2
> breakpoints there that show the backtrace and continue, you should be
> able to see the culprit, and we can then take it from there.
Thanks. I'll take a look in gdb and report back if I get further info.
>> I am not sure excactly when this issue started, but I did not see it in
>> emacs-29 or master bootstrapped before this month.
>
> Could be because we now compile trampolines differently (to avoid the
> danger of the "fork bomb" due to recursive compilation of
> trampolines by async subprocesses).
>
> Andrea, any suggestions or comments?
>
> Thanks.
next prev parent reply other threads:[~2023-01-22 12:51 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86tu0iwx49.fsf@gmail.com \
--to=andrewjmoreton@gmail.com \
--cc=60996@debbugs.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.