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 749093 - inserting a blank disk, dvd, cd, etc causes gvfs-udisks2-volume-monitor to segfault
inserting a blank disk, dvd, cd, etc causes gvfs-udisks2-volume-monitor to se...
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: burn backend
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2015-05-08 07:27 UTC by kendell clark
Modified: 2016-02-10 07:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (2.91 KB, text/plain)
2015-05-12 14:25 UTC, Ondrej Holy
  Details
common: Fix possible crash with blank disks (962 bytes, patch)
2015-05-12 19:59 UTC, Bastien Nocera
committed Details | Review
monitor: Do not search for any path on blank disks (5.75 KB, patch)
2015-05-13 07:07 UTC, Ondrej Holy
reviewed Details | Review

Description kendell clark 2015-05-08 07:27:30 UTC
steps to reproduce. Open your cd/dvd/bd drive and insert a blank disk. Close the tray and wait. Let the disk spin up and then look at the logs. You should see a segfault message from systemd, or if not using systemd, in your kernel log. I've got a snippet of log that shows the segfault, with as much info as I could get below. I'll paste.  
May 08 02:13:51 tigger /usr/lib/gdm/gdm-x-session[406]: Activating service name='org.gtk.Private.UDisks2VolumeMonitor'
May 08 02:13:51 tigger org.gtk.Private.UDisks2VolumeMonitor[414]: disc.c:332: error opening file BDMV/index.bdmv
May 08 02:13:51 tigger org.gtk.Private.UDisks2VolumeMonitor[414]: disc.c:332: error opening file BDMV/BACKUP/index.bdmv
May 08 02:13:51 tigger /usr/lib/gdm/gdm-x-session[406]: Successfully activated service 'org.gtk.Private.UDisks2VolumeMonitor'
May 08 02:14:29 tigger org.gtk.Private.UDisks2VolumeMonitor[414]: bluray.c:1338: No device path provided!
May 08 02:14:29 tigger gnome-session[416]: (tracker-extract:767): GVFS-RemoteVolumeMonitor-WARNING **: Owner of volume monitor org.gtk.Private.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
May 08 02:14:29 tigger gnome-session[416]: (gnome-shell:612): GVFS-RemoteVolumeMonitor-WARNING **: Owner of volume monitor org.gtk.Private.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
May 08 02:14:29 tigger gnome-session[416]: (nautilus:762): GVFS-RemoteVolumeMonitor-WARNING **: Owner of volume monitor org.gtk.Private.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
May 08 02:14:29 tigger gnome-session[416]: (tracker-miner-fs:738): GVFS-RemoteVolumeMonitor-WARNING **: Owner of volume monitor org.gtk.Private.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
May 08 02:14:29 tigger systemd-coredump[1048]: Process 677 (gvfs-udisks2-vo) of user 1000 dumped core. 
This occurs with gvfs built from git master. It also occurs with latest package in the arch repo, v1.24.1. This does not happen with any other media. Flash drive, audio player, a disk with content on it, only a blank disk. A restart of gnome will fix it, but it will crash when it tries to look at the blank disk.
Comment 1 Ondrej Holy 2015-05-12 14:25:33 UTC
Created attachment 303265 [details]
backtrace

Thanks for your bug report.

The crash is reproducible (just it was hard to find empty disk for me). Attaching the backtrace.

This could be also relevant with following errors (printed from the daemon):
disc.c:332: error opening file BDMV/index.bdmv
disc.c:332: error opening file BDMV/BACKUP/index.bdmv
bluray.c:1338: No device path provided!
Comment 2 Ondrej Holy 2015-05-12 15:30:53 UTC
It is caused by the following commit:
http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=da324c9abc045e3059936ef2dcb620fdc7ceb5b1

But it would be good to fix it also in gvfs. We shouldn't call bd_open with empty device path and they shouldn't crash in such case...
Comment 3 Bastien Nocera 2015-05-12 19:59:46 UTC
Created attachment 303283 [details] [review]
common: Fix possible crash with blank disks

Never call bd_open() with an empty path.
Comment 4 Ross Lagerwall 2015-05-12 21:55:38 UTC
Review of attachment 303283 [details] [review]:

Looks good!
Comment 5 Ondrej Holy 2015-05-13 07:07:30 UTC
Created attachment 303288 [details] [review]
monitor: Do not search for any path on blank disks

Bastien's patch fixes the issue, but I think we should not call any of g_vfs_mount_info_query_ functions if mount_path is NULL.
Comment 6 Bastien Nocera 2015-05-13 08:04:07 UTC
(In reply to Ondrej Holy from comment #5)
> Created attachment 303288 [details] [review] [review]
> monitor: Do not search for any path on blank disks
> 
> Bastien's patch fixes the issue, but I think we should not call any of
> g_vfs_mount_info_query_ functions if mount_path is NULL.

Path is NULL, but the URI isn't. The burn:/// scheme isn't backed by fuse.
Comment 7 Ross Lagerwall 2015-05-13 21:12:42 UTC
Review of attachment 303288 [details] [review]:

I think the original patch was fine. Searching for (.xdg-volume-info, autorun.inf) doesn't seem to require a filesystem path so this patch is probably not necessary.
Comment 8 Ondrej Holy 2015-05-14 07:18:27 UTC
Only case when mount_entry (and also mount_path) is NULL is for empty disks, isn't it? Yes, uri isn't NULL, it is "burn:///". Is it really intended to check for burn:///autorun.inf and burn:///.xdg-volume-info (for empty disks)?
Comment 9 Ondrej Holy 2015-05-14 08:03:35 UTC
It should be fixed in libbluray already (I sent them fix yesterday, however they pushed own fix in a similar time):
https://mailman.videolan.org/pipermail/libbluray-devel/2015-May/002061.html
Comment 10 Ross Lagerwall 2015-05-23 20:32:17 UTC
(In reply to Ondrej Holy from comment #8)
> Only case when mount_entry (and also mount_path) is NULL is for empty disks,
> isn't it? Yes, uri isn't NULL, it is "burn:///". Is it really intended to
> check for burn:///autorun.inf and burn:///.xdg-volume-info (for empty disks)?

I don't think it matters either way.
Comment 11 Ondrej Holy 2015-06-16 12:03:47 UTC
Comment on attachment 303283 [details] [review]
common: Fix possible crash with blank disks

commit 7deded463b8cc148103c55460a84a6b23342c941