From: Eli Zaretskii <eliz@gnu.org>
To: mrzhaili@gmail.com
Cc: 13079-done@debbugs.gnu.org
Subject: bug#13079: 24.3.50; Emacs cannot create subprocess
Date: Sat, 15 Dec 2012 15:41:41 +0200 [thread overview]
Message-ID: <83fw37mnze.fsf@gnu.org> (raw)
In-Reply-To: <83wqwwpfu1.fsf@gnu.org>
> Date: Wed, 05 Dec 2012 19:29:58 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 13079@debbugs.gnu.org
>
> The harder part of this bug is the reason _why_ 'mktemp' fails. Your
> command launches asynchronous subprocesses, creating a temporary file
> for each one of them where Emacs puts the contents of the region. In
> this case, call-process-region arranges for the temporary files to be
> removed when the call to call-process returns, and then calls
> call-process. However, since this is an async subprocess,
> call-process returns immediately, without waiting for the subprocess
> to exit, and Emacs deletes the temporary file. This "cleanup" uses
> the non-portable (outside of Posix filesystems) trick of deleting a
> file while it is still open and used by the child process. On
> Windows, this attempt to delete the file fails, and the file is left
> behind.
>
> The other part of this puzzle is that 'mktemp' as implemented by the
> Windows runtime can only have up to 42 simultaneous temporary files
> per calling thread (the MSDN documentation says 26, but that's a lie).
> Once there are 42 files in your TEMP directory created by a single
> Emacs session, all the future calls to 'mktemp' from the same session
> will fail, unless you manually delete those files.
>
> This part of the bug is harder to solve, because some code needs to be
> implemented that will defer deletion until the process exits. So it
> is not solved yet.
Should be fixed now (revision 11244 on the trunk). I was able to run
your test case multiple times without any errors, and after that,
there were no left-over temporary files in the temporary directory.
prev parent reply other threads:[~2012-12-15 13:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 8:03 bug#13079: 24.3.50; Emacs cannot create subprocess Li Zhai
2012-12-04 20:23 ` Eli Zaretskii
2012-12-05 2:26 ` Li Zhai
2012-12-05 17:29 ` Eli Zaretskii
2012-12-06 1:58 ` Li Zhai
2012-12-06 3:54 ` Eli Zaretskii
2012-12-06 8:18 ` Li Zhai
2012-12-06 19:04 ` Eli Zaretskii
2012-12-15 13:41 ` Eli Zaretskii [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=83fw37mnze.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=13079-done@debbugs.gnu.org \
--cc=mrzhaili@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).