GNOME Bugzilla – Bug 777794
Crashes in forced_unregister_mount_callback
Last modified: 2017-01-27 07:22:52 UTC
MTP backend often crashes in forced_unregister_mount_callback. It happens also in gphoto2/cdda/afc backend, but not so often. I think that I find the cause, the problem is that g_vfs_backend_force_unmount is called multiple times... See: https://bugzilla.redhat.com/show_bug.cgi?id=1416636 https://retrace.fedoraproject.org/faf/problems/?component_names=gvfs&function_names=forced_unregister_mount_callback
Created attachment 344325 [details] [review] backend: Hold reference during force unmount g_vfs_backend_force_unmount may be called multiple times, or in parallel with regular unmount operation. Hold backend reference during the whole force unmount procedure in order to avoid unwanted segfaults.
Created attachment 344327 [details] [review] mtp: Disconnect uevent handler immediately Uevent handler with "remove" action may be called multiple times, which causes that g_vfs_backend_force_unmount is called several times, which may lead to segfault. Disconnect the uevent handler immediately after g_vfs_backend_force_unmount call.
Created attachment 344328 [details] [review] gphoto2: Disconnect uevent handler immediately
Created attachment 344329 [details] [review] cdda: Disconnect uevent handler immediately
Review of attachment 344327 [details] [review]: Looks good to me.
Review of attachment 344325 [details] [review]: Ship it.
Review of attachment 344328 [details] [review]: Ship it.
Review of attachment 344329 [details] [review]: Ship it.
Attachment 344325 [details] pushed as 1ccf776 - backend: Hold reference during force unmount Attachment 344327 [details] pushed as 32213bc - mtp: Disconnect uevent handler immediately Attachment 344328 [details] pushed as d864620 - gphoto2: Disconnect uevent handler immediately Attachment 344329 [details] pushed as cd4f923 - cdda: Disconnect uevent handler immediately
Thanks for the reviews!