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 317999 - 2.8.4 to 2.8.6: sound-juicer crash, fileselector assertions
2.8.4 to 2.8.6: sound-juicer crash, fileselector assertions
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.8.x
Other Linux
: Immediate blocker
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-05 10:26 UTC by Sebastien Bacher
Modified: 2005-11-29 01:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
simple glade file with a GtkFileChooserButton (1.46 KB, application/x-glade)
2005-10-06 08:14 UTC, Sebastien Bacher
  Details
simple code to use the glade file (426 bytes, text/x-csrc)
2005-10-06 08:15 UTC, Sebastien Bacher
  Details
patch to stop crash (1.04 KB, patch)
2005-10-08 07:27 UTC, James "Doc" Livingston
none Details | Review
gtk2-file-chooser-no-initial-null-folder.diff (987 bytes, patch)
2005-10-19 14:13 UTC, Federico Mena Quintero
none Details | Review

Description Sebastien Bacher 2005-10-05 10:26:07 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"
Comment 1 Sebastien Bacher 2005-10-05 10:31:09 UTC
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.

Thread 1 (Thread -1225914688 (LWP 2683))

  • #0 strcmp
    from /lib/tls/i686/cmov/libc.so.6
  • #1 baseuri_changed_cb
    at sj-prefs.c line 252
  • #2 on_edit_preferences_cb
    at sj-prefs.c line 437
  • #3 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #4 IA__g_closure_invoke
    at gclosure.c line 492
  • #5 signal_emit_unlocked_R
    at gsignal.c line 2485
  • #6 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #7 IA__g_signal_emit
    at gsignal.c line 2288
  • #8 IA__gtk_widget_activate
    at gtkwidget.c line 3766
  • #9 IA__gtk_menu_shell_activate_item
    at gtkmenushell.c line 1057
  • #10 gtk_menu_shell_button_release
    at gtkmenushell.c line 663
  • #11 gtk_menu_button_release
    at gtkmenu.c line 2571
  • #12 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 83
  • #13 g_type_class_meta_marshal
    at gclosure.c line 569
  • #14 IA__g_closure_invoke
    at gclosure.c line 492
  • #15 signal_emit_unlocked_R
    at gsignal.c line 2523
  • #16 IA__g_signal_emit_valist
    at gsignal.c line 2254
  • #17 IA__g_signal_emit
    at gsignal.c line 2288
  • #18 gtk_widget_event_internal
    at gtkwidget.c line 3735
  • #19 IA__gtk_propagate_event
    at gtkmain.c line 2169
  • #20 IA__gtk_main_do_event
    at gtkmain.c line 1406
  • #21 gdk_event_dispatch
    at gdkevents-x11.c line 2291
  • #22 IA__g_main_context_dispatch
    at gmain.c line 1934
  • #23 g_main_context_iterate
    at gmain.c line 2565
  • #24 IA__g_main_loop_run
    at gmain.c line 2769
  • #25 IA__gtk_main
    at gtkmain.c line 985
  • #26 main
    at sj-main.c line 1310


Comment 2 Federico Mena Quintero 2005-10-05 19:55:31 UTC
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+.
Comment 3 Federico Mena Quintero 2005-10-05 19:55:57 UTC
(the file chooser warnings are a red herring)
Comment 4 Sebastien Bacher 2005-10-06 08:02:31 UTC
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
Comment 5 Sebastien Bacher 2005-10-06 08:12:47 UTC
sound-juicer should be robust to that, but the warnings and the issue are from
GTK, reassigning
Comment 6 Sebastien Bacher 2005-10-06 08:14:04 UTC
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
Comment 7 Sebastien Bacher 2005-10-06 08:15:52 UTC
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
Comment 8 Sebastien Bacher 2005-10-06 08:19:40 UTC
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.

Thread NaN (LWP 18036)

  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #3 IA__g_logv
    at gmessages.c line 497
  • #4 IA__g_log
    at gmessages.c line 517
  • #5 IA__g_return_if_fail_warning
    at gmessages.c line 532
  • #6 IA__gtk_file_system_get_volume_for_path
    at gtkfilesystem.c line 360
  • #7 update_label_and_image
    at gtkfilechooserbutton.c line 1806
  • #8 gtk_file_chooser_button_set_property
    at gtkfilechooserbutton.c line 739
  • #9 IA__g_object_newv
    at gobject.c line 691
  • #10 glade_standard_build_widget
    at glade-xml.c line 1651
  • #11 glade_xml_build_widget
    at glade-xml.c line 1855
  • #12 glade_standard_build_children
    at glade-xml.c line 1748
  • #13 glade_xml_set_common_params
    at glade-xml.c line 2072
  • #14 glade_xml_build_widget
    at glade-xml.c line 1862
  • #15 glade_xml_build_interface
    at glade-xml.c line 1176
  • #16 glade_xml_construct
    at glade-xml.c line 192
  • #17 glade_xml_new
    at glade-xml.c line 155
  • #18 main


with the previous GTK installed no warning and a folder is selected
Comment 9 Sebastien Bacher 2005-10-06 11:21:18 UTC
The issue is due to this change:

	* gtk/gtkfilechooserwidget.c
	(gtk_file_chooser_widget_constructor): Don't set a default folder here.
Comment 10 Federico Mena Quintero 2005-10-07 20:20:43 UTC
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.
Comment 11 Sebastien Bacher 2005-10-07 21:31:54 UTC
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.
Comment 12 James "Doc" Livingston 2005-10-08 07:27:35 UTC
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.
Comment 13 Ross Burton 2005-10-11 12:34:45 UTC
I've applied this patch to Sound Juicer, re-assigning back to GTK+ because of
the libglade example.
Comment 14 Federico Mena Quintero 2005-10-19 14:13:36 UTC
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.
Comment 15 Federico Mena Quintero 2005-10-19 17:02:49 UTC
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.
Comment 16 Sebastien Bacher 2005-10-19 17:26:32 UTC
the patch fixes the crash. the default is still not correctly setted though
Comment 17 Federico Mena Quintero 2005-11-29 01:19:31 UTC
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.