GNOME Bugzilla – Bug 558254
Internal reference handling messed up
Last modified: 2008-10-28 17:09:40 UTC
Context: as seen in bug 558100, upgrading pango causes existing applications to start crashing. This happens for Gnumeric's non-gui applications ssconvert, ssindex, and ssgrep. It does not seem to happen for Gnumeric proper. I would suspect a (Gnumeric) leak to be the reason. Problem 1: if the context and fontmap are both unref'd by the application, it is no longer possible to safely destroy fonts. A valgrind trace for this is at http://bugzilla.gnome.org/show_bug.cgi?id=558100#c8 Gnumeric unrefs the context early and the fontmap during shutdown. It so happens that we unref the fontmap before we unref the fonts. (I can change the order in the source, but that will not help deployed binaries.) A minimal demonstration is at http://bugzilla.gnome.org/show_bug.cgi?id=558100#c12 Likely cause: something forgot to hold on to a context reference. Problem 2: If I understand this text right: http://svn.gnome.org/viewvc/pango/trunk/pango/fonts.c?r1=2704&r2=2703&pathrev=2704 then API was changed. Dropping the fontmap reference when no more fonts were needed used to be a perfectly valid and reasonable thing to do. Gnumeric is, I believe, not affected by this.
Fixed in trunk. 2008-10-28 Behdad Esfahbod <behdad@gnome.org> Bug 558254 – Internal reference handling messed up * pango/pangofc-font.c (pango_fc_font_get_coverage): * pango/pangofc-fontmap.c (pango_fc_font_map_finalize): Make sure fonts->fontmap is set to NULL when fontmap finalizes.