GNU bug report logs - #13079
24.3.50; Emacs cannot create subprocess

Previous Next

Package: emacs;

Reported by: Li Zhai <mrzhaili <at> gmail.com>

Date: Tue, 4 Dec 2012 10:17:02 UTC

Severity: normal

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 13079-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: mrzhaili <at> gmail.com
Cc: 13079-done <at> debbugs.gnu.org
Subject: Re: bug#13079: 24.3.50; Emacs cannot create subprocess
Date: Sat, 15 Dec 2012 15:41:41 +0200
> Date: Wed, 05 Dec 2012 19:29:58 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 13079 <at> 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.




This bug report was last modified 12 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.