Re: Bug#291480: libgtk2-gladexml-perl: assertion 'G_IS_OBJECT' fails and program segfaults




On Jan 21, 2005, at 3:49 PM, Marc 'HE' Brockschmidt wrote:

If I try to load the following glade file, kww.glade, with the following perl script, kww.pl, I get a segfault:

GLib-GObject-CRITICAL **: file gobject.c: line 1222 (g_object_get): assertion `G_IS_OBJECT (object)' failed at ./viewer.pl line 34. GLib-GObject-CRITICAL **: file gobject.c: line 1222 (g_object_get): assertion `G_IS_OBJECT (object)' failed at ./viewer.pl line 34.
Segmentation fault

I hate to say it, but it's not our bug; it's a programming error in the perl script, and possibly lack of robustness in libgnomeui.


A backtrace taken against a gnome CVS build shows a NULL instance being passed to g_object_get() from gnome_app_instance_init():

#3  0x00528c87 in IA__g_object_get (_object=0x0,
    first_property_name=0xdacc2b "default-icon") at gobject.c:1228
#4 0x00d6d769 in gnome_app_instance_init (app=0x9de8ba8) at gnome-app.c:219

The line in question is

gnome-app.c:291:        g_object_get (G_OBJECT (gnome_program_get ()),

gnome_program_get() returns NULL unless you have previously called gnome_program_init().


Indeed, the documentation for libglade says:

While no additional libglade initialisation is required to use a module, however, the underlying library might need initialisation. For instance, to use libgnomeui widgets from libglade, you _must_ call gnome_program_init beforehand.

(http://developer.gnome.org/doc/API/2.0/libglade/libglade-modules.html)


Adding these two lines to the example kww.pl:

        use Gnome2;
        Gnome2::Program->init ('test', 'foo');

solved the problem on my machine.


(with the bigger program/glade file this is distilled from, it used to work, before updates)

What sort of updates?


--
To me, "hajime" means "the man standing opposite you is about to hit you with a stick".
  -- Ian Malpass, speaking of the Japanese word for "the beginning"




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]