After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627764 - mismanaged GtkStyle lifecycle
mismanaged GtkStyle lifecycle
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.25.x
Other Linux
: High critical
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 628796 (view as bug list)
Depends on:
Blocks: 612484
 
 
Reported: 2010-08-23 20:17 UTC by Pedro Villavicencio
Modified: 2011-05-04 11:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32



Description Pedro Villavicencio 2010-08-23 20:17:09 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/622973

"crashed after disabling the desktop effects, meaning launching metacity --replace"

".
Hilo 4 (Thread 11325):
  • #0 __kernel_vsyscall
  • #1 read
    at ../sysdeps/unix/syscall-template.S line 82
  • #2 read
    at //usr/include/bits/unistd.h line 45
  • #3 child_watch_helper_thread
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 3981
  • #4 g_thread_create_proxy
    at /build/buildd/glib2.0-2.25.14/glib/gthread.c line 1897
  • #5 start_thread
    at pthread_create.c line 304
  • #6 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 __kernel_vsyscall
  • #1 *__GI___poll
    at ../sysdeps/unix/sysv/linux/poll.c line 87
  • #2 g_poll
    at /build/buildd/glib2.0-2.25.14/glib/gpoll.c line 126
  • #3 g_main_context_poll
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 3063
  • #4 g_main_context_iterate
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2745
  • #5 g_main_loop_run
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2958
  • #6 shared_thread_func
    at /build/buildd/glib2.0-2.25.14/gio/gdbusprivate.c line 248
  • #7 g_thread_create_proxy
    at /build/buildd/glib2.0-2.25.14/glib/gthread.c line 1897
  • #8 start_thread
    at pthread_create.c line 304
  • #9 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 __kernel_vsyscall
  • #1 pthread_cond_timedwait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S line 236
  • #2 g_cond_timed_wait_posix_impl
    at /build/buildd/glib2.0-2.25.14/gthread/gthread-posix.c line 242
  • #3 g_async_queue_pop_intern_unlocked
    at /build/buildd/glib2.0-2.25.14/glib/gasyncqueue.c line 423
  • #4 g_async_queue_timed_pop
    at /build/buildd/glib2.0-2.25.14/glib/gasyncqueue.c line 549
  • #5 g_thread_pool_wait_for_new_pool
    at /build/buildd/glib2.0-2.25.14/glib/gthreadpool.c line 170
  • #6 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.25.14/glib/gthreadpool.c line 373
  • #7 g_thread_create_proxy
    at /build/buildd/glib2.0-2.25.14/glib/gthread.c line 1897
  • #8 start_thread
    at pthread_create.c line 304
  • #9 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 type_get_qdata_L
    at /build/buildd/glib2.0-2.25.14/gobject/gtype.c line 3616
  • #1 type_check_is_value_type_U
    at /build/buildd/glib2.0-2.25.14/gobject/gtype.c line 4082
  • #2 g_type_check_is_value_type
    at /build/buildd/glib2.0-2.25.14/gobject/gtype.c line 4109
  • #3 g_value_type_compatible
    at /build/buildd/glib2.0-2.25.14/gobject/gvalue.c line 500
  • #4 g_value_object_collect_value
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 2873
  • #5 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2958
  • #6 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #7 gtk_widget_set_style_internal
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 6961
  • #8 vte_terminal_realize
    at /build/buildd/vte-0.25.90/./src/vte.c line 8781
  • #9 terminal_screen_realize
    at terminal-screen.c line 301
  • #10 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #11 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #12 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #13 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #14 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #15 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #16 IA__gtk_widget_realize
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3528
  • #17 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3402
  • #18 gtk_box_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkbox.c line 1251
  • #19 IA__gtk_container_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 1520
  • #20 gtk_container_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 2690
  • #21 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #22 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #23 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #24 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #25 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #26 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #27 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3404
  • #28 gtk_box_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkbox.c line 1261
  • #29 IA__gtk_container_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 1520
  • #30 gtk_container_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 2690
  • #31 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #32 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #33 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #34 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #35 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #36 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #37 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3404
  • #38 gtk_notebook_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtknotebook.c line 1747
  • #39 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #40 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #41 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #42 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #43 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #44 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #45 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3404
  • #46 gtk_box_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkbox.c line 1261
  • #47 IA__gtk_container_forall
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 1520
  • #48 gtk_container_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkcontainer.c line 2690
  • #49 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #50 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #51 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #52 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #53 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #54 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #55 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3404
  • #56 gtk_window_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwindow.c line 4608
  • #57 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #58 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #59 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #60 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #61 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #62 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #63 IA__gtk_widget_map
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3404
  • #64 gtk_window_show
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwindow.c line 4572
  • #65 terminal_window_show
    at terminal-window.c line 2255
  • #66 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #67 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 877
  • #68 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #69 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3182
  • #70 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #71 g_signal_emit
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3040
  • #72 IA__gtk_widget_show
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkwidget.c line 3212
  • #73 terminal_window_composited_changed_cb
    at terminal-window.c line 1687
  • #74 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.25.14/gobject/gmarshal.c line 79
  • #75 g_closure_invoke
    at /build/buildd/glib2.0-2.25.14/gobject/gclosure.c line 766
  • #76 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3252
  • #77 g_signal_emit_valist
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 2983
  • #78 g_signal_emit_by_name
    at /build/buildd/glib2.0-2.25.14/gobject/gsignal.c line 3077
  • #79 _gdk_x11_screen_process_owner_change
    at /build/buildd/gtk+2.0-2.21.6/gdk/x11/gdkscreen-x11.c line 1228
  • #80 gdk_event_translate
    at /build/buildd/gtk+2.0-2.21.6/gdk/x11/gdkevents-x11.c line 2105
  • #81 _gdk_events_queue
    at /build/buildd/gtk+2.0-2.21.6/gdk/x11/gdkevents-x11.c line 2310
  • #82 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.21.6/gdk/x11/gdkevents-x11.c line 2371
  • #83 g_main_dispatch
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2119
  • #84 g_main_context_dispatch
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2672
  • #85 g_main_context_iterate
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2750
  • #86 g_main_loop_run
    at /build/buildd/glib2.0-2.25.14/glib/gmain.c line 2958
  • #87 IA__gtk_main
    at /build/buildd/gtk+2.0-2.21.6/gtk/gtkmain.c line 1237
  • #88 main
    at terminal.c line 592

Comment 1 Christian Persch 2010-08-23 20:25:49 UTC
Which g-t and vte version is this, exactly? Are there any messages on console (or in ~/.xsession-errors) from gnome-terminal ? And which theme ?
Comment 2 Christian Persch 2010-08-23 20:27:01 UTC
Oh, and was that with metacity launching with compositing enabled, or disabled? (gconf key /apps/metacity/general/compositing_manager)
Comment 3 Pedro Villavicencio 2010-08-23 20:34:25 UTC
libvte is 1:0.25.90-0ubuntu3 
gnome-terminal : 2.31.90-0ubuntu1

the messages on the ~/.xsession-errors file:

gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `style->attach_count > 0' failed

(gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_attach: assertion `GTK_IS_STYLE (style)' failed

(gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

the theme i'm currently using is clearlooks.

And it was launched with the compositing disabled. Thank you for the quick reply!.
Comment 4 Christian Persch 2010-08-23 20:54:24 UTC
Hmm, that shouldn't happen, ever. Possibly a theme bug, or gtk.
Comment 5 Christian Persch 2010-08-23 21:04:35 UTC
One more thing: which gtk modules are loaded? (from gconf key/apps/gnome_settings_daemon/gtk-modules, and various env vars) E.g. & esp. the ubuntu dbusmenu (or whatever it's called) thingy?
Comment 6 Pedro Villavicencio 2010-08-24 12:30:26 UTC
just the accessibility is loaded (gail:atk-bridge). Thanks again Christian.
Comment 7 Christian Persch 2010-08-24 13:14:46 UTC
This code from commit ac1e78c78e6a39834d35c525be01d50c348d33ba from bug 612484 looks highly suspicious:

        /* Remove the GDK window. */
-       if (widget->window != NULL) {
+       if (window != NULL) {
                /* detach style */
-               gtk_style_detach(widget->style);
+               GtkStyle *style;
 
-               gdk_window_set_user_data(widget->window, NULL);
-               gdk_window_destroy(widget->window);
-               widget->window = NULL;
+               style = gtk_widget_get_style (widget);
+               gtk_style_detach (style);
+
+               gdk_window_set_user_data (window, NULL);
+               gtk_widget_set_window (widget, NULL);
+
+               gdk_window_destroy (window);
        }
[...]

-       widget->style = gtk_style_attach(widget->style, widget->window);
+       style = gtk_widget_get_style (widget);
+       style = gtk_style_attach (style, window);
+       gtk_widget_set_style (widget, style);

Is this code really completely equivalent to the previous code? AFAICT gtk_widget_set_style does more than just setting widget->style. This part should use gtk_widget_style_attach() instead.
Comment 8 Kristian Høgsberg 2010-08-24 14:12:22 UTC
(In reply to comment #7)
> This code from commit ac1e78c78e6a39834d35c525be01d50c348d33ba from bug 612484
> looks highly suspicious:
> 
>         /* Remove the GDK window. */
> -       if (widget->window != NULL) {
> +       if (window != NULL) {
>                 /* detach style */
> -               gtk_style_detach(widget->style);
> +               GtkStyle *style;
> 
> -               gdk_window_set_user_data(widget->window, NULL);
> -               gdk_window_destroy(widget->window);
> -               widget->window = NULL;
> +               style = gtk_widget_get_style (widget);
> +               gtk_style_detach (style);
> +
> +               gdk_window_set_user_data (window, NULL);
> +               gtk_widget_set_window (widget, NULL);
> +
> +               gdk_window_destroy (window);
>         }
> [...]

This part looks fine, though a gtk_widget_style_detach() helper function would be a nice addition to gtk+ for symmetry with gtk_widget_style_attach().

 
> -       widget->style = gtk_style_attach(widget->style, widget->window);
> +       style = gtk_widget_get_style (widget);
> +       style = gtk_style_attach (style, window);
> +       gtk_widget_set_style (widget, style);
> 
> Is this code really completely equivalent to the previous code? AFAICT
> gtk_widget_set_style does more than just setting widget->style. This part
> should use gtk_widget_style_attach() instead.

Yeah, it looks like gtk_widget_set_style() is the wrong function to use here, while gtk_widget_style_attach() does exactly what the old code did.  Try this patch?

diff --git a/src/vte.c b/src/vte.c
index abf7473..2464880 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -8776,9 +8776,7 @@ vte_terminal_realize(GtkWidget *widget)
     }
 #endif /* GTK >= 2.15.1 */
 
-       style = gtk_widget_get_style (widget);
-       style = gtk_style_attach (style, window);
-       gtk_widget_set_style (widget, style);
+       gtk_widget_style_attach (widget);
 
        vte_terminal_ensure_font (terminal);
Comment 9 Christian Persch 2010-08-29 12:00:11 UTC
I committed that fix. Let's see if that fixes this problem...
Comment 10 Christian Persch 2010-09-04 21:47:04 UTC
*** Bug 628796 has been marked as a duplicate of this bug. ***
Comment 11 Christian Persch 2011-05-04 11:57:10 UTC
No dups in a long time; let's assume this fixed it.