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 720743 - afp backend crashes when opening the root directory
afp backend crashes when opening the root directory
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: afp backend
git master
Other Linux
: Normal critical
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-19 13:58 UTC by Ross Lagerwall
Modified: 2014-01-04 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
afp: Don't crash when opening the root directory (1.55 KB, patch)
2013-12-19 13:59 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2013-12-19 13:58:28 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
Comment 1 Ross Lagerwall 2013-12-19 13:59:45 UTC
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.
Comment 2 Ondrej Holy 2014-01-03 16:51:08 UTC
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.
Comment 3 Carl-Anton Ingmarsson 2014-01-04 10:02:48 UTC
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.
Comment 4 Ross Lagerwall 2014-01-04 15:51:34 UTC
Thanks for the review. Committed to master as 4ffe7f54444d70b3265070191fff46c06fe104ce and stable as 20bb9205b25ab07864f3733205e420508b2102a6.

I opened glib bug 721458 for the above problem.