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 726857 - GtkFileChooser crashes app if not destroyed
GtkFileChooser crashes app if not destroyed
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.10.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks: 702853
 
 
Reported: 2014-03-22 01:17 UTC by Roger Davis
Modified: 2018-05-02 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Roger Davis 2014-03-22 01:17:23 UTC
I was attempting to reuse a single GtkFileChooser in my app rather than repeatedly creating, running and destroying one every time I needed it, i.e., I would gtk_widget_hide() the chooser after running it rather than calling gtk_widget_destroy(). This design would ultimately trigger messages of the form

(myapp:13754): Gtk-CRITICAL **: gtk_tree_model_filter_get_path: assertion
'GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed

at random times after the dialog was hidden, which always resulted in a core dump. The stack backtraces included these calls:

  • #9 remove_file
    at gtkfilesystemmodel.c line 1912
  • #10 gtk_file_system_model_monitor_change
    at gtkfilesystemmodel.c line 1257

These appear to result from some kind of background file chooser model update activity.

Although the gtk+3 documentation shows a call to gtk_widget_destroy() in the code example for the GtkFileChooser, this is not mentioned as a strict requirement. In my opinion, either (1) this should be clearly documented as a strict requirement, (2) the file chooser code should be modified to disable this model update activity when the chooser is not active, or (3) there should be an API mechanism to disable this model update activity while the chooser is hidden from view.

Thanks!

Roger Davis
Univ. of Hawaii
Comment 1 Daniel Boles 2017-09-04 22:20:35 UTC
fwiw, see Bug 702853 for (probably not even all) of the problems that occur when reusing FileChooser widgets. They really don't seem prepared for it. :(

Bug 475628 may be ultimately the same, if the problem is undefined behaviour causing unpredictable errors.

I had to give up and just destroy/rebuild mine, which feels like a waste, but until some brave person figures out what's going on, it seems to be the only way. Maybe one day...
Comment 2 GNOME Infrastructure Team 2018-05-02 16:00:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/477.