]> git.eshelyaron.com Git - emacs.git/commitdiff
* sysdep.c (get_child_status): Abort on internal error (Bug#13086).
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 7 Dec 2012 17:53:17 +0000 (09:53 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 7 Dec 2012 17:53:17 +0000 (09:53 -0800)
This will cause a production Emacs to dump core instead of
infinite-looping.

src/ChangeLog
src/sysdep.c

index a8be140ca0eab2ce463fcebb4f00e9f808f5d1d5..edd6924af503b9bd1f9049cf40445a3b777e5b78 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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  <dmantipov@yandex.ru>
 
        * frame.c (make_frame): Do not set window's buffer to t.
index 7068a4f0977a3a04ca38bb1b3a9037b805d4e7e4..9c904850401395a5d168a0d23e672020fc5082fe 100644 (file)
@@ -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.  */