[vm][unix][bug][fix][OSProcess] Bad file descriptor bug when decapitating/recapitating the squeak display

David T. Lewis lewis at mail.msen.com
Thu Feb 14 12:54:47 UTC 2002


On Thu, Feb 14, 2002 at 01:14:24AM -0500, Stephen Pair wrote:
> The Bug: Using OSProcess to decapitate and recapitate a display will
> often cause a multitude of "select: Bad file descriptor" errors.  Also,
> socket serving becomes un-reliable after encountering these errors.
 
Wow, somebody is actually using the "recapicate" hack? cool. Just out
of curiosity, what are you using it for (a headless Swiki perhaps)?

> The attached solution solves the issue by adding a call to
> aioStopHandling() from forgetXDisplay() (in sqXWindow.c).  This stops
> the VM from attempting to poll the (now closed) file descriptor
> associated with the X display.
> 
> This change is based on the sourceforge VM sources.  How does one go
> about getting it checked into SF?
> 
> - Stephen

I don't seem to have the exact version of sqXWindow.c that you are
starting with, but assuming that this is a one line addition to the
file, the right thing to do would be:

1) Make a context diff of the change (diff -c oldFile newFile > diffFile).

2) Send the context diff directly to Ian so he has an opportunity to
include it in the one true sqXWindow.c.

3) Ask Lex to apply the patch on SourceForge. He's the last person to
have updated that file, so it would be best if he could do the deed.

Good catch, thanks!

Assuming it's a one-liner, the context diff should look something
like this:

*** sqXWindow.c.sourceForge     Thu Feb 14 08:36:00 2002
--- sqXWindow.c Thu Feb 14 07:57:07 2002
***************
*** 548,555 ****

    displayName= 0;       /* name of display, or 0 for $DISPLAY   */
    stDisplay= null;      /* Squeak display                       */
!   if (isConnectedToXServer)
      close(stXfd);
    stXfd= 0;             /* X connection file descriptor         */
    stParent= null;
    stWindow= null;       /* Squeak window                        */
--- 548,557 ----

    displayName= 0;       /* name of display, or 0 for $DISPLAY   */
    stDisplay= null;      /* Squeak display                       */
!   if (isConnectedToXServer) {
!     aioStopHandling(stXfd);
      close(stXfd);
+   }
    stXfd= 0;             /* X connection file descriptor         */
    stParent= null;
    stWindow= null;       /* Squeak window                        */




More information about the Squeak-dev mailing list