Subject: bug#14297: 24.3.50; emacs subprocesses don't exit on "exit"

From: Paul Eggert <[email-masked]>
Date: Sun, 12 May 2013 21:38:55 -0700

> It's pretty non intuitive, how failure of
> (process-live-p proc) is connected to window toolkit?

The problem is that Gtk creates subprocesses in its own thread,
and the Emacs main thread (until recently) mistakenly reaped these
subprocesses with waitpid (-1, ...).  See:

https://bugzilla.gnome.org/show_bug.cgi?id=687075#c2
http://bugs.gnu.org/8855
http://bugs.gnu.org/9627
http://bugs.gnu.org/12980

Fixing this Emacs bug required changing how Emacs waited for children;
it no longer does a waitpid (-1, ...), but always does a waitpid
for children that it knows about.

Given the discussion in
<https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/1142213>
it appears that the bug is in something other than Emacs proper,
and affects other programs.  But if it is just an Emacs thing,
perhaps you can reproduce it with 'strace -o trace.txt -f emacs'
and then we could look at the trace of the part where Emacs
tries to wait for its child process to finish.