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 614006 - File chooser crashes when creating a new folder, and new files are added to the parent
File chooser crashes when creating a new folder, and new files are added to t...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.20.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2010-03-26 12:27 UTC by Ori Avtalion
Modified: 2010-08-25 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix invalid replacement of file info of first node of file system model (430 bytes, patch)
2010-08-22 14:29 UTC, Orlov Sergey
none Details | Review

Description Ori Avtalion 2010-03-26 12:27:12 UTC
Using gtk 2.20.0 on ubuntu.

1) Run a script that constantly adds files to a folder:
file="1"
while true; do
	touch $file;
	file=$(($file + 1));
	sleep 2;
done

2) Open an app (say, gedit), choose "save", navigate to the folder and choose "Create folder".

3) Wait a moment for the script to create a new file

Crash with the assert:
Gtk:ERROR:/build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c:6699:file_system_model_set: code should not be reached
Comment 1 Fabio Durán Verdugo 2010-03-26 14:32:17 UTC
I can confirm this,

add the stacktrace

[New Thread 0xb6555b70 (LWP 6048)]
sys:1: GtkWarning: _gtk_file_system_model_get_iter_for_file: assertion `G_IS_FILE (file)' failed
**
Gtk:ERROR:/build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c:6699:file_system_model_set: code should not be reached

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt full
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 92
  • #3 IA__g_assertion_message
    at /build/buildd/glib2.0-2.23.6/glib/gtestutils.c line 1318
  • #4 file_system_model_set
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c line 6754
  • #5 _gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 1600
  • #6 gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 545
  • #7 IA__gtk_tree_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreemodel.c line 1147
  • #8 IA__gtk_tree_view_column_cell_set_cell_data
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeviewcolumn.c line 2583
  • #9 validate_row
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5737
  • #10 validate_visible_area
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5950
  • #11 do_presize_handler
  • #12 presize_handler_callback
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 6409
  • #13 gdk_threads_dispatch
    at /build/buildd/gtk+2.0-2.20.0/gdk/gdk.c line 512
  • #14 g_idle_dispa[New Thread 0xb6555b70
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 92
  • #3 IA__g_assertion_message
    at /build/buildd/glib2.0-2.23.6/glib/gtestutils.c line 1318
  • #4 file_system_model_set
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c line 6754
  • #5 _gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 1600
  • #6 gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 545
  • #7 IA__gtk_tree_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreemodel.c line 1147
  • #8 IA__gtk_tree_view_column_cell_set_cell_data
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeviewcolumn.c line 2583
  • #9 validate_row
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5737
  • #10 validate_visible_area
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5950
  • #11 do_presize_handler
  • #12 presize_handler_callback
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 6409
  • #13 gdk_threads_dispatch
    at /build/buildd/gtk+2.0-2.20.0/gdk/gdk.c line 512
  • #14 g_idle_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 4065
  • #15 g_main_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 1960
  • #16 IA__g_main_context_dispatch
  • #17 g_main_context_iterate
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2591
  • #18 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2799
  • #19 IA__gtk_mai[New Thread 0xb6555b70
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 92
  • #3 IA__g_assertion_message
    at /build/buildd/glib2.0-2.23.6/glib/gtestutils.c line 1318
  • #4 file_system_model_set
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c line 6754
  • #5 _gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 1600
  • #6 gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 545
  • #7 IA__gtk_tree_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreemodel.c line 1147
  • #8 IA__gtk_tree_view_column_cell_set_cell_data
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeviewcolumn.c line 2583
  • #9 validate_row
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5737
  • #10 validate_visible_area
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5950
  • #11 do_presize_handler
  • #12 presize_handler_callback
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 6409
  • #13 gdk_threads_dispatch
    at /build/buildd/gtk+2.0-2.20.0/gdk/gdk.c line 512
  • #14 g_idle_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 4065
  • #15 g_main_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 1960
  • #16 IA__g_main_context_dispatch
  • #17 g_main_context_iterate
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2591
  • #18 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2799
  • #19 IA__gtk_main
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkmain.c line 1219
  • #20 main
    at gedit.c line 744
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 92
  • #3 IA__g_assertion_message
    at /build/buildd/glib2.0-2.23.6/glib/gtestutils.c line 1318
  • #4 file_system_model_set
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilechooserdefault.c line 6754
  • #5 _gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 1600
  • #6 gtk_file_system_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkfilesystemmodel.c line 545
  • #7 IA__gtk_tree_model_get_value
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreemodel.c line 1147
  • #8 IA__gtk_tree_view_column_cell_set_cell_data
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeviewcolumn.c line 2583
  • #9 validate_row
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5737
  • #10 validate_visible_area
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 5950
  • #11 do_presize_handler
  • #12 presize_handler_callback
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtktreeview.c line 6409
  • #13 gdk_threads_dispatch
    at /build/buildd/gtk+2.0-2.20.0/gdk/gdk.c line 512
  • #14 g_idle_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 4065
  • #15 g_main_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 1960
  • #16 IA__g_main_context_dispatch
  • #17 g_main_context_iterate
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2591
  • #18 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2799
  • #19 IA__gtk_main
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkmain.c line 1219
  • #20 main
    at gedit.c line 744
  • #20 main
    at gedit.c line 744
  • #15 g_main_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 1960
  • #16 IA__g_main_context_dispatch
  • #17 g_main_context_iterate
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2591
  • #18 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2799
  • #19 IA__gtk_main
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkmain.c line 1219
  • #20 main
    at gedit.c line 744
        context = <value optimized out>
        engine = 0x8124260
        window = 0x814a000
        app = <value optimized out>
        restored = <value optimized out>
        error = 0x0
        dir = 0x814a000 ""
        __PRETTY_FUNCTION__ = "main"
(gdb)
Comment 2 Ori Avtalion 2010-03-26 14:51:19 UTC
For the record, this bug is especially noticeable with /tmp, which is used by many programs.
Comment 3 Orlov Sergey 2010-08-22 14:29:39 UTC
Created attachment 168501 [details] [review]
Fix invalid replacement of file info of first node of file system model

File info of zero-indexed model's node replaced by file info of adding file (if file was added to file system after showing of dialog). Zero-indexed model's node is special node for editing name of new folder. Incorrect file info in it led to crash if file with this file info was deleted from file system and we pressed new folder button.
Comment 4 Federico Mena Quintero 2010-08-24 22:10:52 UTC
Thank you for tracking this down, Sergey!  I just pushed your fix to the master, gtk-2-20, and gtk-2-22 branches.

This still leaves a problem - if you are typing the name for a new folder and a new file appears, then what you were typing gets cancelled.  I've filed bug #627986 about this.
Comment 5 Ori Avtalion 2010-08-25 09:54:57 UTC
(In reply to comment #4)
> This still leaves a problem - if you are typing the name for a new folder and a
> new file appears, then what you were typing gets cancelled.  I've filed bug
> #627986 about this.

Wrong bug number? You probably mean bug #627896
Comment 6 Federico Mena Quintero 2010-08-25 17:45:58 UTC
(In reply to comment #5)
> Wrong bug number? You probably mean bug #627896

Argh.  You are correct, of course :)  It's bug #627896.