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 792169 - g_file_copy freezes on CIFS mount
g_file_copy freezes on CIFS mount
Status: RESOLVED NOTGNOME
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-01-03 15:20 UTC by Ondrej Holy
Modified: 2018-01-04 10:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
output of strace gio (364.07 KB, text/plain)
2018-01-03 17:03 UTC, Steve Christen
Details

Description Ondrej Holy 2018-01-03 15:20:49 UTC
g_file_copy freezes sometimes when copying files within one CIFS mount. It doesn't happen everytime, but it seems it can be reproduced when "copying dir" with many files using "gio copy":
mkdir CIFSMOUNT/BAR; for file in CIFSMOUNT/FOO/*; do gio copy -p "$file" CIFSMOUNT/BAR/${file##*/}; done

It freezes with following trace:
  • #0 splice
    at ../sysdeps/unix/sysv/linux/splice.c line 26
  • #1 do_splice
    at gfile.c line 2868
  • #2 splice_stream_with_progress
    at gfile.c line 2936
  • #3 file_copy_fallback
    at gfile.c line 3208
  • #4 g_file_copy
  • #5 handle_copy
    at gio-tool-copy.c line 182
  • #6 __libc_start_main
    at ../csu/libc-start.c line 308
  • #7 _start

The proposed patch from Bug 791457 seemingly fixes this issue, but I would say that it rather reduces the chance of it... any idea what is wrong?

This was initially wrongly reported in https://bugzilla.gnome.org/show_bug.cgi?id=784770#c4...
Comment 1 Ondrej Holy 2018-01-03 15:24:16 UTC
Actually, it seems that it fails on the same file every time and it is reproducible just with "gio copy" of that concrete file.

If I do the following change:
@@ -2868 +2868 @@ retry:
-  result = splice (fd_in, off_in, fd_out, off_out, len, SPLICE_F_MORE);
+  result = splice (fd_in, off_in, fd_out, off_out, len, SPLICE_F_NONBLOCK);

...it returns "Error splicing file: Resource temporarily unavailable" in the last iteration (off_in and off_out are equal to file size).

I can't reproduce with the same file on ext4. So maybe something wrong in kernel CIFS module...?
Comment 2 Philip Withnall 2018-01-03 15:27:03 UTC
If it’s freezing in the splice() syscall, then that sounds like a kernel FS driver problem, not a GLib problem. Similarly, if you can’t reproduce with ext4 (but the same code path is being taken in GLib), then that also points towards it being a kernel problem.

I guess you’re probably still investigating this right now — but unless you find any evidence to the contrary, I’d be tempted to close this as NOTGNOME.
Comment 3 Steve Christen 2018-01-03 17:03:15 UTC
Created attachment 366251 [details]
output of strace gio

I can reproduce this bug on smb-shares. No problem with nfs. Only when copying multiple files. Always on the same file.

$ strace -o output.txt gio copy * /home/sysop/foo/
Comment 4 Ondrej Holy 2018-01-04 08:38:53 UTC
I don't have any evidence that this is GLib problem, so probably let's close this as NOTGNOME, but I would say that this is quite serious and we have to be sure that this is going to be fixed. Steve, can you please report it to the following places:

https://bugzilla.samba.org/buglist.cgi?component=kernel%20fs&list_id=14383&product=CifsVFS&resolution=---

and/or

https://bugzilla.kernel.org/buglist.cgi?component=CIFS&product=File%20System&resolution=---
Comment 5 Steve Christen 2018-01-04 10:32:20 UTC
https://bugzilla.kernel.org/show_bug.cgi?id=198349