Bug 7396

Summary: _cairo_error assert failure in gnome-window-decorator with U+FFFD in window title
Product: xorg Reporter: Dan C <danc86>
Component: App/compizAssignee: David Reveman <reveman>
Status: RESOLVED WORKSFORME QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Dan C 2006-07-02 10:08:26 UTC
On my system gnome-window-decorator dies with the following assert failure
whenever it tries to draw a window title containing the character U+FFFD
REPLACEMENT CHARACTER:

gnome-window-decorator: cairo.c:86: _cairo_error: Assertion `status >
CAIRO_STATUS_SUCCESS && status <= CAIRO_STATUS_INVALID_DSC_COMMENT' failed.

Ways to get a window with U+FFFD in its title: visit
<http://www.pygtk.org/pygtk2tutorial/ch-Introduction.html> and ensure that
Firefox interprets the page as UTF-8, or simply set the title of a
gnome-terminal to contain the character (copy it from
<http://www.fileformat.info/info/unicode/char/fffd/browsertest.htm>).

I tried to track down the problem; in the problematic call to cairo_glyph_path,
this is the first time that a non-SUCCESS status code occurs:

(gdb) where
#0  _cairo_ft_scaled_glyph_init (abstract_font=0x723160, scaled_glyph=0x723f70,
info=CAIRO_SCALED_GLYPH_INFO_PATH) at cairo-ft-font.c:1746
#1  0x00002b4e6ba83e2d in _cairo_scaled_glyph_lookup (scaled_font=0x723160,
index=634, info=<value optimized out>, scaled_glyph_ret=0x7fffffc3be38)
    at cairo-scaled-font.c:1276
#2  0x00002b4e6ba83ee5 in _cairo_scaled_font_glyph_path (scaled_font=0x723160,
glyphs=<value optimized out>, num_glyphs=1, path=<value optimized out>)
    at cairo-scaled-font.c:1069
#3  0x00002b4e6ba7c1aa in _cairo_gstate_glyph_path (gstate=0x7377f0,
glyphs=0x7fffffc3bf00, num_glyphs=1, path=0x7326e8) at cairo-gstate.c:1486
#4  0x00002b4e6ba77cec in cairo_glyph_path (cr=0x7326e0, glyphs=0x723f70,
num_glyphs=4) at cairo.c:2533
#5  0x00002b4e6b4fc1fb in pango_cairo_renderer_draw_glyphs (renderer=<value
optimized out>, font=0x69f120, glyphs=0x72c300, x=66560, y=14336)
    at pangocairo-render.c:235
#6  0x00002b4e6b94c946 in pango_renderer_draw_glyphs (renderer=0x53b710,
font=0x69f120, glyphs=0x72c300, x=66560, y=14336) at pango-renderer.c:599
#7  0x00002b4e6b94ccf6 in pango_renderer_draw_layout_line (renderer=0x53b710,
line=0x727600, x=0, y=14336) at pango-renderer.c:530
#8  0x00002b4e6b94d0e3 in pango_renderer_draw_layout (renderer=0x53b710,
layout=<value optimized out>, x=0, y=0) at pango-renderer.c:183
#9  0x00002b4e6b4fb144 in pango_cairo_layout_path (cr=0x7326e0, layout=0x57b6d0)
at pangocairo-render.c:680
#10 0x000000000040a03d in _start ()
(gdb) fin
Run till exit from #0  _cairo_ft_scaled_glyph_init (abstract_font=0x723160,
scaled_glyph=0x723f70, info=CAIRO_SCALED_GLYPH_INFO_PATH)
    at cairo-ft-font.c:1746
0x00002b4e6ba83e2d in _cairo_scaled_glyph_lookup (scaled_font=0x723160,
index=634, info=<value optimized out>, scaled_glyph_ret=0x7fffffc3be38)
    at cairo-scaled-font.c:1276
1276    cairo-scaled-font.c: No such file or directory.
        in cairo-scaled-font.c
Value returned is $21 = CAIRO_INT_STATUS_UNSUPPORTED

I am using a 20060624 CVS snapshot of Compiz, cairo-1.2.0, and pango-1.12.3. If
there are other details I have omitted, I will be happy to provide them.
Comment 1 Dan C 2006-07-02 10:15:02 UTC
I should add that I had the window title font sent to Bitstream Vera Sans --
have just changed it to DejaVu Sans (which apparently has a glyph for U+FFFD,
where Vera Sans does not) and the assert failure does not occur.

Presumably the problem is due to the fact that the window title font does not
have a glyph for the character -- but window titles containing e.g. CJK
characters pose no problem, even with the window title font set to Vera Sans.
Comment 2 Daniel Stone 2007-02-27 01:32:45 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 Danny Baumann 2008-11-24 01:05:29 UTC
gnome-window-decorator is no more and it works fine using gtk-window-decorator -> Closing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.