GNOME Bugzilla – Bug 325550
g_logv [gmessage.c] crash various apps
Last modified: 2013-09-13 01:00:54 UTC
I found out that Evolution from CVS HEAD crashes permanently during startup. After debugging I figured out that the backtrace leads to gmessage.c line 503 which points to: g_private_set (g_log_depth, GUINT_TO_POINTER(depth)); I then recompiled glib by always returning from the function as seen below and Evolution and some other programs kept working again. Might be that something is wrong with this function ? void g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args1) { gboolean was_fatal = (log_level & G_LOG_FLAG_FATAL) != 0; gboolean was_recursion = (log_level & G_LOG_FLAG_RECURSION) != 0; gint i; log_level &= G_LOG_LEVEL_MASK; if (!log_level) return; return; <----- my return for (i = g_bit_nth_msf (log_level, -1); i >= 0; i = g_bit_nth_msf (log_level, i)) { register GLogLevelFlags test_level; test_level = 1 << i; if (log_level & test_level) { guint depth = GPOINTER_TO_UINT (g_private_get (g_log_depth)); GLogDomain *domain; GLogFunc log_func; GLogLevelFlags domain_fatal_mask; gpointer data = NULL; if (was_fatal) test_level |= G_LOG_FLAG_FATAL; if (was_recursion) test_level |= G_LOG_FLAG_RECURSION; /* check recursion and lookup handler */ g_mutex_lock (g_messages_lock); domain = g_log_find_domain_L (log_domain ? log_domain : ""); if (depth) test_level |= G_LOG_FLAG_RECURSION; depth++; domain_fatal_mask = domain ? domain->fatal_mask : G_LOG_FATAL_MASK; if ((domain_fatal_mask | g_log_always_fatal) & test_level) test_level |= G_LOG_FLAG_FATAL; if (test_level & G_LOG_FLAG_RECURSION) log_func = _g_log_fallback_handler; else log_func = g_log_domain_get_handler_L (domain, test_level, &data); domain = NULL; g_mutex_unlock (g_messages_lock); g_private_set (g_log_depth, GUINT_TO_POINTER (depth)); /* had to defer debug initialization until we can keep track of recursion */ if (!(test_level & G_LOG_FLAG_RECURSION) && !_g_debug_initialized) { GLogLevelFlags orig_test_level = test_level; _g_debug_init (); if ((domain_fatal_mask | g_log_always_fatal) & test_level) test_level |= G_LOG_FLAG_FATAL; if (test_level != orig_test_level) { /* need a relookup, not nice, but not too bad either */ g_mutex_lock (g_messages_lock); domain = g_log_find_domain_L (log_domain ? log_domain : ""); log_func = g_log_domain_get_handler_L (domain, test_level, &data); domain = NULL; g_mutex_unlock (g_messages_lock); } } if (test_level & G_LOG_FLAG_RECURSION) { /* we use a stack buffer of fixed size, since we're likely * in an out-of-memory situation */ gchar buffer[1025]; gint size; size = _g_vsnprintf (buffer, 1024, format, args1); log_func (log_domain, test_level, buffer, data); } else { gchar *msg = g_strdup_vprintf (format, args1); log_func (log_domain, test_level, msg, data); g_free (msg); } if (test_level & G_LOG_FLAG_FATAL) { #ifdef G_OS_WIN32 gchar *locale_msg = g_locale_from_utf8 (fatal_msg_buf, -1, NULL, NULL, NULL); MessageBox (NULL, locale_msg, NULL, MB_ICONERROR|MB_SETFOREGROUND); if (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION)) G_BREAKPOINT (); abort (); #else #if defined (G_ENABLE_DEBUG) && defined (SIGTRAP) if (!(test_level & G_LOG_FLAG_RECURSION)) G_BREAKPOINT (); else abort (); #else /* !G_ENABLE_DEBUG || !SIGTRAP */ abort (); #endif /* !G_ENABLE_DEBUG || !SIGTRAP */ #endif /* !G_OS_WIN32 */ } depth--; g_private_set (g_log_depth, GUINT_TO_POINTER (depth)); } } }
Hard to say, without at least a stacktrace. Evolution 2.5.3 starts up fine with glib HEAD here...
galaxy@ulixys:~ > gdb evolution GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /usr/local/bin/evolution [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 1867)] (evolution:1867): camel-WARNING **: camel_exception_get_id called with NULL parameter. [New Thread 32769 (LWP 1870)] [New Thread 16386 (LWP 1871)] [New Thread 32771 (LWP 1872)] [New Thread 49156 (LWP 1873)] [New Thread 65541 (LWP 1874)] [New Thread 81926 (LWP 1875)] Bonobo-CRITICAL **: bonobo_ui_component_set_prop: assertion `BONOBO_IS_UI_COMPONENT (component)' failed aborting... Program received signal SIGTRAP, Trace/breakpoint trap.
+ Trace 64925
Thread 16384 (LWP 1867)
argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\0', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}} client = (GConfClient *) 0x80a36f0 skip_warning_dialog = 1 uri_list = (GSList *) 0x0 popt_context_value = {g_type = 0, data = {{v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}} program = (GnomeProgram *) 0x806e1b0 popt_context = 0x8074140 args = (const char **) 0x0 icon_list = (GList *) 0x80ca1a0 filename = 0x805f020 "U\211\uffff\203\uffff\030\211]\uffff\uffffO" (gdb) q The program is running. Exit anyway? (y or n) y galaxy@ulixys:~ >
Believe this is the announced abort-on-critical error change after 2006-01-01 set by gnome-session. Does the following: putenv ("G_DEBUG=fatal_criticals"); g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
Yes. Its time for evolution to start caring about the critical warnings it spews...
Was this indeed FIXED?
Sorry, didn't mean to close this.
I've altered a handful of values - hope you don't mind. Crashes are usually critical somehow.
How do you reproduce the bug? Just by switching components in Evolution? In any case, this is pretty bad - look at frames 3, 4, 5 in the stack trace. The critical warning means Evolution is passing an invalid BonoboUIComponent to the Bonobo functions. It's most likely calling bonobo_ui_component_*() functions before the component is activated, so there is no UIC yet (see emfv_activate()).
emfv_setting_notify() probably just needs to check for emfv->uic != NULL before calling bonobo_ui_component_*() functions on it. emfv_activate() will change the properties of the UI elements as appropriate.
Please not this is a "critical warning" bug, which is a crasher since 01/01/2006 in CVS. Adjusting Priority.
Sorry, but I am getting this with other applications as well, such as Nautilus when pointing the mouse on the "Go" menu item and various other apps. I had to put an explicit return in g_logv inside glib code to have the apps working "normally" again.
(In reply to comment #11) > Sorry, but I am getting this with other applications as well, such as Nautilus > when pointing the mouse on the "Go" menu item and various other apps. I had to > put an explicit return in g_logv inside glib code to have the apps working > "normally" again. This indicates a bug in Nautilus or in one of the underlying libraries --- this is exactly the kind of bugs we want to catch early with the crash-on-critical-warning thing. Could you please file a bug with a stack trace for Nautilus? Thanks :)
Or you could just patch gnome-session so it doesn't use G_DEBUG=fatal_criticals instead if you don't want this to happen. We're slowly fixing the critical warnings though and I'm able to run my desktop most of the time without problems these days. (Unless I enable a11y that is :-)
Created attachment 60000 [details] [review] Fix for the crash.
Ali, does this patch fix it for you?
seems like bug 325375 is a duplicate, so confirming this here. (dunno why #325375 was closed as fixed though.)
ali: does the patch by veerapuram work for you?
Ali? Setting to NEEDINFO.
Greetings! Sorry for the big delay, but I've been busy with my new job and thus hadn't had time dealing with all this. I now had time last weekend to compile a new GNOME from CVS and I so far can confirm that this problem has been solved.
Thanks for checking