Re: [gtk-list] Re: misleading error messages from style/set_nameproblems



On Fri, 19 Mar 1999, Damon Chaplin wrote:

> Paul Barton-Davis wrote:
> > 
> > I'm getting quite a few of these (glib-1.2.0, gtk+-1.2.0, Gtk---1.0.0)
> > 
> > Gtk-CRITICAL **: file gtkobject.c: line 1037 (gtk_object_get_data):
> >                                assertion `GTK_IS_OBJECT (object)' failed.
> > 
> > Gtk-WARNING **: invalid class type `gchar' in cast to `GtkObject'
> 
> 
> A good way to find out where this is happening is to do this after calling
> gtk_init():
> 
>   g_log_set_fatal_mask ("g_log_domain_glib", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);

this should be
g_log_set_fatal_mask (g_log_domain_glib, G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
or
g_log_set_fatal_mask ("GLib", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
because g_log_domain_glib is just a global variable pointing to "GLib":

/usr/src/glib/gmessages.c:const gchar        *g_log_domain_glib = "GLib";

>   g_log_set_fatal_mask ("Gdk", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
>   g_log_set_fatal_mask ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
>   g_log_set_fatal_mask (NULL, G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
> 

besides, this very effect can simply be achived by passing
-g-fatal-warnings on the command line to any gtk program.

> Then the warning messages cause an abort() and you can use gdb to find out
> exactly where it happened.
> 
> (By the way, should the log domain names be standardized?)

they are pretty much, the only thing i'm wondering is whether we'd want
to use "Gtk+" instead of "Gtk" as log domain.

> 
> Damon
> 

---
ciaoTJ



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