Jérémy Bobbio wrote:
> On Sat, Oct 07, 2006 at 03:40:43PM -0700, Dave Beckett wrote:
>>> I can reproduce this bug.  I also tried to build pan against a libcairo2
>>> with the patch presented in #383034 and it still crash.
>>>
>>> The backtrace is totally unhelpfull, though. :(
>> I agree it isn't.  It must have been corrupted before you got
>> the crash.  Maybe try duplicating the crash inside valgrind
>> where it might report where the corruption happened.
>>
>> There is a feeling that this kind of thing might be related
>> to the fonts in use which is why it's hard to duplicate. pan
>> works for me just fine local and remove via a powerpc X server.
> 
> Attached you will find the output of strace and valgrind on my system
> (PowerPC).
> 
> They are not enlightening, though.

Yes it is, since the faults are happening somewhere where there's
a fix for it in upstream GIT sources:

> ==19140== Invalid read of size 1
> ==19140==    at 0xF7DC9BC: _cairo_xlib_surface_add_glyph 
> (cairo-xlib-surface.c:2455)
> ==19140==    by 0xF7DD464: _cairo_xlib_surface_show_glyphs 
> (cairo-xlib-surface.c:2824)
> ==19140==    by 0xF7BDF84: _cairo_surface_show_glyphs (cairo-surface.c:1820)
> ==19140==    by 0xF7B18A4: _cairo_gstate_show_glyphs (cairo-gstate.c:1449)
> ==19140==    by 0xF7AC488: cairo_show_glyphs (cairo.c:2539)
> ==19140==    by 0xF8FA0F0: (within /usr/lib/libpangocairo-1.0.so.0.1400.5)
> ==19140==    by 0xF847990: pango_renderer_draw_glyphs (in 
> /usr/lib/libpango-1.0.so.0.1400.5)
> ==19140==    by 0xF8F93F0: (within /usr/lib/libpangocairo-1.0.so.0.1400.5)
> ==19140==    by 0xFA53BD0: (within /usr/lib/libgdk-x11-2.0.so.0.800.9)
> ==19140==    by 0xF847990: pango_renderer_draw_glyphs (in 
> /usr/lib/libpango-1.0.so.0.1400.5)
> ==19140==    by 0xF847FC8: pango_renderer_draw_layout_line (in 
> /usr/lib/libpango-1.0.so.0.1400.5)
> ==19140==    by 0xF848208: pango_renderer_draw_layout (in 
> /usr/lib/libpango-1.0.so.0.1400.5)

I've uploaded an experimental cairo 1.2.4-3 with this fix.  Maybe you
can try it out and see if this fixes it.

Since you are on powerpc you might have to compile it yourself from
sources since experimental packages are not generally autobuilt.

The patch is attached.

Dave

#!/bin/sh /usr/share/dpatch/dpatch-run
## 01-cairo_xlib_surface_add_glyph.patch by Dave Beckett <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix miscounting in loop in _cairo_xlib_surface_add_glyph()

--- cairo-1.2.4.orig/src/cairo-xlib-surface.c   2006-08-18 07:20:16.000000000 
-0700
+++ cairo-1.2.4/src/cairo-xlib-surface.c        2006-09-23 16:06:26.000000000 
-0700
@@ -2450,7 +2449,7 @@
            }
            n = new;
            d = data;
-           while ((c -= 4) >= 0)
+           while (c >= 4)
            {
                n[3] = d[0];
                n[2] = d[1];
@@ -2458,6 +2457,7 @@
                n[0] = d[3];
                d += 4;
                n += 4;
+               c -= 4;
            }
            data = new;
        }

Reply via email to