GNOME Bugzilla – Bug 614006
File chooser crashes when creating a new folder, and new files are added to the parent
Last modified: 2010-08-25 17:45:58 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
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
+ Trace 221107
context = <value optimized out> engine = 0x8124260 window = 0x814a000 app = <value optimized out> restored = <value optimized out> error = 0x0 dir = 0x814a000 "" __PRETTY_FUNCTION__ = "main" (gdb)
For the record, this bug is especially noticeable with /tmp, which is used by many programs.
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.
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.
(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
(In reply to comment #5) > Wrong bug number? You probably mean bug #627896 Argh. You are correct, of course :) It's bug #627896.