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 585089 - Criticals when dropping the last tab from one window into another.
Criticals when dropping the last tab from one window into another.
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
unspecified
Other Linux
: Normal critical
: ---
Assigned To: empathy-maint
: 588799 605015 605519 606566 606567 (view as bug list)
Depends on:
Blocks: 606567
 
 
Reported: 2009-06-07 21:23 UTC by Will Thompson
Modified: 2010-03-04 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Will Thompson 2009-06-07 21:23:49 UTC
When I drag the final tab from one window into another, Empathy criticals:

** (empathy:1693): DEBUG: chat_window_update_chat_tab: Updating chat tab, name=Dafydd Harries, account=jabber0, subject=(null), remote_contact=0x16006b0

(empathy:1693): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GtkImage'

Gtk-CRITICAL **: gtk_image_set_from_icon_name: assertion `GTK_IS_IMAGE (image)' failed
aborting...

  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 88
  • #2 IA__g_logv
    at /tmp/buildd/glib2.0-2.20.3/glib/gmessages.c line 506
  • #3 IA__g_log
    at /tmp/buildd/glib2.0-2.20.3/glib/gmessages.c line 526
  • #4 chat_window_update_chat_tab
    at empathy-chat-window.c line 447
  • #5 chat_window_page_added_cb
    at empathy-chat-window.c line 1121
  • #6 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #7 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3247
  • #8 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2980
  • #9 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3037
  • #10 gtk_notebook_real_insert_page
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtknotebook.c line 4118
  • #11 do_detach_tab
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtknotebook.c line 3496
  • #12 gtk_notebook_drag_data_received
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtknotebook.c line 3559
  • #13 _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmarshalers.c line 2233
  • #14 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #15 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3285
  • #16 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2980
  • #17 IA__g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3074
  • #18 gtk_drag_selection_received
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1605
  • #19 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #20 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3247
  • #21 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2980
  • #22 IA__g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3074
  • #23 gtk_selection_retrieval_report
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkselection.c line 2939
  • #24 IA__gtk_selection_convert
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkselection.c line 1088
  • #25 gtk_drag_dest_drop
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 2172
  • #26 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1777
  • #27 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1762
  • #28 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1762
  • #29 _gtk_drag_dest_handle_event
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1460
  • #30 IA__gtk_main_do_event
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmain.c line 1625
  • #31 gdk_event_dispatch
    at /scratch/build-area/gtk+2.0-2.16.1/gdk/x11/gdkevents-x11.c line 2364
  • #32 IA__g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 1814
  • #33 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 2445
  • #34 IA__g_main_loop_run
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 2653
  • #35 IA__gtk_main
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmain.c line 1205
  • #36 main
    at empathy.c line 629
  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 88
  • #2 IA__g_logv
    at /tmp/buildd/glib2.0-2.20.3/glib/gmessages.c line 506
  • #3 IA__g_log
    at /tmp/buildd/glib2.0-2.20.3/glib/gmessages.c line 526
  • #4 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #5 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3285
  • #6 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2980
  • #7 IA__g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3074
  • #8 gtk_drag_selection_get
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 3691
  • #9 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #10 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3247
  • #11 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2980
  • #12 IA__g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3074
  • #13 gtk_selection_invoke_handler
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkselection.c line 2974
  • #14 IA__gtk_selection_convert
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkselection.c line 1084
  • #15 gtk_notebook_drag_drop
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtknotebook.c line 3446
  • #16 _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmarshalers.c line 411
  • #17 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.20.3/gobject/gclosure.c line 767
  • #18 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3285
  • #19 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 2990
  • #20 IA__g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.20.3/gobject/gsignal.c line 3074
  • #21 gtk_drag_dest_drop
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 2175
  • #22 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1777
  • #23 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1762
  • #24 gtk_drag_find_widget
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1762
  • #25 _gtk_drag_dest_handle_event
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkdnd.c line 1460
  • #26 IA__gtk_main_do_event
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmain.c line 1625
  • #27 gdk_event_dispatch
    at /scratch/build-area/gtk+2.0-2.16.1/gdk/x11/gdkevents-x11.c line 2364
  • #28 IA__g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 1814
  • #29 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 2445
  • #30 IA__g_main_loop_run
    at /tmp/buildd/glib2.0-2.20.3/glib/gmain.c line 2653
  • #31 IA__gtk_main
    at /scratch/build-area/gtk+2.0-2.16.1/gtk/gtkmain.c line 1205
  • #32 main
    at empathy.c line 629

Comment 1 Will Thompson 2009-09-16 10:25:54 UTC
It seems this was introduced when I added the right-click menus to the tabs. I took a look to figure out what was going wrong, but couldn't figure it out. Empathy's tab drag-and-drop code isn't obviously right, but it's not obviously wrong either. :)
Comment 2 Ruben 2009-11-14 12:46:13 UTC
I can confirm bad behavior of the tab drag & drop functionality of Empathy 2.28.

To reproduce the crash:
- Open 2 chatwindows
- Drag one into the other

/var/messages:
Nov 14 13:42:38 ruben-laptop kernel: [19750.191893] empathy[2098]: segfault at 1d ip 06299f69 sp bfecac70 error 4 in libgtk-x11-2.0.so.0.1800.3[603f000+3b8000]
Comment 3 Guillaume Desmottes 2009-12-03 17:57:44 UTC
*** Bug 588799 has been marked as a duplicate of this bug. ***
Comment 4 Mike Ruprecht 2009-12-18 06:36:14 UTC
I looked into this and it appears to be that the data "chat-window-menu-image" is pointing to is freed when moving the tab. I *think* it's happening when the old GtkNotebook is destroyed. It unparents the children of the menu widget which in turn unrefs them.
Comment 5 Guillaume Desmottes 2009-12-21 11:23:31 UTC
Nice catch! I added some ref in this branch but that doesn 't seem enough to fix the crash:
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/dnd-crash-585089

Now we got this error:

Gtk-CRITICAL **: gtk_selection_data_set: assertion `length <= 0' failed
aborting...

Program received signal SIGABRT, Aborted.
0x00007fffeec834b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
	in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 92
  • #2 IA__g_logv
    at /build/buildd/glib2.0-2.22.2/glib/gmessages.c line 549
  • #3 IA__g_log
    at /build/buildd/glib2.0-2.22.2/glib/gmessages.c line 569
  • #4 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #5 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3285
  • #6 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2980
  • #7 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3074
  • #8 gtk_drag_selection_get
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 3831
  • #9 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #10 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3247
  • #11 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2980
  • #12 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3074
  • #13 gtk_selection_invoke_handler
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkselection.c line 2976
  • #14 IA__gtk_selection_convert
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkselection.c line 1085
  • #15 gtk_notebook_drag_drop
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtknotebook.c line 3447
  • #16 _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmarshalers.c line 411
  • #17 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #18 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3285
  • #19 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2990
  • #20 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3074
  • #21 gtk_drag_dest_drop
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 2315
  • #22 gtk_drag_find_widget
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 1917
  • #23 gtk_drag_find_widget
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 1902
  • #24 gtk_drag_find_widget
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 1902
  • #25 _gtk_drag_dest_handle_event
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkdnd.c line 1600
  • #26 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1646
  • #27 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkevents-x11.c line 2369
  • #28 g_main_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 1960
  • #29 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2513
  • #30 g_main_context_iterate
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2591
  • #31 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2799
  • #32 IA__gtk_main
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1218
  • #33 main
    at empathy.c line 1051

Comment 6 Guillaume Desmottes 2009-12-21 15:50:18 UTC
*** Bug 605015 has been marked as a duplicate of this bug. ***
Comment 7 Mike Ruprecht 2009-12-21 21:17:44 UTC
I ran into that too after adding a hack for the first issue. My understanding is the assertion happens when gtk_notebook_drag_drop_get (a handler for GtkWidget's drag_data_get) calls gtk_selection_data_set with NULL data for the third parameter (&priv->detached_tab->child is NULL). This then causes the assertion in gtk_selection_data_set.

If I remember correctly, the order was empathy-chat-window.c's chat_window_drag_data_received was called and resolved, then something triggers gtk_notebook_drag_drop_get to be called at least two more times. The first works fine, but the second throws this assertion. I did try commenting out that section of code, and it didn't seem to affect anything though. So I'm not really sure what the root cause of it is.
Comment 8 Mike Ruprecht 2009-12-23 02:40:31 UTC
I investigated this further and found that the reason for the assertion is because gtk_drag_dest_set in empathy-chat-window.c is called with GTK_DEST_DEFAULT_ALL. GtkNotebook internally calls it 0. GTK_DEST_DEFAULT_ALL specifically includes GTK_DEST_DEFAULT_DROP, which automatically handles when a drop occurs. The problem is that GtkNotebook's drop handler is also called. That's why drag-data-get is signaled twice (both handlers signal it). By the time the second handler is called, it's already been handled by the first handler and the tab has been moved. The notebook has no tabs left, passes NULL into gtk_selection_data_set, and the assertion is tripped.

Unfortunately, just removing the GTK_DEST_DEFAULT_DROP flag breaks dragging contacts and files onto the window. I believe it's because, without that flag, the drag-drop signal isn't handled for them.
Comment 9 Guillaume Desmottes 2010-01-06 11:59:55 UTC
*** Bug 605519 has been marked as a duplicate of this bug. ***
Comment 10 Felix Kaser 2010-01-10 16:33:25 UTC
*** Bug 606566 has been marked as a duplicate of this bug. ***
Comment 11 Diego Escalante Urrelo (not reading bugmail) 2010-01-10 17:15:47 UTC
Guillaume:

(In reply to comment #5)
> Nice catch! I added some ref in this branch but that doesn 't seem enough to
> fix the crash:
> http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/dnd-crash-585089
> 

I came up with something similar when I reported this, although it likely leaks the reference:
http://bugzilla-attachments.gnome.org/attachment.cgi?id=151127

Anyway, that fixed the crash for me and started printing the length warning, both solutions should be equivalent so I don't see why you still get the crash after ref'ing the widgets.
Comment 12 Fabio Durán Verdugo 2010-01-11 02:34:48 UTC
This is too affect to Empathy Version 2.29.4
Comment 13 Guillaume Desmottes 2010-01-11 10:51:46 UTC
Mike: if you're ok with my patch maybe we could already commit it?
Comment 14 Mike Ruprecht 2010-01-11 21:02:48 UTC
Looks good to me. Quite an elegant solution :)
Comment 15 Mike Ruprecht 2010-01-11 21:27:07 UTC
P.S. It does still get an assertion though per my last long post? It's not a crash, so I imagine that's not a blocker for getting this fix out. Should that be opened in another bug?
Comment 16 Guillaume Desmottes 2010-01-12 11:26:44 UTC
I merged my patch but let's keep this bug open as there is obviously something wrong because of the assertion.

commit 183fa2e8a94d94a7098120fc43cde9ad83869de6
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Mon Dec 21 11:20:02 2009 +0000

    chat_window_create_label: ref the widgets stored as data so we are sure they stay alive when doing DnD
Comment 17 Sjoerd Simons 2010-02-15 12:31:23 UTC
The real issue is that we're interfering with how GtkNotebook does drag and drop, fixed in:
  http://git.collabora.co.uk/?p=user/sjoerd/empathy.git;a=shortlog;h=refs/heads/drag-n-drop
Comment 18 Guillaume Desmottes 2010-02-15 13:42:23 UTC
Looks good. Please merge.
Comment 19 Sjoerd Simons 2010-02-15 14:24:12 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 20 Guillaume Desmottes 2010-02-15 14:54:34 UTC
*** Bug 606567 has been marked as a duplicate of this bug. ***
Comment 21 Omer Akram 2010-03-04 11:32:10 UTC
I just had a crash. empathy did not crash it just got hidden and then again accessed it from messaging menu. my every account was still connected I am using 2.29.90.1
Comment 22 Guillaume Desmottes 2010-03-04 14:50:02 UTC
The last issue is actually a GTK+ bug that has not been fixed yet: bug #609929