Subject: bug#13079: 24.3.50; Emacs cannot create subprocess

From: Li Zhai <[email-masked]>
Date: Wed, 5 Dec 2012 10:26:51 +0800

Sorry. I'll explain more clear. I'm using emacs under windows 7.

I mean, emacs display the messages before the loop ends. And all the
processes are gone, emacs did not wait them to exit.

I've tried two different version from
http://ftp.gnu.org/gnu/emacs/windows/emacs-23.4-bin-i386.zip and
http://alpha.gnu.org/gnu/emacs/windows/emacs-20120917-r110062-bin-i386.zip

Here is how to reproduce the bug:

1. Open the emacs using ``emacs -Q''

2. paste the code into *scratch* buffer:

  (progn
   (dotimes (i 35)
     (call-process-region (point-min) (point-min) "ddeclient" t 0 nil
 "SUMATRA" "control")
     (message "%d" i)))

the *ONLY* difference between the previous code is I increase the
repeat times to call the function `call-process-region'. Here is 35
times, you could try to increase the number lager if the bug not
reproducing.

3. Eval the code using C-x C-e

4. You should see the emacs report an error:

Debugger entered--Lisp error: (file-error "Spawning child process"
"resource temporarily unavailable")

5. Quit the elisp debugger and execute the code again(press C-x C-e),
this time emacs should report:

Debugger entered--Lisp error: (file-error "Opening output file"
"permission denied" "c:/Users/iot003/Desktop/emacs-24.2.50/bin")
  call-process-region(1 1 "ddeclient" t 0 nil "SUMATRA" "control")

6. Quit the elisp debugger. This time, emacs cannot create any
sub-process any more. Try to execute a shell command by press `M-!
ls', you will find it out.

This problem occurred more often on my private build version. I guess
the problem is the default stack size assigned by compiler is too
small.

Thanks for your reply, Eli. Have a good day.

On Wed, Dec 5, 2012 at 4:23 AM, Eli Zaretskii <[email-masked]> wrote:
>> Date: Tue, 4 Dec 2012 16:03:56 +0800
>> From: Li Zhai <[email-masked]>
>>
>> I've noticed emacs cannot create subprocess in some cases:
>>
>>  (progn
>>   (dotimes (i 25)
>>     (call-process-region (point-min) (point-min) "ddeclient" t 0 nil
>> "SUMATRA" "control")
>>     (message "%d" i)))
>>
>> After executed above codes, emacs report:
>>
>> "Spawning child process" "resource temporarily unavailable"
>
> I cannot reproduce this here.  Does this happen in "emacs -Q"?
> Also, what do you mean "after executing"?  Does it mean Emacs displays
> this message before it ends the loop, i.e. before it launches 25
> processes?  Or do you mean that after all the 25 processes are
> launched, Emacs cannot start more subprocesses?  If the latter, does
> the problem go away after you wait for all the 25 ddeclient
> subprocesses to exit?