emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

busyloop in sigchld_handler


From: Sam Steingold
Subject: busyloop in sigchld_handler
Date: Sun, 11 Mar 2007 14:33:29 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

GNU Emacs 22.0.95.2 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of
2007-03-11 on loiso

I have been observing the following behavior:
emacs hangs in sigchld_handler waiting for the child process to
terminate:

      do
        {
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }
      while (pid < 0 && errno == EINTR);

the system stops responding, loadavg goes to 5-8(!), CPU is 100% busy.
this lasts for ~10 seconds.
this happens on M-c compile and when I click on a URL (it is passed to
an existing Firefox).

I fixed the problem with the following patch:

Index: process.c
===================================================================
RCS file: /sources/emacs/emacs/src/process.c,v
retrieving revision 1.500
retrieving revision 1.501
diff -u -w -u -b -w -i -B -r1.500 -r1.501
--- process.c   1 Mar 2007 10:17:41 -0000       1.500
+++ process.c   11 Mar 2007 18:16:50 -0000      1.501
@@ -6497,6 +6497,7 @@
       /* Keep trying to get a status until we get a definitive result.  */
       do
        {
+          sleep (1);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }


Thanks.

-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 6 (Zod)
http://ffii.org http://pmw.org.il http://palestinefacts.org
http://iris.org.il http://mideasttruth.com http://truepeace.org
Old Age Comes at a Bad Time.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]