Re: GtkOptionMenu, GtkComboBox




On Nov 9, 2005, at 12:39 AM, Luke Moloney wrote:

I tried a tarball install of 1.100 and 1.101, the most recent "stable" releases. It compiles OK, but fails the "make test" with thousands of this error:

(process:2517): GLib-GObject-CRITICAL **: gtype.c:2254: initialization assertion failed, use g_type_init() prior to this function


I haven't managed to reproduce this.

Mac OS X 10.4.3
gtk+ 2.4.9-8 (fink)
Glib 1.100 (source)
Gtk2 1.100 (source)


Glib passes all tests cleanly.
Gtk2 chokes on three tests:
- t/GtkComboBoxEntry.t claims that Gtk2::CellEditable is not in the type ancestry for ComboBoxEntry. - t/GtkFileChooser.t has problems, but we've had a hell of a time making this one work reliably across versions and operating systems. - t/GtkIconTheme.t fails because gtk+ can't find some icons -- again, a troublesome test, like the FileChooser one.


The message string, "initialization assertion failed, use g_type_init () prior to this function", comes from the macro g_return_val_if_uninitialized(), in glib/gobject/gtype.c. This macro appears at the top of g_type_register_fundamental(), g_type_register_static(), and g_type_register_dynamic().

What's perplexing about this is that g_type_init() is the first thing called by the BOOT section of Glib.xs. Glib.pm is carefully arranged such that no calls to gobject-related stuff happen before the module calls its bootstrap code. Similarly, Gtk2.pm 'use's Glib to ensure that Glib is loaded and bootstrapped before Gtk2 tries to bootstrap itself.

The fact that you're getting this message means that g_type_init() isn't being called first, which means things are out of order.

Try making sure everything is executing in the proper order. Because of annoyances with shared libraries and gdb breakpoints, your best bet is low-tech -- print statements. Specifically, use "print STDERR" in perl and g_printerr() in C, to make sure you're using unbuffered stderr (some of the tests connect to $SIG{_WARN_} to verify error output, so don't use warn().). Add a print at the top of BOOT in Glib.xs (next to g_type_init()), before and after the bootstrap in Glib.pm, and similarly in Gtk2.pm. With these sentinels sprinkled around the code, you can then run some of the tests again and find out roughly at what point the message is coming out.

--
Eight, eight, eight, eight ounces to gooooo, you're gonna be sedated!
  -- Elysse, singing while feeding rice cereal formula to
    fussy infant Yvonne




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