Enabling titlebar-uses-system-font crashes GWD (Metacity 3.14.3 back-end)

Bug #1404054 reported by Rob McCathie on 2014-12-18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Alberts Muktupāvels
compiz (Ubuntu)

Bug Description

Enabling the titlebar-uses-system-font dconf/gsetting at org.gnome.desktop.wm.preferences causes the GTK Window Decorator to segfault.

This is occurring with the new Metacity3 support, using Metacity 3.14.3 as back-end for GWD.
This does not occur using Metacity 3.14.3 itself.
This does not occur with Compiz using Metacity 2.34.13 as back-end for GWD.

Distro(s): Arch Linux, Manjaro Linux (Arch-based)

At the time of writing, the last 25 or so comments here are related:

Currently i have this confirmed by 5 users (including myself) on Arch/Manjaro.

Related branches

Stephen M. Webb (bregma) wrote :

Would it be possible to attach a gdb stack backtrace of the crash?

Changed in compiz:
importance: Undecided → High
status: New → Incomplete
Rob McCathie (korrode) wrote :

I spoke to the author (or one of the authors at least) of the GTK3/Metacity3 support.

They said they were busy currently but that i could try reverting the changes made to gtk/window-decorator/decorator.c from this merge:

I did this and it appears to have worked fine. I can now use the "titlebar-uses-system-font" setting.

Here's the reversal of those changes:

-----patch starts-----

diff -Naur a/gtk/window-decorator/decorator.c b/gtk/window-decorator/decorator.c
--- a/gtk/window-decorator/decorator.c 2014-11-07 00:07:52.000000000 +1100
+++ b/gtk/window-decorator/decorator.c 2014-12-19 22:27:36.160876989 +1100
@@ -139,23 +139,18 @@
 frame_update_titlebar_font (decor_frame_t *frame)
     const PangoFontDescription *font_desc;
- PangoFontDescription *free_font_desc;
- PangoFontMetrics *metrics;
- PangoLanguage *lang;
+ PangoFontMetrics *metrics;
+ PangoLanguage *lang;

- free_font_desc = NULL;
     frame = gwd_decor_frame_ref (frame);

     font_desc = get_titlebar_font (frame);
     if (!font_desc)
- GtkCssProvider *provider = gtk_css_provider_get_default ();
- GtkStyleContext *context = gtk_style_context_new ();
+ GtkStyle *default_style;

- gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
- gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL, "font", &free_font_desc, NULL);
- font_desc = (const PangoFontDescription *) free_font_desc;
+ default_style = gtk_widget_get_default_style ();
+ font_desc = default_style->font_desc;

     pango_context_set_font_description (frame->pango_context, font_desc);
@@ -169,9 +164,6 @@
     gwd_decor_frame_unref (frame);

     pango_font_metrics_unref (metrics);
- if (free_font_desc)
- pango_font_description_free (free_font_desc);


-----patch ends-----

Nonetheless, i'll provide a gdb backtrace shortly.

Rob McCathie (korrode) wrote :
Download full text (4.2 KiB)

$ gdb gtk-window-decorator
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gtk-window-decorator...done.
(gdb) run
Starting program: /usr/bin/gtk-window-decorator
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

** (gtk-window-decorator:5050): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[New Thread 0x7fffe8e4c700 (LWP 5054)]
[New Thread 0x7fffe3fff700 (LWP 5055)]

(gtk-window-decorator:5050): Pango-CRITICAL **: pango_font_description_from_string: assertion 'str != NULL' failed

(gtk-window-decorator:5050): Pango-CRITICAL **: pango_font_description_get_size: assertion 'desc != NULL' failed

(gtk-window-decorator:5050): Pango-CRITICAL **: pango_font_description_set_size: assertion 'desc != NULL' failed

(gtk-window-decorator:5050): Gtk-CRITICAL **: gtk_style_context_get_property: assertion 'priv->widget != NULL || priv->widget_path != NULL' failed

(gtk-window-decorator:5050): GLib-GObject-WARNING **: gtype.c:4221: type id '0' is invalid

(gtk-window-decorator:5050): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e09aa3 in gtk_style_context_get_valist () from /usr/lib/libgtk-3.so.0
(gdb) bt
#0 0x00007ffff6e09aa3 in gtk_style_context_get_valist () from /usr/lib/libgtk-3.so.0
#1 0x00007ffff6e09d63 in gtk_style_context_get () from /usr/lib/libgtk-3.so.0
#2 0x000000000041b8bb in frame_update_titlebar_font (frame=frame@entry=0x71ed00)
    at /home/korrode/builds/compiz-manjaro/compiz-manjaro-debug/src/compiz-
#3 0x0000000000410ad3 in decor_frame_refresh (frame=0x71ed00)
    at /home/korrode/builds/compiz-manjaro/compiz-manjaro-debug/src/compiz-
#4 0x0000000000410c52 in gwd_get_decor_frame (frame_name=0x4222b9 "bare")
    at /home/korrode/builds/compiz-manjaro/compiz-manjaro-debug/src/compiz-
#5 0x000000000041cea8 in update_default_decorations (screen=0x6bc0d0)
    at /home/korrode/builds/compiz-manjaro/compiz-manjaro-debug/s...


Changed in compiz:
status: Incomplete → Confirmed
Stephen M. Webb (bregma) on 2014-12-19
Changed in compiz:
milestone: none →
status: Confirmed → In Progress
assignee: nobody → Alberts Muktupāvels (albertsmuktupavels)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:

compiz (1: vivid; urgency=low

  [ Alberts Muktupāvels ]
  * Fix crash with titlebar-uses-system-font enabled. LP: #1404054 (LP:
 -- Ubuntu daily release <email address hidden> Fri, 19 Dec 2014 15:22:37 +0000

Changed in compiz (Ubuntu):
status: New → Fix Released
Stephen M. Webb (bregma) on 2014-12-19
Changed in compiz:
status: In Progress → Fix Committed
Stephen M. Webb (bregma) on 2015-02-03
Changed in compiz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers