Subject: Re: bug#9264: 24.0.50; (file-error "Creating process pipe" "no error")

From: Eli Zaretskii <[email-masked]>
Date: Thu, 11 Aug 2011 00:44:44 -0400

> From: William Xu <[email-masked]>
> Date: Thu, 11 Aug 2011 12:05:28 +0800
> 
> === modified file 'src/w32.c'
> --- src/w32.c	2011-07-09 07:00:58 +0000
> +++ src/w32.c	2011-08-10 01:26:51 +0000
> @@ -5218,6 +5218,7 @@
>       pipes into binary mode; we will do text mode translation ourselves
>       if required.  */
>    rc = _pipe (phandles, 0, _O_NOINHERIT | _O_BINARY);
> +  printf("xwl: error = %d\n", GetLastError ());
> 
>    if (rc == 0)
>      {
> 
> In gdb, the error number printed is always zero, even when this
> file-error comes up.  But it seems it would first give this error: 
> 
>   (file-error "Spawning child process" "resource temporarily unavailable")
> 
> After a while, starts to give following error: 
> 
>   (file-error "Creating process pipe" "no error")
> 
> Is it reaching some process number limit? 

Not sure yet, but it sounds unlikely (the limit is on simultaneous
processes).  Do you see the value of rc becoming negative at some
point?  If so, does _pipe return a negative value, or does it become
negative in this fragment below the call to _pipe?

      if (phandles[0] >= MAXDESC || phandles[1] >= MAXDESC)
	{
	  _close (phandles[0]);
	  _close (phandles[1]);
	  rc = -1;
	}

If the latter, it sounds like we are not closing the file handles
somewhere.

>    > In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600)
>    >  of 2011-06-28 on 3249CTO
> 
>    This is quite old, suggest to update to a newer version, to avoid
>    wasting energy on an old bug that was already fixed.

That's a good clue, thanks.  I will try to look into the changes since
then.