GNOME Bugzilla – Bug 720743
afp backend crashes when opening the root directory
Last modified: 2014-01-04 15:54:08 UTC
To reproduce: $ gvfs-cat afp://xguest@localhost/xguest gvfs-cat: afp://xguest@localhost/xguest/: error opening file: The connection is closed Daemon log: Added new job source 0xbb88b0 (GVfsBackendAfp) Queued new job 0xb9f6f0 (GVfsJobMount) GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. send_reply, failed: 0 backend_dbus_handler org.gtk.vfs.Mount:OpenForRead Queued new job 0xba4350 (GVfsJobOpenForRead) ** (process:6778): CRITICAL **: g_vfs_afp_volume_open_fork_finish: assertion 'g_simple_async_result_is_valid (res, G_OBJECT (volume), g_vfs_afp_volume_open_fork)' failed (process:6778): GLib-CRITICAL **: g_error_copy: assertion 'error != NULL' failed
Created attachment 264546 [details] [review] afp: Don't crash when opening the root directory Previously, opening the root directory would generate an error and cause the backend to abort: backend_dbus_handler org.gtk.vfs.Mount:OpenForRead Queued new job 0xba4350 (GVfsJobOpenForRead) ** (process:6778): CRITICAL **: g_vfs_afp_volume_open_fork_finish: assertion 'g_simple_async_result_is_valid (res, G_OBJECT (volume), g_vfs_afp_volume_open_fork)' failed (process:6778): GLib-CRITICAL **: g_error_copy: assertion 'error != NULL' failed Instead, remove the special-casing for the root directory since it is handled correctly anyway.
Review of attachment 264546 [details] [review]: I'm unable to test it and also not sure why the special check for the root dir is there. I think there should be another fix without removing the check for root, but don't know GSimpleAsyncResult well. However if this is correctly handled in open_fork_cb, we can remove the check there probably. So please commit if the patch works for you.
Review of attachment 264546 [details] [review]: ::: daemon/gvfsafpvolume.c @@ -474,1 @@ Right, I think g_simple_async_report_error_in_idle() is broken since it doesn't set the source_tag of the created GSimpleAsyncResult which makes g_simple_async_result_is_valid() fail. Anyway shortcutting here is just a useless micro optimization so I agree that it can be removed.
Thanks for the review. Committed to master as 4ffe7f54444d70b3265070191fff46c06fe104ce and stable as 20bb9205b25ab07864f3733205e420508b2102a6. I opened glib bug 721458 for the above problem.