Re: Tricks of the trade



On Tue, Feb 22, 2005 at 20:45:18 +0000, Russel Winder wrote:
> I suspect this question labels me as a total newbie but...
> 
> I have a libglademm, GTKmm based program that uses Pango and Fontconfig.
> Earlier versions of the program have worked fine except for coming
> across Pango issues which the current incarnation is trying to
> circumvent.  The program compiles and links fine then on executing it
> issues the error:
> 
> (process:16588): GLib-GObject-CRITICAL **: gtype.c:2254: initialization assertion failed, use IA__g_type_init() prior to this function
> 
> but nonetheless displays the windows as expected.  Indeed all the
> behaviour of the main window itself is fine.  Of course there is an
> action that uses the state that has not been initialized that when
> activated makes things go totally crazy but that is only to be expected
> given the incorrect initialization that has happened.
> 
> The question is:  How do you backtrack from the fact that there is a GTK
> initialization problem to the feature of the perfectly legal C++ code
> that is not correct.   I am hoping that the answer does not involve
> divination and rat entrails but instead there is a more rational way of
> finding the problem.

First of all, you should get a backtrace to see which part of code
causes that message. The message is going through function g_logv, so
you can put a breakpoint on that and get a backtrace when it's hit.

Then go through the functions listed in the backtrace that could be
suspect of the problem and sanity-check them.

When you are on the breakpoint, you can also inspect local variables of
all the functions on the stack. So you should look which object causes
the error and check it's construction and such.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature



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