Subject: bug#13086: 24.2.50; Emacs seems to hang at w32proc.c:1126

From: Paul Eggert <[email-masked]>
Date: Wed, 05 Dec 2012 21:07:33 -0800

On 12/05/2012 07:51 PM, Eli Zaretskii wrote:
> My reading of this, and specifically of the last sentence under
> "RETURN VALUE", is that errno could also be ECHILD.

Yes, waitpid can return -1 with errno == ECHILD, just as
it can return -1 with errno == EINVAL.  But if Emacs is
invoking waitpid that way, then Emacs has a bug.

Emacs cannot invoke waitpid on any argument such that waitpid
could return -1 with errno == ECHILD, because if it does so
it will allow race conditions such as the races that led to
Bug#8855.

> inflooping in that case is hardly a Good Thing, is it?
> And neither is aborting when asserts are enabled.  Perhaps signaling
> an error would be better.

If we can't fix the bug, perhaps signaling an error is the
best we can do, but I'd rather fix the bug.  Generally speaking,
if there's an internal programming error, Emacs aborts
rather than signaling an error.