Bug#607557: backtrace with gnome-panel debug symbols

Bastien bastien0705 at aol.com
Thu Dec 30 14:30:28 UTC 2010


Le 30/12/2010 14:36, Josselin Mouette a écrit :
> Le mercredi 29 décembre 2010 à 16:36 +0100, Bastien a écrit :
>    
>> That's a bug in the library. Even the simplest code I write using
>> Gnome::Panel::Applet causes a segfault, but that works fine if I use the
>> C libpanel-applet library directly.
>>
>> I used gdb on the test-bonobo-applet program provided with
>> libpanel-applet. This time, gdk_display isn't NULL. I don't know where
>> gdk_display is set, but the issue in libpanelappletmm comes from there.
>>      
> It should be set by running gtk_init(). If it’s not in example, that’s
> obviously a bug in it, not in the library.
>
> Cheers,
>    

libpanelappletmm is a C++ library using gtkmm, which is a wrapper for 
GTK+. Having to call gtk_init directly when using libpanelappletmm would 
be a design flaw. Look at the source of some gtkmm-based programs : they 
don't call gtk_init, instead they create a Gtk::Main which calls it.

The example calls Gnome::Panel::init. This function should initializes 
every needed component (so gtk as well).
Looking at libpanelappletmm's source, Gnome::Panel::init just calls 
Gtk::Main::init_gtkmm_internals, which doesn't call gtk_init.
Gnome::Panel::init should create (and keep) an Gtk::Main instance, so 
gtk_init get called.

I provided a patch. The example applets now fully work. (Note there's 
maybe a better way to store the Gtk::Main)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20101230/83afc6da/attachment.txt>


More information about the pkg-gnome-maintainers mailing list