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 793121 - corrupt files via /run/user/<id>/gvfs
corrupt files via /run/user/<id>/gvfs
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: mtp backend
1.34.x
Other Linux
: Normal critical
: ---
Assigned To: Philip Langdale
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2018-02-02 14:29 UTC by j^
Modified: 2018-09-21 18:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description j^ 2018-02-02 14:29:28 UTC
files can be corrupt if copied from /run/user/<id>/gvfs/

this happens for files around 8-10k in size.
the resulting file is truncated.

the following fails:

cp "/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C018%5D/Internal storage/test.json" /tmp/failed.json

this works:

gio copy mtp://[usb:001,018]/Internal%20storage/test.json /tmp/ok.json
Comment 1 Philip Langdale 2018-02-05 19:28:44 UTC
There hasn't been a 1.34.x release with the fix for bug 784477 in it, and that might be related, as you are saying it only goes wrong using 'cp' which means it could be vulnerable to partial-read-past-EOF. The failure behaviour is undefined, and so your device may do something weird (my device stalls the transfer). Please retry with that fix applied and let us know.
Comment 2 Ondrej Holy 2018-02-06 08:50:15 UTC
I forgot to make the stable release, let's do it now, thanks for pointing it out!
Comment 3 j^ 2018-02-06 09:33:50 UTC
applied patch from bug 784477 to gvfs-1.34.1
with the patch applied cp still gives me a corrupt file.

"gio copy" still works but Gio in python (works without the patch) also fails now:

from gi.repository import Gio
data = Gio.File.new_from_uri('mtp://[usb:001,018]/Internal%20storage/test.json').load_contents(None).contents
Comment 4 Ondrej Holy 2018-02-09 10:53:35 UTC
Hmm. It is weird that python stop working, but it might be a consequence of custom build... so rather go back to your system version.

Does cp print some error, or just fail silently?

Can you please provide gvfsd log? See:
https://wiki.gnome.org/Projects/gvfs/debugging

Please use "GVFS_DEBUG=1 GVFS_DEBUG_FUSE=1 GVFS_MTP_DEBUG=all" in the second step. In the third step, please just connect the phone, try to copy one file using cp and then continue to the fourth step.
Comment 5 GNOME Infrastructure Team 2018-09-21 18:17:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/327.