[Xcb] RRGetScreenInfo bad extra len 32 != 48

Barton C Massey bart at cs.pdx.edu
Fri May 22 00:05:49 PDT 2009


I can confirm that running your code crashes my X server
also. :-) This is most likely a malformed Xrandr request
issued by XCB due to a protocol description bug.  I've filed
bug #21861 (https://bugs.freedesktop.org/show_bug.cgi?id=21861);
please add your comments.

Thanks much for the bug report.

	Bart

In message <4A15E09B.6000604 at gmail.com> you wrote:
> Hi all,
> 
> I am new to xcb programming. Here is the piece of code that causes this 
> fatal error :
> 
>          xcb_randr_get_screen_info_cookie_t cookie2 = 
> xcb_randr_get_screen_info(server,root);
>          xcb_randr_get_screen_info_reply_t *reply2 = 
> xcb_randr_get_screen_info_reply(server,cookie2,0);
> 
>          j = xcb_randr_get_screen_info_sizes_length(reply2);
> 
>          printf("Number of screens = %d\n",j);
> 
> which is part of the bigger code :
> 
> #include <xcb/xcb.h>
> #include <xcb/randr.h>
> #include <stdlib.h>
> #include <stdio.h>
> 
> /*
>   * to be compiled with -lxcb -lxcb-randr
>   */
> 
> int main()
> {
>          xcb_screen_t *screen;
>          int i;
>          xcb_window_t root;
>          xcb_connection_t *server  = xcb_connect(0,&i);
> 
>          printf("Default screen : %d\n",i);
> 
>          int j = 0;
> 
>          xcb_screen_iterator_t iter = 
> xcb_setup_roots_iterator(xcb_get_setup(server));
> 
>          for( ; iter.rem ; xcb_screen_next(&iter),j++ )
>          {
>                  screen = iter.data;
>                  printf("Monitor number %d :\n",j);
>                  printf("Width = %d\n",screen->width_in_pixels);
>                  printf("Height = %d\n",screen->height_in_pixels);
>                  if ( j == i ) { root = screen->root; }
>          }
>          printf("Root window has ID %d\n",root);
> 
>          printf("\nRandR extension :\n");
> 
>          xcb_randr_query_version_cookie_t cookie1 = 
> xcb_randr_query_version(server,0,0);
>          xcb_randr_query_version_reply_t *reply1 = 
> xcb_randr_query_version_reply(server,cookie1,0);
>          printf("Version 
> %d.%d\n",reply1->major_version,reply1->minor_version);
>          free(reply1);
> 
>          /*
>          xcb_randr_get_screen_info_cookie_t cookie2 = 
> xcb_randr_get_screen_info(server,root);
>          xcb_randr_get_screen_info_reply_t *reply2 = 
> xcb_randr_get_screen_info_reply(server,cookie2,0);
> 
>          j = xcb_randr_get_screen_info_sizes_length(reply2);
> 
>          printf("Number of screens = %d\n",j);
>          */
> 
>          xcb_disconnect(server);
> 
>          return 0;
> }
> 
> 
> When executing this code the X server stops suddenly with the following 
> message :
> 
> Fatal server error:
> RRGetScreenInfo bad extra len 32 != 48
> 
> I am new with xcb and I have found no doc about randr and xcb so can you 
> explain me what is wrong with my code and/or where I can find doc about 
> xcb-randr.
> 
> Thanks
> 
> -- 
> Kind regards
> Guillaume Quintin
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb


More information about the Xcb mailing list