Xubuntu desktop crashes in call to cairo after setting fixed-width bitmap (pcf) GTK font

Bug #1294699 reported by Nathan Kennedy
92
This bug affects 19 people
Affects Status Importance Assigned to Milestone
gtk2-engines-murrine (Debian)
Fix Released
Unknown
gtk2-engines-murrine (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Trusty by Mathew Hodson
Xenial
Triaged
Medium
Unassigned

Bug Description

[Impact]

Due to a problem in the Murrine engine, using bitmap fonts and Murrine-based
themes at the same time might lead to crash of various GTK+2 apps. This issue
was around for about 3-4 years, or maybe even more.

It affects a lot of Xfce and MATE users who choose to use bitmap fonts, and
it's present in two current LTS releases, so it would be really nice to apply
the fix there.

The patch which is posted below fixes the crashes for good and allows people
to use bitmap fonts and Murrine-based themes together again.

[Test Case]

Steps to reproduce:

1. Have Xubuntu (or Xfce in any other Ubuntu edition) installed. It can be
   any release from 14.04 to 16.10.
2. Install gtk2-engines-murrine, murrine-themes and shimmer-themes packages,
   if they're not installed.
3. Install some package with bitmap fonts, for example, xfonts-terminus.
4. Run xfce4-appearance-settings and select some Murrine-based theme, for
   example, Greybird or Murrine-Light.
5. Switch to the Fonts tab and select some bitmap font, for example, Terminus.
6. Exit xfce4-appearance-settings.

Now some GTK+2 apps will crash right on start with the following error message:

../../../../src/cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed.

It's reproducible with mousepad, gimp, geany. With some Murrine-based themes,
like Greybird, it's also reproducible with xfce4-panel and Xfce configuration
apps: xfce4-appearance-settings, xfce4-mouse-settings, xfce4-session-settings,
etc.

It also affects some MATE apps, like mate-panel or mate-control-center.

[Regression Potential]

After several months of testing the fix in Debian Jessie and a few Ubuntu
releases, I hadn't found any regressions. Since the patch is very small and
it fixes all the crashes for good, I don't think there's much space for the
regressions.

[Other Info]

Appearance settings being affected is a nasty thing. However, you can reset
the font to default via the console tool:
$ xfconf-query -c xsettings -p /Gtk/FontName -r

The patch was made following the proposed solution at:
https://bugs.freedesktop.org/show_bug.cgi?id=78787#c9

Similar report seen in archlinux/xfce4:
https://bbs.archlinux.org/viewtopic.php?id=169433

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: libgtk2.0-0 2.24.20-1ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-18.32-generic 3.11.10.4
Uname: Linux 3.11.0-18-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
Date: Wed Mar 19 10:41:54 2014
InstallationDate: Installed on 2013-11-01 (138 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
SourcePackage: gtk+2.0
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Nathan Kennedy (ntk) wrote :
Nathan Kennedy (ntk)
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtk+2.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Terminator maintainer here. We also get hit with this if a user selects a bitmap font in the preferences. You can select it no problem. You can even reopen the prefs. The problem comes when you restart the program. If you /then/ try to open the Prefs, we get the same error as above. This seems to be an issue when the cache has not yet been created maybe, and is a common problem affecting multiple applications. See:
https://bugs.freedesktop.org/show_bug.cgi?id=78787
and appears to be caused by this line:
http://cgit.freedesktop.org/cairo/tree/src/cairo-scaled-font.c#n459
where the asserts were added here:
http://cgit.freedesktop.org/cairo/commit/src/cairo-scaled-font.c?id=b5dcc8ce4450de1e48fd0586fddb5ed658719b28
and seem to somehow be related to working around threading/locking issues.

For info this does NOT happen on Precise (10.04) but DOES happen on Trusty (12.04).

Unfortunately looking at the age of the cairo bug (2014-05-16), and the lack of response (it's still marked NEW) we may not get any kind of progress.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in terminator (Ubuntu):
status: New → Confirmed
Revision history for this message
jpka (jopka) wrote :

Other affected apps:
Latest LibreOffice (Ubuntu 14.04.3 LTS):
soffice.bin: /build/buildd/cairo-1.13.0~20140204/src/cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed.
 (crash on Writer's save dialogue, works well before save)
Latest Gimp (Ubuntu 14.04.3 LTS):
gimp: /build/buildd/cairo-1.13.0~20140204/src/cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed.
gimp: terminated: Aborted
 (but very rarely it starts. Probability increases when dockable windows are closed. But even if it start, walking through menus crash it, at different menu each time, i.e. no particular word or symbol in menu is a problem. Before crash, i am able to draw and save).

I can't use fonts other than bitmap fonts. Please also see Bug #1476736. If these bugs are not going to be fixed, please give me starting point how i can debug and fix it myself. I have enough resources for that.
I can't work without Gimp and especially LO. Thanks.

Revision history for this message
jpka (jopka) wrote :

During further investigation, i found that apps subjected to this bug, starts to work when i downgrade cairo library to one from Ubuntu 12.04 LTS, which version is known to be free from this bug. This is cairo 1.10, libcairo2_1.10.2-6.1ubuntu2_i386.deb. Using it with 'dpkg -i' solves these problems. But adds many other problems: nautilus, synaptic, gedit, and even mc, refuses to work anymore.
So i try to have both libs, and feed only apps subjected to cairo bug, with old library (i extract .deb package as archived file to get old library binary 'libcairo.so.2').
To obtain this, i try LD_PRELOAD.
For gimp and eclipse, i use simple method that works from command line only:

[code]
echo "alias gimp=LD_PRELOAD=/home/test/Downloads/libcairo2_1.10.2-6.1ubuntu2_i386/usr/lib/i386-linux-gnu/libcairo.so.2 gimp" >> ~/.bash_aliases
echo "alias eclipse=LD_PRELOAD=/home/test/Downloads/libcairo2_1.10.2-6.1ubuntu2_i386/usr/lib/i386-linux-gnu/libcairo.so.2 /opt/eclipse/eclipse" >> ~/.bash_aliases
[/code]

For LO, i try to make fully transparent setup which will work also from GUI, Ubuntu Main Menu, etc. NOTE: Using this way, it is NOT possible to open documents with spaces in file name. It is don't care for me; i can't find any possibility to replace '$@' to something supporting spaces.

[code]
sudo rm /usr/bin/soffice # this is just a link
sudo rm /usr/bin/libreoffice # this is just a link
sudo touch /usr/bin/soffice
sudo chmod a+rwx /usr/bin/soffice
sudo echo "LD_PRELOAD=/home/test/Downloads/libcairo2_1.10.2-6.1ubuntu2_i386/usr/lib/i386-linux-gnu/libcairo.so.2 /usr/lib/libreoffice/program/soffice \$@" > /usr/bin/soffice
sudo cp /usr/bin/soffice /usr/bin/libreoffice
[/code]

This all is probably ugly and dirty, but finally let me really switch to Ubuntu 14.04.3 LTS from 12.04 LTS for everyday production use. Thanks.

Revision history for this message
jpka (jopka) wrote :

Other apps affected by cairo bug, and can be fixed with LD_PRELOAD, as in #6:
firefox, chromium-browser, thunderbird (Save as... and File selection dialogs);
paprefs;
gimp's PDF import filter.

To make gimp's PDF import work again, a bit more complex command and more library regression need:
alias gimp='LD_PRELOAD="/home/test/Downloads/libcairo2_1.10.2-6.1ubuntu2_i386/usr/lib/i386-linux-gnu/libcairo.so.2 /home/test/Downloads/libpoppler-glib8_0.18.4-1ubuntu3.1_i386/usr/lib/i386-linux-gnu/libpoppler-glib.so.8 /home/test/Downloads/libpoppler19_0.18.4-1ubuntu3.1_i386/usr/lib/i386-linux-gnu/libpoppler.so.19 /home/test/Downloads/libtiff4_3.9.5-2ubuntu1.8_i386/usr/lib/i386-linux-gnu/libtiff.so.4" gimp'

The required libraries are here http://packages.ubuntu.com/precise/libs/ . I test on i386 OS only.

Revision history for this message
Vlad Orlov (monsta) wrote :

Hi all,

This is a problem in gtk2-engines-murrine package. It happens when you use some bitmap font (like Terminus) and some Murrine-based theme (like Greybird) at the same time. It's known to affect more GTK+2 apps - like mousepad, geany, some apps from xfce4-settings package, some MATE apps, etc.

I'll post a patch for it a bit later.

tags: added: trusty xenial yakkety
removed: saucy
Vlad Orlov (monsta)
affects: gtk+2.0 (Ubuntu) → ubuntu
affects: ubuntu → gtk2-engines-murrine (Ubuntu)
affects: gtk+2.0 (Arch Linux) → archlinux
Revision history for this message
Vlad Orlov (monsta) wrote :

What a mess. For some reason I can't change the Arch Linux entry to point to their gtk-engine-murrine package and to the bug report with patch (https://bugs.archlinux.org/task/48294). Sorry about that.

Revision history for this message
Vlad Orlov (monsta) wrote :

[Impact]

Due to a problem in the Murrine engine, using bitmap fonts and Murrine-based
themes at the same time might lead to crash of various GTK+2 apps. This issue
was around for about 3-4 years, or maybe even more.

It affects a lot of Xfce and MATE users who choose to use bitmap fonts, and
it's present in two current LTS releases, so it would be really nice to apply
the fix there.

The patch which is posted below fixes the crashes for good and allows people
to use bitmap fonts and Murrine-based themes together again.

[Test Case]

Steps to reproduce:

1. Have Xubuntu (or Xfce in any other Ubuntu edition) installed. It can be
   any release from 14.04 to 16.10.
2. Install gtk2-engines-murrine, murrine-themes and shimmer-themes packages,
   if they're not installed.
3. Install some package with bitmap fonts, for example, xfonts-terminus.
4. Run xfce4-appearance-settings and select some Murrine-based theme, for
   example, Greybird or Murrine-Light.
5. Switch to the Fonts tab and select some bitmap font, for example, Terminus.
6. Exit xfce4-appearance-settings.

Now some GTK+2 apps will crash right on start with the following error message:

../../../../src/cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed.

It's reproducible with mousepad, gimp, geany. With some Murrine-based themes,
like Greybird, it's also reproducible with xfce4-panel and Xfce configuration
apps: xfce4-appearance-settings, xfce4-mouse-settings, xfce4-session-settings,
etc.

It also affects some MATE apps, like mate-panel or mate-control-center.

[Regression Potential]

After several months of testing the fix in Debian Jessie and a few Ubuntu
releases, I hadn't found any regressions. Since the patch is very small and
it fixes all the crashes for good, I don't think there's much space for the
regressions.

[Other Info]

Appearance settings being affected is a nasty thing. However, you can reset
the font to default via the console tool:
$ xfconf-query -c xsettings -p /Gtk/FontName -r

The patch was made following the proposed solution at:
https://bugs.freedesktop.org/show_bug.cgi?id=78787#c9

Revision history for this message
Vlad Orlov (monsta) wrote :
tags: added: wily
Revision history for this message
Vlad Orlov (monsta) wrote :

Note: the debdiff posted above can be applied in any Ubuntu release from 14.04 to 16.10, due to the version of gtk2-engines-murrine package being the same in all of them.

Changed in gtk2-engines-murrine (Debian):
status: Unknown → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "This patch fixes crash in gtk2-engines-murrine" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
affects: archlinux → ubuntu-translations
no longer affects: ubuntu-translations
no longer affects: terminator (Ubuntu)
Changed in gtk2-engines-murrine (Ubuntu):
importance: Undecided → Medium
affects: xfdesktop → ubuntu-translations
no longer affects: ubuntu-translations
Revision history for this message
Martin Pitt (pitti) wrote :

Uploaded to yakkety and to the xenial SRU review queue, thank you!

Changed in gtk2-engines-murrine (Ubuntu):
status: Confirmed → Fix Committed
Changed in gtk2-engines-murrine (Ubuntu Xenial):
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Nathan, or anyone else affected,

Accepted gtk2-engines-murrine into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gtk2-engines-murrine/0.98.2-0ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gtk2-engines-murrine (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Vlad Orlov (monsta) wrote :

Thanks - but please don't forget about Trusty users as well.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk2-engines-murrine - 0.98.2-0ubuntu3

---------------
gtk2-engines-murrine (0.98.2-0ubuntu3) yakkety; urgency=medium

  * pango_cairo_update_layout.patch: new patch. Fixes crashes of
    various apps when bitmap font like Terminus is used as default
    system font. (LP: #1294699)

 -- Vlad Orlov <email address hidden> Sat, 20 Feb 2016 10:41:39 +0300

Changed in gtk2-engines-murrine (Ubuntu):
status: Fix Committed → Fix Released
Mathew Hodson (mhodson)
Changed in gtk2-engines-murrine (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Vlad Orlov (monsta) wrote :

I confirm that gtk2-engines-murrine 0.98.2-0ubuntu2.1 from -proposed repo works fine in Xenial, no crashes with Terminus font + Greybird theme.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Rob Peters (makitso) wrote :

In xubuntu 16.04, after this fix, the xfce4 desktop text and shadows are broken. On clean system, use Appearance/Style to change theme and the problem is shown.

Revision history for this message
Vlad Orlov (monsta) wrote :

Is that with Terminus or some non-bitmap font?

Revision history for this message
Vlad Orlov (monsta) wrote :

Currently I don't have Xubuntu 16.04, I've used Ubuntu MATE 16.04 and Xubuntu 14.04 for working on this and testing. So far, I can't reproduce it in Xubuntu 14.04 with various themes and fonts. Shadows on desktop text are fine, the font is white, and there's slight black shadow in case the part of background is light.

Which theme(s) did you use for reproducing it?

Revision history for this message
Rob Peters (makitso) wrote :

Just did some testing and the problem is only with the Nimix theme. Once it is selected the text and shadows diverge. Switching back to another theme makes no difference

Revision history for this message
Rob Peters (makitso) wrote :

Sorry, its the Numix theme.

Revision history for this message
Vlad Orlov (monsta) wrote :

Interesting, I have Numix theme in Xubuntu 14.04 and it doesn't have this problem... must be something in Numix version in 16.04. I suggest filing a bug report about Numix then.

Revision history for this message
Nathan Kennedy (ntk) wrote :

Confirming that my originally reported issue with setting ProFont as Default Font in Xubuntu, still reproduces with xenial, but appears to be fixed in xenial-proposed.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Just like to second Vlad's request to have this put into 14.04 Trusty *LTS* too :-)

Revision history for this message
Kev Bowring (flocculant) wrote :

Can this issue be reproduced in 16.04?

With 14.04 being EOL in a couple of months - that would be important information.

Revision history for this message
Vlad Orlov (monsta) wrote :

14.04 isn't EOL till April 2017, and yes, it can be reproduced there.

Revision history for this message
Vlad Orlov (monsta) wrote :

Sorry, I misread... it can be reproduced in 16.04, at least in Ubuntu MATE edition - I've tested it there.

Revision history for this message
Vlad Orlov (monsta) wrote :

Dammit, April *2019* of course... that's what happens when you have too many distro releases installed :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk2-engines-murrine - 0.98.2-0ubuntu2.1

---------------
gtk2-engines-murrine (0.98.2-0ubuntu2.1) xenial-proposed; urgency=medium

  * pango_cairo_update_layout.patch: new patch. Fixes crashes of
    various apps when bitmap font like Terminus is used as default
    system font. (LP: #1294699)

 -- Vlad Orlov <email address hidden> Sat, 20 Feb 2016 10:41:39 +0300

Changed in gtk2-engines-murrine (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for gtk2-engines-murrine has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Vlad Orlov (monsta) wrote :

Removed Fedora entry since the bug status isn't auto-tracked and the bugfix is already released there.

no longer affects: gtk2-engines-murrine (Fedora)
Revision history for this message
Vlad Orlov (monsta) wrote :

Dear maintainers, please consider applying SRU for Trusty as well. The same debdiff can be reused for it.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

I am re-opening this bug since the fix for this bug caused regressions. See bug 1598316.

Changed in gtk2-engines-murrine (Ubuntu):
status: Fix Released → Triaged
Changed in gtk2-engines-murrine (Ubuntu Xenial):
status: Fix Released → Triaged
Revision history for this message
Jeremy Bícha (jbicha) wrote :

We've ended up re-enabling the original patch for Ubuntu 18.04 Alpha "Bionic". The only theme that I am aware of that is affected is Vertex which appears to not being actively developed this year. If someone cares, they should copy the fix from the Arc theme.

https://github.com/horst3180/arc-theme/issues/607

Vertex is not packaged in Debian or Ubuntu.

Changed in gtk2-engines-murrine (Ubuntu):
status: Triaged → Fix Released
Mathew Hodson (mhodson)
description: updated
Revision history for this message
Vlad Orlov (monsta) wrote :

Ok. But sorry, I won't be able to provide the proper fix for Xenial. The only fix I know is the one that caused the mentioned regressions.

Norbert (nrbrtx)
tags: removed: trusty wily yakkety
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.