Problems with XOpenDisplay

Urs Hoelzle urs at cs.stanford.edu
Wed Aug 25 17:10:56 UTC 1993


Here's what our current VM does (in xlibPrims.c):

  Display* XOpenDisplay_wrap(char *name, void *FH) {
    // XOpenDisplay fails if a signal is received during the call.
    // All signals except user interrupts are therefore blocked. 
    SignalBlocker sb(true);
    
    Display* result = XOpenDisplay(name);
    if (result == 0)  {
      prim_failure(FH, PRIMITIVEFAILEDERROR);
      return result;
    }

    XSetErrorHandler(xErrorHandler);
    XSetIOErrorHandler(xIOErrorHandler);

    // add this file descriptor to list of all open files
    FD_SET(ConnectionNumber(result), &activeFDs);
    return result;
  }

The SignalBlocker blocks all signals except user interrupts (see
abort.h) (yes, we're using SIGVTALARM and SIGIO as well).

This definitely improves things, but sometimes it still fails.  Don't
ask me why.

-Urs




More information about the Self-interest mailing list