Bug 466404

Summary: Segmentation fault.
Product: [Fedora] Fedora Reporter: sangu <sangu.fedora>
Component: fontforgeAssignee: Kevin Fenzi <kevin>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 10CC: belegdol, darkworldsawake, fonts-bugs, kevin, nphilipp, roozbeh
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-09 19:45:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sangu 2008-10-10 03:56:30 UTC
Description of problem:
$ gdb fontforge
(gdb) r
Starting program: /usr/bin/fontforge 
[Thread debugging using libthread_db enabled]
Copyright (c) 2000-2008 by George Williams.
 Executable based on sources from 00:23 GMT 28-Aug-2008.
 Library based on sources from 23:33 GMT 27-Aug-2008.
[New Thread 0xb7fdf700 (LWP 11925)]
Help! Server claimed font
	-ibm-courier-medium-r-normal--13-0-0-0-m-0-iso10646-1
 existed in the font list, but when I asked for it there was nothing.
 I may crash soon.

Program received signal SIGSEGV, Segmentation fault.
0x00479f79 in GDrawFontMetrics (fi=0x83d6ce8, as=0xbfffd148, ds=0xbfffd144, 
    ld=0xbfffd140) at gdrawtxt.c:2328
2328		*as = fontinfo->ascent;
Missing separate debuginfos, use: debuginfo-install e2fsprogs.i386 libICE.i386 libSM.i386 libXau.i386 libXcursor.i386 libXdmcp.i386 libXfixes.i386 libXrender.i386
(gdb) bt
#0  0x00479f79 in GDrawFontMetrics (fi=0x83d6ce8, as=0xbfffd148, 
    ds=0xbfffd144, ld=0xbfffd140) at gdrawtxt.c:2328
#1  0x004bb00c in GTextFieldFit () at gtextfield.c:2596
#2  _GTextFieldCreate (gt=0x83cc0a8, base=0x83a8328, gd=0xbfffe41c, 
    data=0x83d0830, def=0x4fdf60) at gtextfield.c:2692
#3  0x004bb912 in GTextCompletionCreate (base=0x83a8328, gd=0xbfffe41c, 
    data=0x83d0830) at gtextfield.c:2732
#4  0x004cb015 in _GHVBoxCreate (base=0x83a8328, gd=0xbfffe5bc, data=0x0, 
    hcnt=1, vcnt=3, def_box=0x4fe440) at ghvbox.c:573
#5  0x004cb26d in GVBoxCreate (base=0x83a8328, gd=0x0, data=0x0)
    at ghvbox.c:607
#6  0x00484d6e in GGadgetsCreate (base=0x83a8328, gcd=0xbfffe5b8)
    at ggadgets.c:1172
#7  0x004834fa in GFileChooserCreateChildren () at gfilechooser.c:1525
#8  GFileChooserCreate (base=0x83a8328, gd=0xbfffe818, data=0x0)
    at gfilechooser.c:1571
#9  0x004cb015 in _GHVBoxCreate (base=0x83a8328, gd=0xbfffec18, data=0x0, 
    hcnt=1, vcnt=4, def_box=0x4fe400) at ghvbox.c:573
#10 0x004cb182 in GHVGroupCreate (base=0x83a8328, gd=0xbfffec18, data=0x0)
    at ghvbox.c:633
#11 0x00484d6e in GGadgetsCreate (base=0x83a8328, gcd=0xbfffec14)
    at ggadgets.c:1172
#12 0x0815b15e in FVOpenFont (title=0x81c20e0 "Open Font", defaultfile=0x0, 
---Type <return> to continue, or q <return> to quit---
    mult=1) at openfontdlg.c:736
#13 0x08109f84 in GetPostscriptFontName (dir=0x0, mult=1) at fontview.c:1102
#14 0x0810a1f4 in MenuOpen (base=0x0, mi=0x0, e=0x0) at fontview.c:1142
#15 0x0819dbf4 in main (argc=1, argv=0xbffff554) at startui.c:1131

$ dmesg | grep fontforge
fontforge[11659]: segfault at 48 ip 00479f79 sp bfe4b4a0 error 4 in libgdraw.so.4.0.5[451000+93000]
fontforge[11676]: segfault at 48 ip 00479f79 sp bfd76240 error 4 in libgdraw.so.4.0.5[451000+93000]
fontforge[11682]: segfault at 48 ip 00479f79 sp bfb3eb40 error 4 in libgdraw.so.4.0.5[451000+93000]

Version-Release number of selected component (if applicable):
20080828-1.fc10

How reproducible:
always

Steps to Reproduce:
1. $fontforge
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Kevin Fenzi 2008-10-10 05:11:15 UTC
This looks like a duplicate of 450709. 
Look there for the fix/workaround.

*** This bug has been marked as a duplicate of bug 450709 ***

Comment 2 sangu 2008-10-10 10:59:15 UTC
After adding Gdraw.ScreenWidthInches: 23 in ~/.Xresources, this issue is fixed.
$ xrdb -m ~/.Xresources.

Reopend?

Comment 3 sangu 2008-10-10 12:54:40 UTC
Whenever fontforge crashes,  /var/log/Xorg.0.log updates
$ cat /var/log/Xorg.0.log
[...]
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1
FreeType: couldn't open face /usr/share/X11/fonts/Type1/cour.pfa: 1

Comment 4 sangu 2008-10-10 12:59:49 UTC
Dropped ibm-type1 ( See Also bug 317641 ).
Then fontforge uses ibm-type1 fonts(cour.pfa)

$ rpm -q --changelog xorg-x11-fonts-Type1 |less

* Mon Jan 14 2008 Tom "spot" Callaway <tcallawa> - 7.2-6
- IBM refused to relicense ibm-type1 fonts with permission to modify,
  so they were dropped (bugzilla 317641)

Comment 5 Kevin Fenzi 2008-10-10 18:38:33 UTC
So, I am confused. How is this different than bug 450709 ?

My understanding of this bug: 

- The ibm type1 fonts were removed. 
- The cache files were not regenerated
- Fontforge tries to use that font and dies because it is not really available. 

Granted that fontforge shouldn't crash when a font isn't available, but the X server shouldn't lie to it and tell it that it has a font when it does not. 

So, doesn't regenerating your font cache files (as mentioned in bug 450709 ) fix this issue for you? 

Or is this somehow another issue?

Comment 6 Bug Zapper 2008-11-26 03:44:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

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

Comment 7 Kevin Fenzi 2008-12-02 06:37:46 UTC
I am going to go ahead and close this as it's looking like a duplicate of 450709 and I haven't heard back from the reporter in months. 

Feel free to file a new bug if there is a need.

*** This bug has been marked as a duplicate of bug 450709 ***

Comment 8 Nils Philippsen 2009-02-19 09:31:25 UTC
Reopening because of the fontforge instability issue.

Regenerating the font cache files ("fc-cache /usr/share/X11/fonts/Type1") doesn't help as the missing font files are referenced in the xorg-x11-fonts-Type1 package, in the files /usr/share/X11/fonts/Type1/fonts.dir and .../fonts.scale. Removing that package helps of course for running fontforge, but then you're missing some fonts you may want to have.

Comment 9 Nils Philippsen 2009-02-19 10:19:38 UTC
I just installed the font package again, and it doesn't crash anymore. See my comment on bug 450709 re: mkfontdir/mkfontscale issues.

So in order to test this I guess you would have to install and old version of xorg-x11-fonts-Type1 that contained the IBM fonts with non-open source licenses and the update to the current version.

Comment 10 Kevin Fenzi 2009-03-04 21:07:53 UTC
ok, so this is open to try and address the crashing in frontforge when it's lied to about what fonts are available? :) 

I can bring the issue up upstream and see if they can come up with a fix.

Comment 11 Nils Philippsen 2009-03-05 09:44:02 UTC
(In reply to comment #10)
> ok, so this is open to try and address the crashing in frontforge when it's
> lied to about what fonts are available? :) 
> 
> I can bring the issue up upstream and see if they can come up with a fix.

Yes, that'd be good and very appreciated.

Comment 12 Julian Sikorski 2009-06-10 18:34:55 UTC
Also happens on F11:
Copyright (c) 2000-2009 by George Williams.
 Executable based on sources from 14:20 GMT 24-Feb-2009.
 Library based on sources from 14:18 GMT 24-Feb-2009.
Failed to create a fontset for the input method
-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-1,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-2,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-3,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-4,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-5,-misc-ar pl ukai tw-medium-r-normal--16-0-0-0-c-0-iso8859-7,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-9,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-10,-misc-ar pl uming tw-light-r-normal--16-0-0-0-c-0-iso8859-13,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso8859-15,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-koi8-uni,-urw-urw gothic l-medium-r-normal--16-0-0-0-p-0-iso10646-1
Help! Server claimed font
	-misc-ar pl ukai cn-medium-r-normal--16-0-0-0-c-0-iso10646-1
 existed in the font list, but when I asked for it there was nothing.
 I may crash soon.

Program received signal SIGSEGV, Segmentation fault.
GDrawFontMetrics (fi=0x865c580, as=0xbfffe3a8, ds=0xbfffe3a4, ld=0xbfffe3ac)
    at gdrawtxt.c:2339
2339		*as = fontinfo->ascent;
(gdb) bt
#0  GDrawFontMetrics (fi=0x865c580, as=0xbfffe3a8, ds=0xbfffe3a4, 
    ld=0xbfffe3ac) at gdrawtxt.c:2339
#1  0x00d58169 in GXDrawFontMetrics (w=0x0, fi=0xbfffe3ac, as=0xbfffe3a8, 
    ds=0xbfffe3a4, ld=0xbfffe3ac) at gxdraw.c:2773
#2  0x00d054a3 in GDrawWindowFontMetrics (w=0x83f9228, fi=0x865c580, 
    as=0xbfffe3a8, ds=0xbfffe3a4, ld=0xbfffe3ac) at gdraw.c:580
#3  0x00d322fd in GProgressStartIndicator (delay=0, win_title=0x85ec410, 
    line1=0x8431508, line2=0x851a3f8, tot=0, stages=1) at gprogress.c:232
#4  0x00d32787 in GProgressStartIndicator8 (delay=0, 
    title=0xb7d1b27c "Wczytywanie...", 
    line1=0xbfffe4a2 "Wczytywanie fontu z arialn.ttf", 
    line2=0xb7d23c4e "Wczytywanie glifów", tot=0, stages=1) at gprogress.c:462
#5  0x0040c581 in _ReadSplineFont (file=0x0, 
    filename=0x8542430 "/home/jsikorski/.fonts/arialn/arialn.ttf", openflags=0)
    at splinefont.c:998
#6  0x0040de8c in ReadSplineFont (
    filename=0x8542430 "/home/jsikorski/.fonts/arialn/arialn.ttf", openflags=0)
    at splinefont.c:1226
#7  0x0040df6d in LoadSplineFont (
    filename=0x8542430 "/home/jsikorski/.fonts/arialn/arialn.ttf", openflags=0)
    at splinefont.c:1299
#8  0x002d272c in ViewPostscriptFont (
    filename=0x8542430 "/home/jsikorski/.fonts/arialn/arialn.ttf", openflags=0)
---Type <return> to continue, or q <return> to quit---
    at fontviewbase.c:1234
#9  0x0810ae8c in MenuOpen (base=0x0, mi=0x0, e=0x0) at fontview.c:963
#10 0x081a1dbf in main (argc=1, argv=0xbffff3e4) at startui.c:1366
(gdb)

Comment 13 Kevin Fenzi 2009-06-17 03:57:07 UTC
*** Bug 506373 has been marked as a duplicate of this bug. ***

Comment 14 Kevin Fenzi 2009-09-03 16:14:46 UTC
It doesn't look like this is going to be fixable... 

I talked with upstream and the problem here is that if they just exit when they see that they can't get a font, that would hit cases where people could save their work before it crashes. 

From upstream: 

"If you think you can fix it, please do.
As you point out it is not really my bug, and as I have been unable to
fix it in 10 years I have given up."

So, I guess the answer here is to make sure our font cache information is accurate? 
Can I go ahead and close this now? Or would someone here like to take a stab at patching it? :)

Comment 15 Kevin Fenzi 2009-09-09 19:45:12 UTC
Closing this now. 
Feel free to reopen or file new bugs if you spot anything we can fix up.