[Bug 820134] Re: libfontconfig causes SIGBUS due to mmap and NFS interaction.

Bug Watch Updater 820134 at bugs.launchpad.net
Wed Mar 21 20:56:10 UTC 2012


Launchpad has imported 7 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=39278.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2011-07-16T13:42:17+00:00 Oswald Buddenhagen wrote:

ref https://bugs.kde.org/show_bug.cgi?id=272870

fontconfig's usage of mmap may lead to sigbus when the mapped file disappears, e.g. due to an NFS failure. this is fatal if the crashed application happens to be the screensaver.
consequently, it should be possible to disable mmap use alltogether.

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/0

------------------------------------------------------------------------
On 2011-07-18T17:54:37+00:00 Freedesktop wrote:

This is really nasty...

What kind of optional do you think would fix the problem?  Who decides
whether to use mmap() or read()?

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/1

------------------------------------------------------------------------
On 2011-07-18T20:41:14+00:00 Oswald Buddenhagen wrote:

i've been wondering, too.
the quick hack would be just having an environment variable to control it and the screensaver would directly set it.
the right solution would be some proper api which would be used by the next higher level, in this case qt. that one in turn would have to expose an api to disable all kinds of mmaps.

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/2

------------------------------------------------------------------------
On 2011-07-18T21:01:32+00:00 Freedesktop wrote:

Or simply do that for NFS cachedirs?

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/3

------------------------------------------------------------------------
On 2011-07-19T07:03:04+00:00 Oswald Buddenhagen wrote:

that may be an option, though keeping the list of nfs-(un)save FSs
current is a bit challenging. it's unfortunate that there is no
standardized interface to query "mmap-safety" of particular files afaik
...

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/4

------------------------------------------------------------------------
On 2011-08-03T18:21:26+00:00 Antarus-k wrote:

Quick question.

We are hitting this problem often; will fontconfig still work if I just
drop the <cachedir>~/.fontconfig</cachedir> part from fontconfig (on our
local installs.)

Will this just result in a slowdown (uncached font information?)

My concern is that this will break per-user ~/.fonts.conf and we have a
lot of those; breaking them would be bad.

I have another hack where most homedirs have a .cache symlink that
points to local disk; but I want to avoid relying on it.

-A

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/6

------------------------------------------------------------------------
On 2011-08-03T18:28:47+00:00 Freedesktop wrote:

Avoiding the cache is not good.   Redirect them to /tmp or something,
yeah.

Reply at: https://bugs.launchpad.net/fontconfig/+bug/820134/comments/7


** Bug watch added: KDE Bug Tracking System #272870
   http://bugs.kde.org/show_bug.cgi?id=272870

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to fontconfig in Ubuntu.
https://bugs.launchpad.net/bugs/820134

Title:
  libfontconfig causes SIGBUS due to mmap and NFS interaction.

Status in Fontconfig - Font Configuration Library:
  Confirmed
Status in “fontconfig” package in Ubuntu:
  New

Bug description:
  https://bugs.freedesktop.org/show_bug.cgi?id=39278

  Summarized:

  man mmap specifies the occasions when sigbus is sent:

         SIGBUS Attempted  access  to  a  portion  of the buffer that does not correspond to the file (for
                example, beyond the end of the file, including the case where another  process  has  trun‐
                cated the file).

  If users are using homedirectories on NFS; a simple NFS failure may
  cause a file size to change.

  Users originally reported this problem running eclipse and seeing 3-4
  crashes per day.

  I believe the workaround we are proposing is to modify
  /etc/fonts/fonts.conf

  <!-- Font cache directory list -->

          <cachedir>/var/cache/fontconfig</cachedir>
          <cachedir>~/.fontconfig</cachedir>
          <config>
  and just remove the ~/.fontconfig section (possibly replacing it with something on local disk if that is supported.)

  
  antarus at goats2 /etc/fonts $ lsb_release -rd
  Description:    Ubuntu 10.04.2 LTS
  Release:        10.04

  
  antarus at goats2 /etc/fonts $ apt-cache policy fontconfig
  fontconfig:
    Installed: 2.8.0-2ubuntu1
    Candidate: 2.8.0-2ubuntu1

  I expect fontconfig to handle mmap's properly. Upstream is aware of the problem but I don't see a fix yet.
  The application SIGBUS's

To manage notifications about this bug go to:
https://bugs.launchpad.net/fontconfig/+bug/820134/+subscriptions




More information about the foundations-bugs mailing list