[Fontconfig-bugs] [Bug 100096] New: fontconfig update racy, causes update storm that freezes the desktop

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 7 08:12:22 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100096

            Bug ID: 100096
           Summary: fontconfig update racy, causes update storm that
                    freezes the desktop
           Product: fontconfig
           Version: 2.12
          Hardware: All
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: library
          Assignee: fontconfig-bugs at lists.freedesktop.org
          Reporter: jan.steffens at gmail.com
        QA Contact: freedesktop at behdad.org

Already posted as a gnome-settings-daemon bug at
https://bugzilla.gnome.org/show_bug.cgi?id=777255

I'm trying to debug my desktop freezing often when I update fonts, and I think
I managed to reduce it to this:

1. Something changes ~/.local/share/fonts.

2. GSD notices and reinitializes fontconfig, which updates the cache.

3. GSD sends out an XSettings update.

2. Something changes ~/.local/share/fonts, again.

3. All other Gtk processes receive the XSettings update and reinitialize
fontconfig.  This includes the shell.

4. The processes all discover that ~/.local/share/fonts has changed and attempt
to update the cache. This needs a lock on the cache.

5. The processes wait on the lock, one by one rescanning the fonts in the dir.

Since the shell takes part, the desktop is frozen until the shell has finished
its rebuild. If the dir contains a lot of fonts and is slow to scan, the
desktop can be frozen for quite a while.

Running "touch abc; sleep 0.1; rm abc" in ~/.local/share/fonts quite reliably
freezes the shell for a second. Doing this in /usr/share/fonts/noto/ (which
contains the entire Noto set including CJK) freezes the desktop for over two
and a half minutes.

Maybe fontconfig can at least reduce the impact by rechecking whether the cache
is up-to-date after acquiring the lock? This way there should be only one
unexpected cache update instead of a dozen or more.

gnome-settings-daemon 3.22.1, GTK 3.22.6, fontconfig 2.12.1

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20170307/fc80460a/attachment.html>


More information about the Fontconfig-bugs mailing list