any known problems with the gtk_tree_model_filter ?



Hi all,

I'm trying to pinpoint a segfault in bluefish, but I expect the bug to be
in the gtk_tree_model_filter.

I have a treestore, on top of that a filtermodel, on top of that a sort
model, and on top of that a treeview widget.

when converting an iter from a selection changed callback (the iter is
retrieved from a gtk_tree_selection_get_selected call), I get a crash.

I added some debugging code to pinpoint the crash:

	gtk_tree_model_get(fb2->dir_tsort, sorted_iter, FILENAME_COLUMN, &name, -1);
	g_print("DEBUG_CHILD_ITERS, dir_tsort=%p, sorted name=%s\n",fb2->dir_tsort , name);
	gtk_tree_model_sort_convert_iter_to_child_iter(GTK_TREE_MODEL_SORT(fb2->dir_tsort),&filter_iter,sorted_iter);
	g_print("DEBUG_CHILD_ITERS, dir_tsort %p is sorting dir_tfilter %p\n",fb2->dir_tsort ,gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(fb2->dir_tsort)));

	gtk_tree_model_get(fb2->dir_tfilter, &filter_iter, FILENAME_COLUMN, &name, -1);
	g_print("DEBUG_CHILD_ITERS, dir_tfilter=%p, filter name=%s\n", fb2->dir_tfilter, name);
	gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(fb2->dir_tfilter),&fs_iter,&filter_iter);
	g_print("DEBUG_CHILD_ITERS, dir_tfilter %p is filtering filesystem %p, == %p\n",fb2->dir_tfilter 
				,gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(fb2->dir_tfilter))
				, FILEBROWSER2CONFIG(main_v->fb2config)->filesystem_tstore
				);
	
	gtk_tree_model_get(fb2->dir_tfilter, &fs_iter, FILENAME_COLUMN, &name, -1);
	g_print("DEBUG_CHILD_ITERS, fs name=%s\n", name);

1) getting the value from the sort_model using the sort_iter gives the correct value, 
2) getting the value from the filter_model using the filter_iter gives the same value, 
3) getting the value from the treestore using the treestore_iter does NOT give the same value ?!?!? it crashes:

(bluefish:4579): Gtk-CRITICAL **: file gtktreemodelfilter.c: line 1938 (gtk_tree_model_filter_get_value): assertion `GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed
(bluefish:4579): GLib-GObject-WARNING **: gtype.c:3351: type id `0' is invalid
(bluefish:4579): GLib-GObject-WARNING **: can't peek value table for type `<invalid>' which is not currently referenced

is it possible that this call will result in a non-valid iter?:

gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(fb2->dir_tfilter),&fs_iter,&filter_iter);

thanks,
	Olivier



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