! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Infinite recursion in launcher code leading to panel crash
Status:
RESOLVED: FIXED
Severity:
critical
Product:
Xfce4-panel

Comments

Description Olivier Fourdan editbugs 2008-10-14 12:47:20 CEST
Created attachment 1890 
PAtch to avoid recursion in the launcher_utility_icon_theme_changed() callback

The panel has a nasty recursion bug in the launcher when run with gtk+2.10

Step to reproduce:

1) Build xfce4-panel against gtk-+2.10
2) Setup a full width panel with only one launcher
3) Restart the panel, it crashes.

The backtrace shows an infinite recursion:

    #0  0x0707b0ad in g_object_set () from /lib/libgobject-2.0.so.0
    #1  0x07078d0b in g_object_newv () from /lib/libgobject-2.0.so.0
    #2  0x0707986e in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #3  0x07079a20 in g_object_new () from /lib/libgobject-2.0.so.0
    #4  0x073c5327 in gtk_icon_theme_new () from /usr/lib/libgtk-x11-2.0.so.0
    #5  0x073c53d5 in gtk_icon_theme_get_for_screen () from /usr/lib/libgtk-x11-2.0.so.0
    #6  0x00e391c5 in launcher_utility_load_pixbuf (screen=0x8f1a0d0, name=0x8f57e48 "utilities-terminal", size=16) at launcher.c:203
    #7  0x00e392aa in launcher_icon_button_set_icon (launcher=0x8f4bfa8) at launcher.c:352
    #8  0x00e39461 in launcher_utility_icon_theme_changed (ihint=0xbf38941c, n_param_values=1, param_values=0xbf38950c, launcher=0x8f4bfa8)
        at launcher.c:115
    #9  0x07084c5e in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0
    #10 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
    #11 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0
    #12 0x073c313e in gtk_icon_info_get_type () from /usr/lib/libgtk-x11-2.0.so.0
    #13 0x073c34e1 in gtk_icon_theme_error_quark () from /usr/lib/libgtk-x11-2.0.so.0
    #14 0x073c53e3 in gtk_icon_theme_get_for_screen () from /usr/lib/libgtk-x11-2.0.so.0
    #15 0x00e391c5 in launcher_utility_load_pixbuf (screen=0x8f1a0d0, name=0x8f57e48 "utilities-terminal", size=16) at launcher.c:203
    #16 0x00e392aa in launcher_icon_button_set_icon (launcher=0x8f4bfa8) at launcher.c:352
    #17 0x00e39461 in launcher_utility_icon_theme_changed (ihint=0xbf38990c, n_param_values=1, param_values=0xbf3899fc, launcher=0x8f4bfa8)
        at launcher.c:115
    ...

The patch attached avoid recursions in the launcher_utility_icon_theme_changed() callback.

Olivier.
Comment 1 Jannis Pohlmann editbugs 2008-10-14 13:31:58 CEST
Here's another patch which uses a different approach: It doesn't install a signal emission hook to the GtkIconTheme class but uses gtk_icon_theme_for_screen() and g_signal_connect() to install the icon theme changed callback. 

In Olivier's backtrace you can see that the the GtkIconTheme singleton for the current screen does not yet exist and is created which leads to another 'changed' signal emission. If the singleton is created beforehand this should not be a problem and no infinite recursion should happen.
Comment 2 Jannis Pohlmann editbugs 2008-10-14 13:32:38 CEST
Created attachment 1891 
Patch to replace g_signal_add_emission_hook()
Comment 3 Jannis Pohlmann editbugs 2008-10-14 13:37:01 CEST
Created attachment 1892 
Patch to replace g_signal_add_emission_hook() with something smarter

Oops, the return type needs to be 'void'.
Comment 4 Jannis Pohlmann editbugs 2008-10-14 13:52:57 CEST
I decided to commit it so that we can have the fix in the release. If it breaks anything, get out the whip and blame me.
Comment 5 Jannis Pohlmann editbugs 2008-10-14 13:53:58 CEST
Fixed in revision 28252:

  * launcher/launcher.c: Change the way the icon theme change callback
    is installed: use gtk_icon_theme_for_screen() in combination with
    g_signal_connect() instead of adding a signal emission hook to the
    icon theme class. This should fix bug #4474.
Comment 6 Nick Schermer editbugs 2008-10-14 14:07:38 CEST
Looks good to me (actually: already has this in my local 4.8 branch, but didn't had the time to merge it into trunk).

Bug #4474

Reported by:
Olivier Fourdan
Reported on: 2008-10-14
Last modified on: 2010-02-27

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
4.7 (master)

Attachments

Additional information