[cairo] valgrind complaint

Benjamin Otte in7y118 at public.uni-hamburg.de
Tue Jan 30 14:15:42 PST 2007


Here's the full log:
==31387== Source and destination overlap in memcpy(0x47F4608, 0x47F4608,
48)
==31387==    at 0xFFBD9B0: memcpy (mac_replace_strmem.c:394)
==31387==    by 0xF686F5C: _cairo_surface_clone_similar (cairo-surface.c:1028)
==31387==    by 0xF691C6C: _cairo_pattern_acquire_surface_for_surface (cairo-pattern.c:1203)
==31387==    by 0xF691F94: _cairo_pattern_acquire_surface (cairo-pattern.c:1301)
==31387==    by 0xF6BF820: _cairo_xlib_surface_composite_trapezoids (cairo-xlib-surface.c:1569)
==31387==    by 0xF687F5C: _cairo_surface_composite_trapezoids (cairo-surface.c:1459)
==31387==    by 0xF68A408: _composite_traps_draw_func (cairo-surface-fallback.c:492)
==31387==    by 0xF689F30: _clip_and_composite (cairo-surface-fallback.c:391)
==31387==    by 0xF68A8E0: _clip_and_composite_trapezoids (cairo-surface-fallback.c:644)
==31387==    by 0xF68B06C: _cairo_surface_fallback_fill (cairo-surface-fallback.c:836)
==31387==    by 0xF687DDC: _cairo_surface_fill (cairo-surface.c:1419)
==31387==    by 0xF6723A8: _cairo_gstate_fill (cairo-gstate.c:994)

And my code checks so I'm sure that no error is reported. That's all I
know at this point. If you want to reproduce, I've used swfdec git
(actually the interpreter branch, but that shouldn't matter) on
http://www.layoutgalaxy.com/html/images/n45images/speedball.swf
and just let it start up. When the first image appears, you'll have the
error.

Benjamin


On Tue, 30 Jan 2007, Behdad Esfahbod wrote:

> On Tue, 2007-01-30 at 09:08 -0500, Benjamin Otte wrote:
> > Hi,
> >
> > I've just had valgrind complain to me about "Source and destination
> > overlap in memcpy" (on PPC btw). I'm not sure if this is a bug in
> > cairo
> > or if it's gcc's fault. I'll attach a patch for you.
>
> Is this happening with nil surfaces?  Otherwise I can't imagine why the
> clone may have the same address of src.
>
> It's probably the case that glibc's version of memcpy correctly handles
> some kinds of overlaps (say, where src and dst are equal), and gcc is
> relying on that.
>
> > Benjamin
> >
> --
> behdad
> http://behdad.org/
>
> "Those who would give up Essential Liberty to purchase a little
>  Temporary Safety, deserve neither Liberty nor Safety."
>         -- Benjamin Franklin, 1759
>
>
>
>



More information about the cairo mailing list