[comp.windows.x] Why do weird X errors go away after XSynchronize

mickey@altos86.Altos.COM (Michael Thompson) (03/14/90)

I have ported R4 (patch 5) to a Sys V.3.1 based 80386 machine. This
machine has only tty interfaces and Lachman TCP/IP 3.1, so all X clients 
must connect to X-terminals.  Most x-clients that I have tested work
fine, but I am having bizzare problems with a couple of them. 

When these clients (xfig and xstdcmap) start, they initialize most of
their windows before exiting because of (seemingly random) X-protocol
errors (see list below). This happens whether or not I am running a
window manager and it happens before I touch the keyboard or the mouse.

The really weird thing is that if I turn on XSynchronize, the problem goes
away! Specifically, with xfig if I turn XSynchronize back off after
the canvas and panel are initialized it works fine and is stable.

I have tried this against 3 different types of X-terminals (all R3 based)
with the same results, so I suspect that the problem is in Xlib or lower
levels. My port of Xlib uses sockets not TLI.

Here is a list of some of the errors I get when xfig runs asynchronously:

    # ./xfig
    Initializing FIG v2.0 Protocol v1.4X (X11 patchlevel 3) ... 
    X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
      Major opcode of failed request:  72 (X_PutImage)
      Minor opcode of failed request:  0
      Resource id in failed request:  0x50015d
      Serial number of failed request:  677
      Current serial number in output stream:  1503
    # ./xfig
    Initializing FIG v2.0 Protocol v1.4X (X11 patchlevel 3) ... 
    X Error of failed request:  BadRequest (invalid request code or no such operation)
      Major opcode of failed request:  0 ()
      Minor opcode of failed request:  0
      Resource id in failed request:  0x500087
      Serial number of failed request:  677
      Current serial number in output stream:  1503
    # ./xfig
    Initializing FIG v2.0 Protocol v1.4X (X11 patchlevel 3) ... 
    X Error of failed request:  BadGC (invalid GC parameter)
      Major opcode of failed request:  60 (X_FreeGC)
      Minor opcode of failed request:  0
      Resource id in failed request:  0x500246
      Serial number of failed request:  733
      Current serial number in output stream:  1503
    # ./xfig
    Initializing FIG v2.0 Protocol v1.4X (X11 patchlevel 3) ... 
    X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
      Major opcode of failed request:  55 (X_CreateGC)
      Minor opcode of failed request:  0
      Resource id in failed request:  0x50014b
      Serial number of failed request:  677
      Current serial number in output stream:  1503
    # ./xfig
    Initializing FIG v2.0 Protocol v1.4X (X11 patchlevel 3) ... 
    X Error of failed request:  BadGC (invalid GC parameter)
      Major opcode of failed request:  60 (X_FreeGC)
      Minor opcode of failed request:  0
      Resource id in failed request:  0x5001ae
      Serial number of failed request:  677
      Current serial number in output stream:  1503

These errors do not occur if xfig runs synchronously.  This means it is
probably not an xfig problem (so does the fact that it also happens with
xstdcmap). Could this possibly be TCP/IP related?  Any ideas on how I
might find this problem or where I can look? *Any* suggestions
would be appreciated!

(R4 (patchlevel 5) applications and libraries compiled with gcc 1.37.0.)

					thanks,

					-Michael
					mickey@altos.Altos.COM