After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 558254 - Internal reference handling messed up
Internal reference handling messed up
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.22.x
Other All
: Normal critical
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 558100
 
 
Reported: 2008-10-28 15:23 UTC by Morten Welinder
Modified: 2008-10-28 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2008-10-28 15:23:49 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.
Comment 1 Behdad Esfahbod 2008-10-28 17:09:40 UTC
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.