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 589028 - gvfsd-archive doesn't handle deletion of mounted remote files
gvfsd-archive doesn't handle deletion of mounted remote files
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: archive backend
unspecified
Other All
: Normal critical
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-19 14:43 UTC by Aidan Fitzpatrick
Modified: 2013-10-27 04:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
archive: Handle open failure (960 bytes, patch)
2013-10-01 19:34 UTC, Ross Lagerwall
needs-work Details | Review
archive: Handle open failure (1.59 KB, patch)
2013-10-17 16:55 UTC, Ross Lagerwall
none Details | Review

Description Aidan Fitzpatrick 2009-07-19 14:43:01 UTC
Steps to reproduce:
1. Use sshfs to mount a remote filesystem.
2. In Nautilus, open mounted remote filesystem and click on an ISO. The ISO will be mounted.
3. In Nautilus, delete the ISO ("Move to deleted items folder")
4. On desktop, click the icon to explore the mounted ISO. Crash!

Stack trace:
ProblemType: Crash
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/lib/gvfs/gvfsd-archive
NonfreeKernelModules: nvidia
Package: gvfs-backends 1.2.1-0ubuntu1
ProcCmdline: /usr/lib/gvfs/gvfsd-archive file=/home/username/Documents/Backup/h-mo08s.iso
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
Signal: 11
SourcePackage: gvfs
StacktraceTop:
 __archive_check_magic () from /usr/lib/libarchive.so.2
 archive_read_next_header () from /usr/lib/libarchive.so.2
 ?? ()
 ?? ()
 ?? ()
Title: gvfsd-archive crashed with SIGSEGV in __archive_check_magic()
Uname: Linux 2.6.28-11-generic i686
UserGroups: adm admin audio cdrom dialout dip floppy fuse lpadmin plugdev pulse pulse-access pulse-rt sambashare uucp video

Other information:
There are detailed stack and backtrace attachments on the downstream bug at https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/355674.
Comment 1 Ross Lagerwall 2013-10-01 19:34:10 UTC
Created attachment 256212 [details] [review]
archive: Handle open failure

If gvfs_archive_open fails, libarchive immediately calls
gvfs_archive_close which causes a crash due to calling g_object_unref on
the NULL stream.
Comment 2 Ondrej Holy 2013-10-17 14:43:19 UTC
Review of attachment 256212 [details] [review]:

Thanks for your patch. It successfully fixes critical errors, however the backend should be unmounted in this case if source file doesn't exist. You can do that using g_vfs_backend_force_unmount.

::: daemon/gvfsbackendarchive.c
@@ +161,3 @@
+      g_object_unref (d->stream);
+      d->stream = NULL;
+    }

Better to use g_clear_object instead to safe several lines.
Comment 3 Ross Lagerwall 2013-10-17 16:55:53 UTC
Created attachment 257562 [details] [review]
archive: Handle open failure

If gvfs_archive_open fails, libarchive immediately calls
gvfs_archive_close which causes a crash due to calling g_object_unref on
the NULL stream.
Comment 4 Ross Lagerwall 2013-10-17 16:56:38 UTC
I have updated the patch with your comments taken into account.
Comment 5 Ross Lagerwall 2013-10-27 04:40:51 UTC
Pushed to master as 0cee04b and stable as 1de81a4 (since it's a crasher).  Thanks!