[comp.windows.x] Weirdness in the R3 Xsun server? XIO Errors

red@litp.UUCP (Renaud DUMEUR) (03/21/89)

I think I know what produces this bug. I've got the same error while
running an application involving a *lot* (more than 30) of windows. It
happens on both Sun 3/50 (running sunOS 3.5) and Sun 386i (running
sunOS 4.0).

The problem comes from the routine FlushClient in
X/server/os/4.2bsd/io.c . This routine writes some buffers to the
client by using `writev'. If the client is not reading the pipe,
`writev' returns an invalid count and sets `errno' to EWOULDBLOCK, if
`errno' has a different value the connection is closed by the server
(on the other side, the client breaks in XIOError).

The bug comes from the fact `errno' is sometimes set by `writev' to
EINVAL. This occurs randomly and seems to depends on the
number of requests.  I have not seen in the sources any obvious
explaination for this bug, but if you find something else, please, let
me know your diagnosis!

The only thing I have done to avoid this indesirable behavior, was to
identify the EINVAL case to the EWOULDBLOCK one. But I wish to know
if the bug comes from X (bad args to `writev') or sunOS (bad
settings of `errno').


				Renaud