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 692318 - Protect against race between on_uevent and unmounting
Protect against race between on_uevent and unmounting
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: mtp backend
1.15.x
Other Linux
: Normal normal
: ---
Assigned To: Philip Langdale
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-22 19:01 UTC by Philip Langdale
Modified: 2013-01-23 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix error. (1.22 KB, patch)
2013-01-22 19:01 UTC, Philip Langdale
accepted-commit_now Details | Review

Description Philip Langdale 2013-01-22 19:01:51 UTC
Created attachment 234128 [details] [review]
Patch to fix error.

I've never seen this happen personally, but an Ubuntu bug reported
that on_uevent fired after the gudev client had been finalized, so
it must be possible to race between an explicit unmount and
physically unplugging a device. I made a brief attempt to reproduce
this but couldn't.
    
In any case, it's easy enough to protect against by taking a couple
of measures:
    
1) Explicitly disconnect the signal handler before unref'ing the
   gudev client.
2) Use g_signal_connect_object to keep the backend alive enough
   for on_uevent to complete.
Comment 1 Tomas Bzatek 2013-01-23 13:17:27 UTC
Review of attachment 234128 [details] [review]:

Seems fine to me, the changes are harmless. Let's see if it resolves the issue.
Please commit.
Comment 2 Philip Langdale 2013-01-23 17:14:50 UTC
Thanks!