GNOME Bugzilla – Bug 317999
2.8.4 to 2.8.6: sound-juicer crash, fileselector assertions
Last modified: 2005-11-29 01:19:31 UTC
Since the update of 2.8.4 to 2.8.6 sound-juicer crash, this has been submitter has https://bugzilla.ubuntu.com/show_bug.cgi?id=17066 "Version: 2.12.2-0ubuntu1 Every time I try to access preferences in sound-juicer, it segfaults. I don't regularily use sound-juicer and this was the first time I started it after upgrading to breezy. The last (error) message printed on the console is: (sound-juicer:10677): Gtk-CRITICAL **: gtk_file_system_path_to_uri: assertion `path != NULL' failed"
When starting sound-juicer: $ sound-juicer (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (sound-juicer:30911): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed Backtrace on the first warning: Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed aborting... Program received signal SIGABRT, Aborted.
+ Trace 63376
Thread 1 (Thread -1225914688 (LWP 2683))
The preferences crash is in the sound-juicer code; look at the strcmp() in thread 1. I can reproduce it, but it's definitely SJ and not GTK+.
(the file chooser warnings are a red herring)
This issue is with sj-prefs.c: baseuri_changed_cb() " if (strcmp (gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb)), base_uri) != 0) {" with the new GTK "gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb))" returns null
sound-juicer should be robust to that, but the warnings and the issue are from GTK, reassigning
Created attachment 53092 [details] simple glade file with a GtkFileChooserButton The bug happens with a simple glade file with a GtkFileChooserButton, nothing specific to glade
Created attachment 53093 [details] simple code to use the glade file gcc gtkfileselector.c -o gtkfileselector `pkg-config --cflags --libs libglade-2.0` to build it
With the new GTK: $ ./gtkfileselector (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_render_icon: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_parent: assertion `path != NULL' failed (gtkfileselector:18000): Gtk-CRITICAL **: gtk_file_system_get_folder: assertion `path != NULL' failed And the button has no folder selected. Backtrace of the first warning with a debug GTK build: Gtk-CRITICAL **: gtk_file_system_get_volume_for_path: assertion `path != NULL' failed aborting... Program received signal SIGABRT, Aborted.
+ Trace 63391
Thread NaN (LWP 18036)
with the previous GTK installed no warning and a folder is selected
The issue is due to this change: * gtk/gtkfilechooserwidget.c (gtk_file_chooser_widget_constructor): Don't set a default folder here.
The crash happens here in sj-prefs.c: 252 if (strcmp (gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb)), base_uri) != 0) { There, gtk_file_chooser_getr_current_folder_uri() returns NULL because the file chooser button is not mapped yet. It is perfectly valid for that function to return NULL. Sound Juicer needs to deal with that. Reassigning to sound-juicer.
there is not only the crash. There is still the warnings, and the CVS changes don't fix them. That happens with the libglade example too, should I open an another bug about that? That seems quite an API breakage to me, since you used to return an useful value and now send NULL from the same functions.
Created attachment 53218 [details] [review] patch to stop crash This is a trivial patch to make S-J handle the function returning NULL, and so stops it crashing.
I've applied this patch to Sound Juicer, re-assigning back to GTK+ because of the libglade example.
Created attachment 53655 [details] [review] gtk2-file-chooser-no-initial-null-folder.diff This patch fixes things for me with an unpatched sound-juicer. The patch makes get_current_folder() return $cwd if no folder has been explicitly set on the file chooser before. This is effectively the old behavior.
OK, I just committed the patch to gtk-2-8 and HEAD. There are still warnings from GtkFileChooserButton when it initializes the label/icon; I'll look into those. 2005-10-18 Federico Mena Quintero <federico@ximian.com> Fixes bug #317999: * tests/autotestfilechooser.c (test_button_folder_states_for_action): Test that we have either $cwd or the explicitly-set folder. (test_reload_sequence): Likewise. * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_get_current_folder): If our reload_state is RELOAD_EMPTY, return a GtkFilePath corresponding to $cwd.
the patch fixes the crash. the default is still not correctly setted though
I just found the cause of the critical warnings. Fixed on gtk-2-8 and HEAD. 2005-11-28 Federico Mena Quintero <federico@ximian.com> Fixes the critical warnings from bug #317999, thus fixing the bug completely: * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_get_paths): In SELECT_FOLDER mode, use _gtk_file_chooser_get_current_folder_path() instead of fetching the impl->current_folder directly. The latter may be null if we are in RELOAD_NONE state.