GNOME Bugzilla – Bug 715119
MTP Backend can crash during unmount due to overlapping operations
Last modified: 2013-12-12 18:54:30 UTC
Created attachment 261360 [details] [review] Fail fast during unmounts I've seen a large number of bug reports on Ubuntu (where crash-on-exit is visible due to the crash reporter) related to operations executing during an unmount.
I recommend taking this fix in the 1.18 branch as these crash-on-exit scenarios seem pretty common.
Wouldn't it be better if this were done at the gvfs daemon level rather than in the backend itself, since I would imagine similar problems occurring with all backends? E.g. the operation should not be forwarded to the backend if an unmount has started.
(In reply to comment #1) > I recommend taking this fix in the 1.18 branch as these crash-on-exit scenarios > seem pretty common. I assume you mean the 1.16 branch?
(In reply to comment #3) > (In reply to comment #1) > > I recommend taking this fix in the 1.18 branch as these crash-on-exit scenarios > > seem pretty common. > > I assume you mean the 1.16 branch? Well, master is 1.19 right? So the initial backport would be to 1.18. It's not worth going back to 1.16, me thinks. There's probably some virtue in dealing with this at the daemon level, yes, but I didn't realise it was a general problem until after I committed the fix and did more poking around. There's also bug 702385 which is what exposed it in the first place - Nautilus is reliably invoking operations after unmount, which sometimes leads to re-mounting occurring, or an error if the old backend gets the request.
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #1) > > > I recommend taking this fix in the 1.18 branch as these crash-on-exit scenarios > > > seem pretty common. > > > > I assume you mean the 1.16 branch? > > Well, master is 1.19 right? So the initial backport would be to 1.18. It's not > worth going back to 1.16, me thinks. Oh, sorry, I got confused. > > There's probably some virtue in dealing with this at the daemon level, yes, but > I didn't realise it was a general problem until after I committed the fix and > did more poking around. > > There's also bug 702385 which is what exposed it in the first place - Nautilus > is reliably invoking operations after unmount, which sometimes leads to > re-mounting occurring, or an error if the old backend gets the request. I opened a new bug to fix this at the daemon level (bug 719327). When that get fixed, we can remove the MTP-specific fix.
This introduced a compilation warning which could possibly cause a crash: gvfsbackendmtp.c: In function ‘do_query_info’: gvfsbackendmtp.c:1243:14: warning: ‘elements’ may be used uninitialized in this function [-Wmaybe-uninitialized] The FAIL_DURING_UNMOUNT(); should be put after all the variable initializers.
Fixed.
*** Bug 719322 has been marked as a duplicate of this bug. ***