gdmgreeter doesn't handle unreadable fonts gracefully

Bug #7180 reported by Debian Bug Importer
4
Affects Status Importance Assigned to Milestone
fontconfig (Debian)
Fix Released
Unknown
fontconfig (Ubuntu)
Invalid
High
Unassigned

Bug Description

Automatically imported from Debian bug report #261783 http://bugs.debian.org/261783

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #261783 http://bugs.debian.org/261783

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (6.7 KiB)

Message-Id: <email address hidden>
Date: Wed, 28 Jul 2004 16:50:07 +1000
From: Matthew Sanderson <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: gdmgreeter doesn't handle unreadable fonts gracefully

Package: gdm
Version: 2.6.0.3-1
Severity: grave
Justification: renders package unusable

Summary: GDMGreeter does not gracefully handle the condition whereby it is trying to open a font file, but
the font file is not readable.

I have put a number of symlinks in /usr/share/fonts/truetype/commercial/, pointing to TrueType font files
stored in a different filesystem, namely in '/dosc/winnt/Fonts'. This may or may not be a good idea; for
the purposes of this bugreport it does not matter.

When the /dosc vfat filesystem containing the fonts is mounted with options that enable all users to read
the font files contained therein (eg umask=0000), gdmgreeter can also read the fonts and everything works
as expected.

When the filesystem is mounted with options that deny whichever user 'gdmgreeter' runs as access to the
font files, gdmgreeter does the following (from 'strace -f gdm --nodaemon >log 2>&1):

[pid 4003] open("/usr/share/fonts/truetype/commercial/verdana.ttf", O_RDONLY) = -1 EACCES (Permission
denied)
[pid 4003] getpid() = 4003
[pid 4003] open("/usr/lib/charset.alias", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid 4003] write(2, "\n** (gdmgreeter:4003): WARNING *"..., 77) = 77
[pid 4003] open("/usr/share/fonts/truetype/commercial/verdana.ttf", O_RDONLY) = -1 EACCES (Permission
denied)
[pid 4003] getpid() = 4003
[pid 4003] write(2, "\n** (gdmgreeter:4003): WARNING *"..., 76) = 76
[pid 4003] exit_group(1) = ?

As you can see, gdmgreeter is treating failure to access one of a great many font files as a fatal error
and is exiting immediately with an error code.
This in turn causes gdm to exit with an error code, which causes the X session to end, which leads to an
infinite loop of restarting X sessions and an unusable system. Thus, a small problem regarding one of many
font files becomes a larger problem (no X) which in turn becomes a very serious problem (entire system
unusable).

I suggest that gdmgreeter should degrade gracefully when font file(s) are absent, unreadable, or otherwise
unusable, instead of exiting. One way of gracefully handling such conditions would be to fall back to
another font.

Also, why does gdmgreeter try to open(2) the same font file twice? If open(2) failed first time with
errno==EACCES, then it will also fail second time - there are no intervening chmod calls. I could
understand this behaviour if errno==EGAIN or something similar, but it doesn't, so this seems like a
pointless waste of CPU cycles. But I don't find this important enough to justify a seperate bug report.

Also, why does 'gdmgreeter' print 'WARNING', when it is about to exit with status 1? Isn't this behaviour
the very definition of a fatal error, as opposed to merely a warning?

Another problem is that the error messages printed by gdmgreeter (writes to fd 2 in strace output above) go ...

Read more...

Revision history for this message
In , Josselin Mouette (joss) wrote : Re: Bug#261783: gdmgreeter doesn't handle unreadable fonts gracefully

reassign 261783 libfontconfig1
severity 261783 normal
retitle 261783 doesn't fall back when default fonts are unreadable
tag 261783 upstream
thanks

Le mer 28/07/2004 à 08:50, Matthew Sanderson a écrit :
> Summary: GDMGreeter does not gracefully handle the condition whereby it is trying to open a font file, but
> the font file is not readable.

This has nothing to do with gdmgreeter, all applications using
fontconfig will do that.

> I have put a number of symlinks in /usr/share/fonts/truetype/commercial/, pointing to TrueType font files
> stored in a different filesystem, namely in '/dosc/winnt/Fonts'. This may or may not be a good idea; for
> the purposes of this bugreport it does not matter.

Of course it does matter. The program fails when you deliberately fuck
up your system. This is at best a normal bug.

Regards,
--
 .''`. Josselin Mouette /\./\
: :' : <email address hidden>
`. `' <email address hidden>
  `- Debian GNU/Linux -- The power of freedom

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Wed, 28 Jul 2004 11:32:09 +0200
From: Josselin Mouette <email address hidden>
To: Matthew Sanderson <email address hidden>, <email address hidden>
Subject: Re: Bug#261783: gdmgreeter doesn't handle unreadable fonts
 gracefully

--=-rP6Yth323PyGjzPOLi+z
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

reassign 261783 libfontconfig1
severity 261783 normal
retitle 261783 doesn't fall back when default fonts are unreadable
tag 261783 upstream
thanks

Le mer 28/07/2004 =C3=A0 08:50, Matthew Sanderson a =C3=A9crit :
> Summary: GDMGreeter does not gracefully handle the condition whereby it i=
s trying to open a font file, but=20
> the font file is not readable.

This has nothing to do with gdmgreeter, all applications using
fontconfig will do that.

> I have put a number of symlinks in /usr/share/fonts/truetype/commercial/,=
 pointing to TrueType font files=20
> stored in a different filesystem, namely in '/dosc/winnt/Fonts'. This may=
 or may not be a good idea; for=20
> the purposes of this bugreport it does not matter.

Of course it does matter. The program fails when you deliberately fuck
up your system. This is at best a normal bug.

Regards,
--=20
 .''`. Josselin Mouette /\./\
: :' : <email address hidden>
`. `' <email address hidden>
  `- Debian GNU/Linux -- The power of freedom

--=-rP6Yth323PyGjzPOLi+z
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Ceci est une partie de message
 =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBBB3KYrSla4ddfhTMRAokQAJ993FPIRdEcI6r98cWf4MFNAnJ11ACgzVDU
Kw20UdodtW8nQ15V3B1WyCg=
=0CuM
-----END PGP SIGNATURE-----

--=-rP6Yth323PyGjzPOLi+z--

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

User error

Changed in fontconfig (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.