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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 Dec 2012 22:48:52 +0200

> Date: Thu, 06 Dec 2012 22:39:33 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> > Date: Thu, 06 Dec 2012 12:36:05 -0800
> > From: Paul Eggert <[email-masked]>
> > CC: [email-masked], [email-masked]
> > 
> > On 12/06/12 12:25, Eli Zaretskii wrote:
> >  
> > > How can that happen, if PID is not our child process?
> > 
> > Because Emacs regularly kills processes that it thinks are its
> > children.  If I'm running several applications, one of them
> > can kill the other even if the applications are otherwise
> > unrelated -- that's standard Unix semantics.  So if
> > Emacs mistakenly thinks that it has a child with PID 1234
> > and does the equivalent of "kill -9 1234", which is something
> > that delete-process does, Emacs can kill an innocent and
> > unrelated victim.
> 
> But that already happened when we are calling waitpid.  It cannot be
> helped at that point.
> 
> > >> One possibility is for Emacs to fall back into recovery mode
> > > 
> > > It is much easier to remove the offending process object from the list
> > > of those we expect to be dead.
> > 
> > Sure, but there's a good case for being cautious here, even if
> > it's a bit harder to be cautious.
> 
> It doesn't make sense to be that cautious in an Emacs compiled without
> assertions.

Just to make sure I'm clear: I'm saying that inflooping in these cases
will help nothing.  And that is exactly what we will do in an build
without assertions, if waitpid returns ECHILD.  That simply makes no
sense at all.