Re: a patch for message threadings



Hi there,

I received a bug report 'SIGSEGV crash in the message threading'
from Timothy Alan Chandler <fusion@heavywater.net>.

It seems this crash has been caused by a bug in the GTkCtree widget.

He said,

  From: Timothy Alan Chandler <fusion@heavywater.net>
  I've noticed one slight problem with the threading patch.  When one
  attempts to delete a collapsed message thread, the application traps
  SIGSEGV.  Probably a bad pointer somewhere, but I really haven't looked at
  the code.

Automagically, in some situation, 
  gtk_ctree_move(ctree, node, NULL, NULL);
has been called in that patch.
# This means that 'node' is moved to last sibling of top-level.

This function will call real_tree_move() in gtkctree.c from Gtk+ 
(gtk-config -version says 1.2.8) with an argument 'new_sibling' as NULL. 
And then, in this function, 

  if (gtk_ctree_is_viewable (ctree, node) ||
      gtk_ctree_is_viewable (ctree, new_sibling))
    work = GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row));

If your gtk is compiled with debugging mode,
you will get a warning message in gtk_ctree_is_viewable() functions,
"second argument is NULL" and his gtk is free from debugging mode, 
so balsa crashed in gtk_ctree_is_viewable(). 

I think above code should be,

  if (gtk_ctree_is_viewable (ctree, node) ||
      (new_sibling && gtk_ctree_is_viewable (ctree, new_sibling)))
    work = GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row));

Anyway, at present, if you want to work around this problem,
you can use next patch, but I don't recommend to include such a
bug compatible code in a formal source tree.

PS. I would thank to Timothy Alan Chandler, he sent me valuable feedbacks.

--- balsa-index.c	Tue Nov 21 02:41:38 2000
+++ balsa-index.c.new	Tue Nov 21 02:43:05 2000
@@ -566,6 +566,15 @@
 	    if(sibling!=NULL)sibling=GTK_CTREE_ROW(sibling)->sibling;
 	    else{sibling=GTK_CTREE_ROW(node)->sibling;}
 
+	    if(sibling==NULL){
+	      gboolean expanded;
+	      gtk_ctree_get_node_info(GTK_CTREE(bindex), node,
+				      NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+				      &expanded);
+	      if(!expanded)
+	        gtk_ctree_expand(GTK_CTREE(bindex), node);
+	    }
+
 	    while(1){
 		if(children==NULL)break;
 		next=GTK_CTREE_ROW(children)->sibling;




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