[cairo] Re: Using --sync and gdb to debug X protocol errors in GTK+-based programs

Nigel Tao nigel.tao at myrealbox.com
Thu Jun 23 23:26:51 PDT 2005


> Things have obviously gone wrong before this (note the negative offsets):

Indeed, with current cvs of cairo, I get (like previously reported)
#10 0xb7b36188 in _fallback_composite (operator=3221220240,
src=0xbfffeb90,
    mask=0xbfffeb90, dst=0xbfffeb90, src_x=-1073747056,
src_y=-1073747056,
    mask_x=-1073747056, mask_y=-1073747056, dst_x=0, dst_y=0, width=200,
    height=10) at cairo-surface.c:490

But if I add
printf("Apparently, src_x=%d\n", src_x);
to the start of _fallback_composite in cairo-surface.c
it does indeed print out (exactly once before dying)

Apparently, src_x=30

and the backtrace now looks more sensible (for src_x, but still not for
src_y)

#10 0xb7b361de in _fallback_composite (operator=3221220224,
src=0xbfffeb80,
    mask=0xbfffeb80, dst=0xbfffeb80, src_x=30, src_y=-1073747072,
    mask_x=-1073747072, mask_y=-1073747072, dst_x=0, dst_y=0, width=200,
    height=10) at cairo-surface.c:491


Are the incorrectly reported arguments in the backtrace due to a
compiler optimization?  And if so, is there some way to disable that
when make'ing cairo, so that I can get a more reliable backtrace?

gcc (GCC) 3.3.5 (Debian 1:3.3.5-8ubuntu2)
GNU gdb 6.3-debian


> It'd be nice to be able to poke around a system exhibiting this, so if
> we can figure out how to replicate it that would be quite helpful.

Nobody else has been able to replicate this?  I don't think I've messed
around that much with my Ubuntu 5.04 system (I'm running hoary=stable,
not breezy=unstable), apart from the dozens of -devel packages I've had
to install.


Nigel.




More information about the cairo mailing list