Bug 1248 - ttmkfdir segfaults for (some) truetype font dirs
Summary: ttmkfdir segfaults for (some) truetype font dirs
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Fonts/other (show other bugs)
Version: 6.8.0
Hardware: x86 (IA32) Linux (All)
: high enhancement
Assignee: Juliusz Chroboczek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-31 03:25 UTC by Mitchel Sahertian
Modified: 2006-11-05 22:15 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Contents of the /usr/share/fonts/TTF directory (581.38 KB, application/x-tar)
2004-08-31 03:26 UTC, Mitchel Sahertian
no flags Details
strace output of ttmkfdir (7.46 KB, application/octet-stream)
2004-08-31 03:27 UTC, Mitchel Sahertian
no flags Details
correct-encoding.patch (2.55 KB, patch)
2004-12-01 15:26 UTC, Donnie Berkholz
no flags Details | Splinter Review

Description Mitchel Sahertian 2004-08-31 03:25:50 UTC
ttmkfdir throws a Segmenation Fault for at least two truetype font directories.

Partial Output from /etc/init.d/xfs mkfontdirs
 *   /usr/share/fonts/util...                                             [ ok ]
 *   /usr/share/fonts/local...
/etc/init.d/xfs: line 230:  1079 Segmentation 
fault      /usr/X11R6/bin/ttmkfdir -x 2 -
e /usr/share/fonts/encodings/encodings.dir -o ${x}/fonts.scale -d ${x} 
>/dev/null                                                                  [ 
ok ]
 *   /usr/share/fonts/TTF...
/etc/init.d/xfs: line 230:  1083 Segmentation 
fault      /usr/X11R6/bin/ttmkfdir -x 2 -
e /usr/share/fonts/encodings/encodings.dir -o ${x}/fonts.scale -d ${x} 
>/dev/null                                                                  [ 
ok ]

# strace /usr/X11R6/bin/ttmkfdir -x 2 -
e /usr/share/fonts/encodings/encodings.dir -o /usr/share/fonts/TTF/fonts.scale -
d /usr/share/fonts/TTF
(output attached)

By examing the strace output, i found that 
/usr/share/fonts/encodings
- suneu-greek.enc.gz
- large/cns11643-1.enc.gz
- large/cns11643-2.enc.gz
- large/cns11643-3.enc.gz
were giving problems and thus i moved those away.
The problem dissapeared, but this doesn't seem to be a permanent solution.

X Window System Version 6.7.99.903 (6.8.0 RC 3)
Build Operating System: Linux 2.6.8.1 i686 [ELF]
Current Operating System: Linux xinu 2.6.8.1 #1 Thu Aug 19 09:44:54 CEST 2004 
i686
Build Date: 31 August 2004
gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

Tried the cvs HEAD too, had the same problem.

Attached (should  be) the strace output and the contents of /usr/share/fonts/TTF
Comment 1 Mitchel Sahertian 2004-08-31 03:26:40 UTC
Created attachment 785 [details]
Contents of the /usr/share/fonts/TTF directory
Comment 2 Mitchel Sahertian 2004-08-31 03:27:29 UTC
Created attachment 786 [details]
strace output of ttmkfdir
Comment 3 Giacomo Perale 2004-08-31 15:35:51 UTC
same problem here, with the same files
same system (gentoo) too :)
Comment 4 Roland Mainz 2004-09-01 15:45:45 UTC
Isn't "ttmkfdir" depreciated (and it isn't part of the Xorg tree) since
"mkfontscale" supersets it's functionality ? "mkfontscale" doesn't crash with
these files...
Comment 5 Donnie Berkholz 2004-12-01 15:26:47 UTC
Created attachment 1439 [details] [review]
correct-encoding.patch

Patch and below comment from Benoit Boissinot:

This patch correct the 'UNDEFINE' statement from some encoding, since they
shouldn't be greater than the 'SIZE' of the encoding.
Comment 6 Roland Mainz 2004-12-02 13:29:03 UTC
ienup:
Can you check whether attachment #1439 [details] [review] is correct, please ?
Comment 7 Juliusz Chroboczek 2006-11-03 14:15:10 UTC
It's almost correct, except that the line in the suneu-greek encoding should say

  UNDEFINE 0x00 0xFF

Feel free to commit it if you get around to it before me.

Juliusz
Comment 8 Juliusz Chroboczek 2006-11-05 15:01:34 UTC
Fixed, thanks for your help.

Donnie: there's nothing that says that UNDEFINE cannot be out of range; I've
carefully designed the encoding format so that you can simply say

  UNDEFINE 0 0xFFFF

and be done with it.  The bug is in ttmkfdir.

And Roland is right, ttmkfdir is superseded by mkfontscale.  If there's any
reason why you folks are still using ttmkfdir, please let me know what features
are missing in mkfontscale.

                                                         Juliusz
Comment 9 Donnie Berkholz 2006-11-05 22:15:51 UTC
(In reply to comment #8)
> Donnie: there's nothing that says that UNDEFINE cannot be out of range; I've
> carefully designed the encoding format so that you can simply say
> 
>   UNDEFINE 0 0xFFFF
> 
> and be done with it.  The bug is in ttmkfdir.

OK, thanks for the info. Unfortunately ttmkfdir's mostly unmaintained at this
point from what I can tell. =\

> And Roland is right, ttmkfdir is superseded by mkfontscale.  If there's any
> reason why you folks are still using ttmkfdir, please let me know what features
> are missing in mkfontscale.

I keep hearing vague noises about CJK stuff working better in ttmkfdir, but I
have no experience in this area to judge.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.