[Bug 151715] - Gedit Crash after opening a second tab

bugzilla-daemon@bugzilla.gnome.org bugzilla-daemon@bugzilla.gnome.org
Mon, 27 Sep 2004 03:58:59 -0400 (EDT)


http://bugzilla.gnome.org/show_bug.cgi?id=151715
gtk+ | GtkFileSel | Ver: 2.4.x





------- Additional Comments From seb128@debian.org  2004-09-27 03:58 -------
Ok, I've managed to get more details on this problem.

It seems to be reproducible without any problem on a Debian unstable without 
any problem:
* gtk+ 2.4.10
* libgnomeui 2.6.1.1
* gnome-vfs 2.6.2

To reproduce:
* cd /tmp
* mkdir src
* touch src/media.cpp
* gedit src/media.cpp
* click on open 
=> crash

Some indications:
* If you select "save as" and expand the folder list you can note that media.cpp
is listed 2 times in the list of files

The crash is due to this stack of functions:
gtk_file_chooser_default_set_current_folder -> set_list_model -> name_sort_func

Since "media.cpp" is listed 2 times in the save mode perhaps that crashes
name_sort_func ...


With GNOME 2.8 and gtk+ 2.4.10 the file is not listed 2 times and it doesn't 
crash.


I've made a little test case:

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
  GtkWidget *fs;

  gtk_init(&argc, &argv);

  fs = gtk_file_chooser_dialog_new ("Select files",
				    NULL, GTK_FILE_CHOOSER_ACTION_OPEN,
				    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
				    GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
				    NULL);
  gtk_dialog_set_default_response (GTK_DIALOG (fs), GTK_RESPONSE_ACCEPT);
  
  gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (fs), TRUE);
  gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fs), FALSE);
  gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER (fs),
"file:///tmp/src/");

  gtk_widget_show_all(fs);
  gtk_main();

  return 0;
}


The backtrace:

[Switching to Thread 1082073760 (LWP 912)]
_gtk_file_system_model_get_info (model=0x0, iter=0xbfffee30) at
gtkfilesystemmodel.c:969
969       if (model->has_editable && node == model->roots)
(gdb) bt
#0  _gtk_file_system_model_get_info (model=0x0, iter=0xbfffee30) at
gtkfilesystemmodel.c:969
#1  0x400ee6a2 in name_sort_func (model=0x8187e40, a=0xbfffee30, b=0xbfffee30,
user_data=0x808e580)
    at gtkfilechooserdefault.c:3875
#2  0x402045c3 in gtk_tree_model_sort_level_find_insert
(tree_model_sort=0x8188590, level=0x808c630, iter=0xbfffef10,
    skip_index=1) at gtktreemodelsort.c:1836
#3  0x402047d3 in gtk_tree_model_sort_insert_value (tree_model_sort=0x8188590,
level=0x808c630, s_path=0xffffffff,
    s_iter=0xbfffef10) at gtktreemodelsort.c:1884
#4  0x40201ecb in gtk_tree_model_sort_row_inserted (s_model=0x8187e40,
s_path=0x8172578, s_iter=0x81f5bc0, data=0x8188590)
    at gtktreemodelsort.c:723
#5  0x4013f125 in _gtk_marshal_VOID__BOXED_BOXED (closure=0x8188050,
return_value=0x0, n_param_values=3,
    param_values=0xbffff170, invocation_hint=0xbffff068, marshal_data=0x0) at
gtkmarshalers.c:1028
#6  0x4040ec20 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#7  0x40422c25 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#8  0x40421be7 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#9  0x40421ee4 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#10 0x401fb0a9 in gtk_tree_model_row_inserted (tree_model=0x8187e40,
path=0x8177ef8, iter=0xbffff350) at gtktreemodel.c:1374
#11 0x400ff9ee in do_files_added (model=0x8187e40, parent_node=0x0,
paths=0xbfffee30) at gtkfilesystemmodel.c:1599
#12 0x40423d4e in g_cclosure_marshal_VOID__POINTER () from
/usr/lib/libgobject-2.0.so.0
#13 0x4040ec20 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#14 0x40422c25 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#15 0x40421be7 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#16 0x40421fd4 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#17 0x409b9071 in gtk_file_system_gnome_vfs_get_folder (file_system=0x80a68d0,
path=0x82075a8, types=GTK_FILE_INFO_ALL,
    error=0x0) at gtkfilesystemgnomevfs.c:679
#18 0x400fb851 in gtk_file_system_get_folder (file_system=0x80a68d0,
path=0x82075a8, types=0, error=0x0)
    at gtkfilesystem.c:326
#19 0x400fe4b1 in _gtk_file_system_model_new (file_system=0x80a68d0,
root_path=0x82075a8, max_depth=0,
    types=GTK_FILE_INFO_ALL, error=0x0) at gtkfilesystemmodel.c:750
#20 0x400eeaf0 in set_list_model (impl=0x808e580, error=0xbfffee30) at
gtkfilechooserdefault.c:3977
#21 0x400eef3e in gtk_file_chooser_default_set_current_folder
(chooser=0x808e580, path=0x81f5318, error=0x0)
    at gtkfilechooserdefault.c:4109
#22 0x400e3ea0 in _gtk_file_chooser_set_current_folder_path (chooser=0x808e580,
path=0x81f5318, error=0x0)
    at gtkfilechooser.c:973
#23 0x400f2585 in delegate_set_current_folder (chooser=0xbfffee30, path=0x0,
error=0x0) at gtkfilechooserutils.c:275
#24 0x400e3ea0 in _gtk_file_chooser_set_current_folder_path (chooser=0x8093f40,
path=0x81f5318, error=0x0)
    at gtkfilechooser.c:973
#25 0x400f2585 in delegate_set_current_folder (chooser=0xbfffee30, path=0x0,
error=0x0) at gtkfilechooserutils.c:275
#26 0x400e3ea0 in _gtk_file_chooser_set_current_folder_path (chooser=0x808c718,
path=0x81f5318, error=0x0)
    at gtkfilechooser.c:973
#27 0x400e3cbe in gtk_file_chooser_set_current_folder_uri (chooser=0x808c718,
uri=0x81f5318 "file:///tmp/src/")
    at gtkfilechooser.c:911
#28 0x08048aad in main (argc=1, argv=0xbffffa34) at test.c:21

------- You are receiving this mail because: -------
You are on the CC list for the bug.