Enlightenment locks when killing children



I have been running enlightenment (from anoncvs.gimp.org:/cvs/gnome) as
my windowmanager under a gnome-session. I have a redhat 5.2 system.

I have been able consistently to lock up E when closing an xterm started
from the enlightenment terminal button (YMMV). When I added the following
patch I found that the select() call returns due to an "interrupted system
call error" - presumably due to receiving a SIGCHLD, though I haven't
checked this. Anyway, when this happens the bits in the mask are not
cleared, so it is necessary to check for a negative return value before
checking the individual file descriptors. Otherwise a blocking read()
will occur in ProcessICEMSGS().

diff -U4 -r e-old/src/events.c e/src/events.c
--- e-old/src/events.c	Mon Dec 28 19:58:09 1998
+++ e/src/events.c	Tue Dec 29 13:15:10 1998
@@ -1,5 +1,6 @@
 #include "E.h"
+#include <errno.h>
 
 HandleStruct        HArray[] =
 {
    {DefaultFunc},
@@ -222,9 +223,8 @@
    time2 -= time1;
    if (time2 < 0.0)
       time2 = 0.0;
    /* time2 = time spent since we last were here */
-   count = 0;
    fflush(stdout);
    fflush(stderr);
    while (XPending(disp))
      {
@@ -258,12 +258,22 @@
 	     qe->in_time = time1;
 	  }
 	tval.tv_sec = (long)time1;
 	tval.tv_usec = (long)((time1 - ((double)tval.tv_sec)) * 1000000);
-	select(sizeof(fdset) * 8, &fdset, NULL, NULL, &tval);
+	count = select(sizeof(fdset) * 8, &fdset, NULL, NULL, &tval);
      }
    else
-      select(sizeof(fdset) * 8, &fdset, NULL, NULL, NULL);
+      count = select(sizeof(fdset) * 8, &fdset, NULL, NULL, NULL);
+   if (count < 0)
+     {
+       if (errno == EINTR)
+	 fprintf(stderr, "Enlightenment: select() returns due to "
+		 "interrupted system call\n");
+       else
+	 fprintf(stderr, "Enlightenment: select() returns due to "
+		 "error %d\n", errno);
+       EDBUG_RETURN_;
+     }
    if (GetSMfd() >= 0)
      {
 	if (FD_ISSET(GetSMfd(), &fdset))
 	   ProcessICEMSGS();

--
Peter Wainwright
Home: prw@wainpr.demon.co.uk   Work: peter.wainwright@nrpb.org.uk
http://www.wainpr.demon.co.uk
Visit the Opera Exchange Homepage at http://www.treda.co.uk/opex/



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