Bug 113602

Summary: gnome-font-properties crashes very offen.
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Zhe Su <zsu>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: federico, shinkichi.yamazaki, tiwai
Version: Beta 3   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: backtrace of gnome-font-properties.
A test file which will make pango-cairoview crash.
fc-list-output

Description Zhe Su 2005-08-28 06:50:20 UTC
It seems that pangocairo is very unstable. When I used gnome-font-properties, it
crashed in pangocairo very offen.

And the font rendering quality of pangocairo is much worse than pangoxft,
especially for CJK fonts. See also bug #113545.

I'm just wondering whether it's possible to use pangoxft instead pangocairo in
SUSE10?
Comment 1 Zhe Su 2005-08-28 06:52:01 UTC
Created attachment 47877 [details]
backtrace of gnome-font-properties.
Comment 2 Zhe Su 2005-08-29 14:49:35 UTC
Created attachment 48021 [details]
A test file which will make pango-cairoview crash.

pango-1.10.0/examples/pango-cairoview unicode.txt

then it will crash.
Comment 3 Mike Fabian 2005-08-29 15:13:49 UTC
"gedit unicode.txt" crashes for me as well.

gedit is linked against libpangocairo:

mfabian@magellan:/var/tmp/abuild$ ldd /opt/gnome/bin/gedit  | grep cairo
        libpangocairo-1.0.so.0 => /opt/gnome/lib64/libpangocairo-1.0.so.0 (0x00002aaaae0dc000)
        libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00002aaaae44b000)
mfabian@magellan:/var/tmp/abuild$ ldd /opt/gnome/bin/gedit  | grep xft
mfabian@magellan:/var/tmp/abuild$

Comment 4 Mike Fabian 2005-08-29 15:16:49 UTC
gnome-terminal is apparently linked against pangocairo *and* pangoxft (on beta3):

mfabian@magellan:~$ ldd /opt/gnome/bin/gnome-terminal  | grep -i xft
        libXft.so.2 => /usr/X11R6/lib64/libXft.so.2 (0x00002aaaac141000)
        libpangoxft-1.0.so.0 => /opt/gnome/lib64/libpangoxft-1.0.so.0 (0x00002aaaac689000)
mfabian@magellan:~$ ldd /opt/gnome/bin/gnome-terminal  | grep -i cairo
        libpangocairo-1.0.so.0 => /opt/gnome/lib64/libpangocairo-1.0.so.0 (0x00002aaaacc68000)
        libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00002aaaacd6f000)
mfabian@magellan:~$

   cat unicode.txt

in gnome-terminal does *not* crash gnome-terminal.
Comment 5 JP Rosevear 2005-08-29 17:22:00 UTC
gedit on 64bit is working fine here with unicode.test. gtk 2.8.0, pango 1.10.0
and cairo 0.9.2.  Linking looks the same.

Upstream bugs of interest:
http://bugzilla.gnome.org/show_bug.cgi?id=313685
http://bugzilla.gnome.org/show_bug.cgi?id=314239

Zhe Su, what fonts do you have installed?
Comment 6 Zhe Su 2005-08-30 08:23:58 UTC
Hi, I confirmed that the last patch provided in upstream bug 313685 could fix
this crash issue. And this patch looks correct.

So please apply the patch. The url is
http://bugzilla.gnome.org/attachment.cgi?id=50878&action=view

This patch is very simple:

diff -urNp cairo-0.9.2/src/cairo-ft-font.c cairo-0.9.2-hacked/src/cairo-ft-font.c
--- cairo-0.9.2/src/cairo-ft-font.c     2005-08-13 22:08:03.000000000 +1200
+++ cairo-0.9.2-hacked/src/cairo-ft-font.c      2005-08-18 11:00:37.100834784 +1200
@@ -504,8 +504,8 @@ _cairo_ft_unscaled_font_lock_face (cairo
            break;

        FT_Done_Face (entry->face);
-       unscaled->face = NULL;
-       unscaled->have_scale = 0;
+       entry->face = NULL;
+       entry->have_scale = 0;

        font_map->num_open_faces--;
     }

The original source code is obviously wrong here.

And I think the three patches for pango provided in that bug report should be
correct as well. So please apply these patches as well.

http://bugzilla.gnome.org/attachment.cgi?id=50826&action=view
http://bugzilla.gnome.org/attachment.cgi?id=50827&action=view
http://bugzilla.gnome.org/attachment.cgi?id=50828&action=view
Comment 7 Mike Fabian 2005-08-30 13:29:50 UTC
Yes, the patch quoted by Zhe Su in comment #6 fixes the "gedit
unicode.txt" crash for me.


Comment 8 Mike Fabian 2005-08-30 13:31:24 UTC
JP Rosevear> Zhe Su, what fonts do you have installed?

I'll attach a list of the fonts I have installed.  But I suppose it
doesn't matter much, the patch appears to correct and it fixes the
problem.

Comment 9 Mike Fabian 2005-08-30 13:33:44 UTC
Created attachment 48168 [details]
fc-list-output

output of "fc-list : family style file" to list the fonts installed
on my system.
Comment 10 Mike Fabian 2005-08-30 13:36:35 UTC
JP, my first guess would be that you need to have CJK fonts installed
to make the problem occur because most likely you don't have any CJK
fonts installed but Zhe Su and me have a lot of them installed.

I.e. try to install the following font packages:

ttf-founder-simplified
ttf-founder-traditional
ttf-arphic-bkai00mp
ttf-arphic
ttf-arphic
ttf-arphic
ttf-arphic
sazanami-fonts
IPAPMincho
IPAPGothic
IPAMincho
IPAGothic
IPAUIGothic

Comment 11 Mike Fabian 2005-08-30 13:39:16 UTC
I submitted a cairo package with the patch from comment #6 applied
to STABLE. Probably it is too late for beta4 though ...
Comment 12 Mike Fabian 2005-08-30 14:55:53 UTC
Takashi Iwai noticed that scim-input-pad crashed when clicking on the
"Symbol" tab and then through all the sub-tabs of the "Symbol" tab.

I verified that this crash occurs with the original cairo package but
the crash is fixed with the cairo package with the patch from comment
#6.

Comment 13 Mike Fabian 2005-08-30 15:29:35 UTC
What about the pango patches?

Apparently they don't have anything to do with the crash.

Can we close this bug?
Comment 14 JP Rosevear 2005-08-30 17:49:46 UTC
The appear to be Sun JDS patches for chinese - Zhe Su with the just the cairo
updates do CJK fonts work fine?  If so i'm reluctant to dump more patches in
this late in the game.
Comment 15 JP Rosevear 2005-09-05 01:40:42 UTC
Closing bug, we upgraded to cairo 1.0.0.  Please reopen if you see this bug again.
Comment 16 JP Rosevear 2005-09-06 16:34:49 UTC
*** Bug 114765 has been marked as a duplicate of this bug. ***
Comment 17 Mike Fabian 2005-09-06 16:51:20 UTC
No, I cannot reproduce the crashes anymore.

Both "gedit unicode.txt" and scim-input-pad work fine now.

Thank you!