From: Paul Eggert Date: Fri, 7 Dec 2012 17:53:17 +0000 (-0800) Subject: * sysdep.c (get_child_status): Abort on internal error (Bug#13086). X-Git-Tag: emacs-24.3.90~173^2~9^2~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9cdde1e2dfdd7b1a4e52294bca1467dc7a48c77a;p=emacs.git * sysdep.c (get_child_status): Abort on internal error (Bug#13086). This will cause a production Emacs to dump core instead of infinite-looping. --- diff --git a/src/ChangeLog b/src/ChangeLog index a8be140ca0e..edd6924af50 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-07 Paul Eggert + + * sysdep.c (get_child_status): Abort on internal error (Bug#13086). + This will cause a production Emacs to dump core instead of + infinite-looping. + 2012-12-07 Dmitry Antipov * frame.c (make_frame): Do not set window's buffer to t. diff --git a/src/sysdep.c b/src/sysdep.c index 7068a4f0977..9c904850401 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -289,9 +289,12 @@ get_child_status (pid_t child, int *status, int options, bool interruptible) while ((pid = waitpid (child, status, options)) < 0) { - /* CHILD must be a child process that has not been reaped, and - STATUS and OPTIONS must be valid. */ - eassert (errno == EINTR); + /* Check that CHILD is a child process that has not been reaped, + and that STATUS and OPTIONS are valid. Otherwise abort, + as continuing after this internal error could cause Emacs to + become confused and kill innocent-victim processes. */ + if (errno != EINTR) + emacs_abort (); /* Note: the MS-Windows emulation of waitpid calls QUIT internally. */