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

From: Paul Eggert <[email-masked]>
Date: Wed, 05 Dec 2012 18:04:04 -0800

On 12/05/2012 01:25 PM, Eli Zaretskii wrote:
> Paul, can you tell why it loops if waitpid is called with WNOHANG and
> returns -1?  Won't that cause a busy-wait loop that pegs the CPU?

If waitpid is called with WNOHANG and returns -1, then
errno must equal EINTR.  (There's an assertion for this.)
Since the wait was interrupted by a signal, it's supposed
to be retried.

Presumably Emacs is confused, and is waiting for a process
that it already waited for.  That's a bug and we should fix it.
I can't tell from the info so far whether the bug is in
the w32 implementation of waitpid, or in Emacs proper.

Was this emacs compiled with error-checking turned on
(./configure --enable-checking, or whatever equivalent is
use in the Microsoft Windows world)?
If so, I'm puzzled as to why the 'eassert (errno == EINTR)'
didn't fire.  If not, can you reproduce the bug with
error-checking enabled?