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 112280 - Deleting message hangs balsa
Deleting message hangs balsa
Status: RESOLVED INVALID
Product: balsa
Classification: Other
Component: general
2.0.x
Other Linux
: Normal major
: ---
Assigned To: Balsa Maintainers
Balsa Maintainers
: 107715 114066 (view as bug list)
Depends on: 111286
Blocks:
 
 
Reported: 2003-05-05 12:47 UTC by Miquel van Smoorenburg
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2



Description Miquel van Smoorenburg 2003-05-05 12:47:53 UTC
Balsa 2.0.10 and latest CVS version tested.

I'm using balsa, with my mailboxes on a remote IMAP server.
Preferences -> Misc settings that might be relevant:
 
[ ] debug
[ ] empty trash on exit
[ ] Delete immidiately
[v] Hide deleted messages
                                                                          
     
Threading for this folder is set to 'jwz threading', however, setting
it to 'simple threading' doesn't make a difference.
                                                                          
     
If I collapse a thread with 2 messages in it in the message list
window, then select that thread/message by clicking on it, and
then press 'd' (for delete message) balsa hangs completely.
Clicking 'thrash/delete' has the same effect.
                                                                          
     
Deleting the individual messages seperately when the thread
is expanded works normally.
                                                                          
     
This is 100% reproducible, also on local mailboxes.

Also, when a new message arrives as a reply to a message already in
the mailbox, that message is collapsed. Expanding that thread and
then selecting+deleting the first message results in the same hang.

Esp. the last thing happens enough to make balsa unuseable.

Console output just before the hang:

Opening 4 mailboxes on startup.
Adding child Re: test.....
Moving Re: test..... to top level

Stack trace:

  • #0 sigsuspend
    from /lib/libc.so.6
  • #1 __pthread_wait_for_restart_signal
    from /lib/libpthread.so.0
  • #2 __pthread_alt_lock
    from /lib/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #4 gtk_tree_view_expand_all
    from /usr/lib/libgtk-x11-2.0.so.0
  • #5 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #6 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 _gtk_marshal_VOID__BOXED_BOXED_POINTER
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #12 gtk_tree_model_rows_reordered
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 gtk_tree_store_move_after
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 gtk_tree_store_set_valist
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 gtk_tree_store_set
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 bndx_copy_tree
    at balsa-index.c line 2360
  • #17 balsa_index_move_subtree
    at balsa-index.c line 2298
  • #18 bndx_messages_remove
    at balsa-index.c line 2554
  • #19 mailbox_messages_changed_status
    at balsa-index.c line 1396
  • #20 mailbox_messages_changed_status_idle
    at balsa-index.c line 1440
  • #21 g_timeout_add
    from /usr/lib/libglib-2.0.so.0
  • #22 g_get_current_time
    from /usr/lib/libglib-2.0.so.0
  • #23 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #24 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #26 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 main
    at main.c line 447

Comment 1 Peter Bloomfield 2003-05-05 13:23:32 UTC
This is a similar stack trace to the one in #107715.
Comment 2 Miquel van Smoorenburg 2003-05-05 14:04:26 UTC
Balsa just froze up when I wasn't doing anything; it was on
another desktop, and when I switched to that desktop I saw that
balsa was frozen again. Stack trace below.

I'll try to see if I can dig up another GTK lib. The one I'm
using currently is gtk+2.0_2.2.1-4 from Debian.

(gdb) where
  • #0 sigsuspend
    from /lib/libc.so.6
  • #1 __pthread_wait_for_restart_signal
    from /lib/libpthread.so.0
  • #2 __pthread_alt_lock
    from /lib/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #4 gtk_tree_view_expand_all
    from /usr/lib/libgtk-x11-2.0.so.0
  • #5 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #6 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 _gtk_marshal_VOID__BOXED_BOXED_POINTER
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #12 gtk_tree_model_rows_reordered
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 gtk_tree_store_move_after
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 gtk_tree_store_set_valist
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 gtk_tree_store_set
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 bndx_add_message
    at balsa-index.c line 2459
  • #17 bndx_messages_add
    at balsa-index.c line 1475
  • #18 mailbox_messages_func_idle
    at balsa-index.c line 1512
  • #19 g_timeout_add
    from /usr/lib/libglib-2.0.so.0
  • #20 g_get_current_time
    from /usr/lib/libglib-2.0.so.0
  • #21 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #22 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #23 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #24 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 main
    at main.c line 447

Comment 3 Miquel van Smoorenburg 2003-05-05 17:02:09 UTC
Okay, I got the latest gtk+ from CVS (the gtk-2-2 branch) today,
built it, and ran balsa against it.

It doesn't help. The bug is still there.

However, if I build balsa itself with --disable-threads, then
the bug doesn't appear. So it is threads-related.

Now reading the source, and the stack trace, I see that
mailbox_messages_changed_status_idle in balsa-index.c
calls gdk_threads_enter(), and finally gtk_tree_view_expand_all()
in the gdb library ends up calling GDK_THREADS_ENTER()
as well -> deadlock. But whose fault it is?
Comment 4 Peter Bloomfield 2003-05-05 17:34:54 UTC
Well, that would seem to be a recipe for threadlock...but the version
of gtk_tree_view_expand_all that I'm seeing in cvs is like this:

/**
 * gtk_tree_view_expand_all:
 * @tree_view: A #GtkTreeView.
 *
 * Recursively expands all nodes in the @tree_view.
 **/

void
gtk_tree_view_expand_all (GtkTreeView *tree_view)
{
  g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));

  if (tree_view->priv->tree == NULL)
    return;

  _gtk_rbtree_traverse (tree_view->priv->tree,
                        tree_view->priv->tree->root,
                        G_PRE_ORDER,
              	        gtk_tree_view_expand_all_helper,
                        tree_view);
}

and I don't see a call to GDK_THREADS_ENTER()--is this not the code
that you have?

I'm guessing that it's the cast check GTK_IS_TREE_VIEW() that's
causing the lock, because that also tries to grab one, but it's in the
GType system, not the gdk lock.
Comment 5 Pawel Salek 2003-05-05 19:43:13 UTC
FWIW, G_TYPE_CHECK_INSTANCE_TYPE from glib2-2.2.1-1 does not touch gtk
thread lock. 
Also, I could not find gtk_threads_lock in entire gtktreeview.c in
gtk-2-2 branch at all. I think more information is needed here.
Comment 6 Miquel van Smoorenburg 2003-05-06 09:10:23 UTC
That's correct, there is no gtk_threads_lock in gtktreeview.c,
but there's a lot of GDK_THREADS_ENTER() calls.

I think somewhere gdb got confused and listed the wrong
stacktrace. No idea why, perhaps the threading code
got confused.

Anyway, I tried the patch against gtk+ that was mentioned in
http://bugzilla.gnome.org/show_bug.cgi?id=111286 and the bug
appears to be fixed with that patch applied against gtk.

So I guess I could try to get a better stack trace by backing out
that patch and trying again, but as the problem seems to have
been identified and solved already, it's probably a better
idea to merge this bug with 111286 and close it when a new
gtk gets released.

Thanks!

Mike.
Comment 7 Peter Bloomfield 2003-05-31 01:03:40 UTC
*** Bug 114066 has been marked as a duplicate of this bug. ***
Comment 8 Peter Bloomfield 2003-10-05 23:05:26 UTC
*** Bug 107715 has been marked as a duplicate of this bug. ***
Comment 9 Carlos Morgado 2004-07-05 12:51:32 UTC
Old and probably Gtk+ related