A bug in gtk_tree

Hi all,

there is a bug in function "gtk_real_tree_select_child". The problem is
in the line:

root_selection = tree->root_tree->selection;

(right on the beginning of the function).

This line crashes the program when "tree->root_tree" is set to NULL.
This happens when the tree is not realized (for example the tree is
hidden from the start of program) but program removes previously added
items. Look at this backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x400dab36 in gtk_real_tree_select_child (tree=0x81ff740,
child=0x82138b8) at gtktree.c:1061
1061      root_selection = tree->root_tree->selection;
(gdb) bt
#0  0x400dab36 in gtk_real_tree_select_child (tree=0x81ff740,
child=0x82138b8) at gtktree.c:1061
#1  0x4008fec5 in gtk_marshal_NONE__POINTER (object=0x81ff740,
func=0x400daa50 <gtk_real_tree_select_child>,
    func_data=0x0, args=0xbffe70e4) at gtkmarshal.c:193
#2  0x400ba266 in gtk_signal_real_emit (object=0x81ff740, signal_id=90,
params=0xbffe70e4) at gtksignal.c:1432
#3  0x400b8724 in gtk_signal_emit (object=0x81ff740, signal_id=90) at
#4  0x400da3bc in gtk_tree_select_child (tree=0x81ff740,
tree_item=0x82138b8) at gtktree.c:880
#5  0x400da284 in gtk_tree_remove_items (tree=0x81ff740,
items=0x8204650) at gtktree.c:859
#6  0x400d9fcd in gtk_tree_remove_item (container=0x81ff740,
widget=0x82135c8) at gtktree.c:655

When I inspected the value of "tree->root_tree", I got:

(gdb) print tree->root_tree
$1 = (GtkTree *) 0x0

When the tree was visible (and also realized), the value of
"tree->root_tree" was the same as "tree".

I tried to prevent this bug with checking of value of "tree->root_tree"
before function "gtk_tree_remove_item" call. When I got NULL, I set the
"tree->root_tree" on the same value as "tree" and the bug was solved.

I hope I selected the right mailing list for to announce this bug.


PS: I'm using gtk+-1.2.7
kernel, n.: A part of an operating system that preserves the medieval
            traditions of sorcery and black art.
kernel, n.: Cast operacniho systenu, ktera zachovava stredoveke tradice
            kouzelnictvi a cerne magie.

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