Bug 905276

Summary: pango_fc infinite recursion
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: pangoAssignee: Matthias Clasen <mclasen>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: fonts-bugs, i18n-bugs, manisandro, mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-08 20:59:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2013-01-29 03:07:33 UTC
Description of problem:

See http://osdir.com/ml/commits.gnome/2013-01/msg05014.html

I'm seeing this trying to build plplot for rawhide.

commit 10cc6557ba24239570ee9a7bcaa0a553aae9df95
Author: Behdad Esfahbod <behdad@xxxxxxxxxx>
Date: Thu Jan 17 17:11:19 2013 -0600

Revert "Don't use the deprecated pango_ft2_font_get_face"

This reverts commit 2dc0c3dbb1c389c3a3ba12a5c5c85f21dca46e84.

This doesn't make sense. It ends up in infinite recursion because
pangofc is calling lock_face on pangoft2, which would recursively
call it on pangofc...

Was causing hang at startup of Inkscape.

If the deprecated warnings are an issue, they need to be dealt with
in some other way.

pango/pangoft2-render.c | 6 +-----
pango/pangoft2.c | 17 +++++------------
2 files changed, 6 insertions(+), 17 deletions(-)
---
diff --git a/pango/pangoft2-render.c b/pango/pangoft2-render.c
index 60cf432..42923f4 100644
--- a/pango/pangoft2-render.c
+++ b/pango/pangoft2-render.c
@@ -210,7 +210,7 @@ pango_ft2_font_render_glyph (PangoFont *font,
return box;
}

- face = pango_fc_font_lock_face (PANGO_FC_FONT (font));
+ face = pango_ft2_font_get_face (font);

if (face)
{
@@ -231,8 +231,6 @@ pango_ft2_font_render_glyph (PangoFont *font,
rendered->bitmap_left = face->glyph->bitmap_left;
rendered->bitmap_top = face->glyph->bitmap_top;

- pango_fc_font_unlock_face (PANGO_FC_FONT (font));
-
if (G_UNLIKELY (!rendered->bitmap.buffer)) {
g_slice_free (PangoFT2RenderedGlyph, rendered);
return NULL;
@@ -242,8 +240,6 @@ pango_ft2_font_render_glyph (PangoFont *font,
}
else
{
- pango_fc_font_unlock_face (PANGO_FC_FONT (font));
-
generic_box:
return pango_ft2_font_render_box_glyph (PANGO_UNKNOWN_GLYPH_WIDTH,
PANGO_UNKNOWN_GLYPH_HEIGHT,
diff --git a/pango/pangoft2.c b/pango/pangoft2.c
index cbe1d21..dc6db5d 100644
--- a/pango/pangoft2.c
+++ b/pango/pangoft2.c
@@ -424,13 +424,12 @@ pango_ft2_font_get_kerning (PangoFont *font,
static FT_Face
pango_ft2_font_real_lock_face (PangoFcFont *font)
{
- return pango_fc_font_lock_face (font);
+ return pango_ft2_font_get_face ((PangoFont *)font);
}

static void
-pango_ft2_font_real_unlock_face (PangoFcFont *font)
+pango_ft2_font_real_unlock_face (PangoFcFont *font G_GNUC_UNUSED)
{
- pango_fc_font_unlock_face (font);
}

static gboolean
@@ -500,18 +499,12 @@ pango_ft2_font_get_coverage (PangoFont *font,
PangoGlyph
pango_ft2_get_unknown_glyph (PangoFont *font)
{
- PangoFcFont *fc_font = PANGO_FC_FONT (font);
- FT_Face face;
- PangoGlyph glyph;
-
- face = pango_fc_font_lock_face (fc_font);
+ FT_Face face = pango_ft2_font_get_face (font);
if (face && FT_IS_SFNT (face))
/* TrueType fonts have an 'unknown glyph' box on glyph index 0 */
- glyph = 0;
+ return 0;
else
- glyph = PANGO_GLYPH_EMPTY;
- pango_fc_font_unlock_face (fc_font);
- return glyph;
+ return PANGO_GLYPH_EMPTY;
}

typedef struct

Version-Release number of selected component (if applicable):
pango-1.32.6-1.fc19

How reproducible:
Every time

Steps to Reproduce:
1. Build plplot rpm
2. psttsc test fails

Comment 1 Fedora End Of Life 2013-04-03 16:12:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 2 Matthias Clasen 2013-04-08 20:59:29 UTC
this has been fixed in the current pango release