[Xcb] segfault in XCBConnSetupSuccessRepRootsIter

Jeremy A. Kolb jkolb at brandeis.edu
Sun Nov 7 14:24:13 PST 2004


I took the program posted a few days ago because I want to learn how to 
use XCB.  It's the one about drawing the black point.  Anyways, I was just 
changing things around and recompiling and running it, adding events and 
what not and now all of a sudden I get a segfault when trying to run the 
program.  I restarted X but I still get it.  Here's a snippet of code:

int main(int argc, char *argv[])
      8 {
      9     XCBConnection       *c;
     10     XCBSCREEN           *root;
     11     XCBDRAWABLE         draw;
     12     XCBDRAWABLE         p;
     13     XCBGCONTEXT         black;
     14     XCBPOINT            point = {100, 100};
     15     XCBGenericEvent     *e;
     16     CARD32              mask = 0;
     17     CARD32              values[6];
     18 
     19     root = XCBConnSetupSuccessRepRootsIter(c->setup).data;

If the segfault is on the last line.I have a backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x40029979 in XCBConnSetupSuccessRepVendorEnd (R=0x10eb18) at 
xcb_types.c:620
620         i.data = ((char *) (R + 1)) + (R->vendor_len);
(gdb) bt
#0  0x40029979 in XCBConnSetupSuccessRepVendorEnd (R=0x10eb18)
    at xcb_types.c:620
#1  0x40029a1a in XCBConnSetupSuccessRepPixmapFormatsIter (R=0x10eb18)
    at xcb_types.c:640
#2  0x40029a94 in XCBConnSetupSuccessRepRootsIter (R=0x10eb18)
    at xcb_types.c:655
#3  0x080484fe in main (argc=1, argv=0xbffff784) at main.c:19

I'm sure it's something simple that i played with but I can't find the 
cause (i don't know xcb well at all).

Jeremy



More information about the xcb mailing list