Pango bug when scaling bitmap fonts?
Submitted by Steve Dodier
Link to original bug (#744272)
Description
Hi,
This report originally started in https://bugzilla.xfce.org/show_bug.cgi?id=11507.
We've got a user who can produce a systematic crash of Thunar when using the bitmap font "profont". Thunar is shut by a Pango assertion when displaying a specific settings UI tab, which contains italics and scaled down text:
thunar: cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed. Aborted (core dumped)
This is the code Thunar uses:
static PangoAttrList* thunar_pango_attr_list_wrap (PangoAttribute *attribute, ...) { PangoAttrList *attr_list; va_list args;
/* allocate a new attribute list */ attr_list = pango_attr_list_new ();
/* add all specified attributes */ va_start (args, attribute); while (attribute != NULL) { attribute->start_index = 0; attribute->end_index = -1; pango_attr_list_insert (attr_list, attribute); attribute = va_arg (args, PangoAttribute *); } va_end (args);
return attr_list; }
PangoAttrList* thunar_pango_attr_list_small_italic (void) { static PangoAttrList *attr_list = NULL; if (G_UNLIKELY (attr_list == NULL)) attr_list = thunar_pango_attr_list_wrap (pango_attr_scale_new (PANGO_SCALE_SMALL), pango_attr_style_new (PANGO_STYLE_ITALIC), NULL); return attr_list; }
As we don't do anything special and use functions for which the documentation indicates no possible errors, I suspect there is a bug somewhere in Pango. Of course if it's Thunar/GTK+ failing to check for something, we're happy for some pointers to identify the issue and avoid it in the future.