GNOME Bugzilla – Bug 589028
gvfsd-archive doesn't handle deletion of mounted remote files
Last modified: 2013-10-27 04:40:51 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.
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.
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.
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.
I have updated the patch with your comments taken into account.
Pushed to master as 0cee04b and stable as 1de81a4 (since it's a crasher). Thanks!