[Xcb] Re: Problem with XCBImagePut

Jamey Sharp jamey at minilop.net
Tue Jun 6 23:12:14 PDT 2006


On Tue, Jun 06, 2006 at 09:47:33PM -0600, Orhun Birsoy wrote:
> And my application exits with the following output while increasing the 
> size of the window. Note that I used XCBPutImage (not XCBImagePut) so I 
> guess if there is problem its in XCBPutImage not in image utility.
> 
> sequence : 40 with Image size : 987,969
> sequence : 42 with Image size : 1002,985
> sequence : 44 with Image size : 1017,1002
> sequence : 0 with Image size : 1043,1030
> pollForEventError : -1
> 
> I guess  returning sequence 0 means some kind of request failure. But 
> what? How can I determine what is actually failing?

Yup, sequence 0 means "we couldn't send your request to the server", but
doesn't tell you more than that. However there are only three ways it
can fail:

 - If the request is not part of the core protocol but rather comes from
   an extension, and the server does not support the extension.
 - If the length of the request is greater than the maximum request
   length from the connection setup reply (max 256kB) or from the
   BIG-REQUESTS 'Enable' reply (max 16GB) if that's supported.
 - If the 'select' or 'writev' system calls fail. I don't think this can
   happen in practice unless the connection closes.

#1 can't be the problem here because PutImage is part of the core
protocol. #2 seems unlikely since you say that your server has
BIG-REQUESTS and you're only trying to send about 4MB of image data. So
#3 seems most likely, though I don't know why the connection is closing.

You can confirm or rule out #2 by checking the value returned from
XCBGetMaximumRequestLength: if it's around four million, then #2 is your
problem; if it's much higher, #3 is your problem.

As a general note, #1 can be checked for before issuing the request: if
the request is XCBFooBar, then check:
  const XCBQueryExtensionRep *ext = XCBGetExtensionData(conn, &XCBFooId);
If ext is non-null and ext->present is true, then the request won't fail
for this reason (though it might still fail for the other reasons).

In conclusion I think your X connection is closing before or while you
issue that request, but I don't know why. If you can confirm or reject
that hypothesis then maybe we can get further.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060606/32c350a7/attachment.pgp


More information about the Xcb mailing list