[Xcb] [Bug 68387] xinput2 XIQueryDevice reply not read correctly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 22 11:51:32 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=68387

--- Comment #6 from Ran Benita <ran234 at gmail.com> ---
(In reply to comment #5)
> (In reply to comment #3)
> > For example,
> > I'm pretty sure xcb_get_setup() is broken when there is more than one Screen
> > (roots_len > 1) - in this case the attached program should show garbage.
> 
> Nope, works fine here. I tested this against "Xephyr -screen 1000x500
> -screen 500x500 :1" and diff't the output for the two screens. Only IDs were
> different (e.g. the visual IDs).
> 
> What exactly would you expect to go wrong and why does it still work
> correctly?

Thanks for trying, I didn't know about this Xephyr trick. And you're right;
while xcb_screen_sizeof() uses xcb_tmp, it doesn't in fact increment it twice:

    xcb_block_len += sizeof(xcb_screen_t);
    xcb_tmp += xcb_block_len;
    /* allowed_depths */
    for(i=0; i<_aux->allowed_depths_len; i++) {
        xcb_tmp_len = xcb_depth_sizeof(xcb_tmp);
        xcb_block_len += xcb_tmp_len;
        xcb_tmp += xcb_tmp_len;
    }

i.e in this case the struct and the depths are considered in the same 'block'
(intended or not...). By looking, there aren't any iterator bugs in xproto to
show off :) like in xinput and xkb.

However to 'compensate', xcb_setup_sizeof() is definitely broken, e.g. on my
machine, should be: 5972, reported: 6284. To see this you can add
   printf("offset: %ld\n", (char *) visuals_iter.data - (char *) setup);
right after
   xcb_visualtype_next(&visuals_iter);
and look at the last offset. With the patch the reported sizeof is correct.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20130822/c7cd35f6/attachment.html>


More information about the Xcb mailing list