regression: evince attempts illegal lseek on gvfs mounted ftp files
Summary
Evince 44.3 fails to open PDF files on remote ftp shares mounted in Nautilus via gvfs
Description
After having mounted a remote FTP share in Nautilus via gvfs (gvfs 1.50.6-1
), some programs are capable of opening the pdf files exposed via gvfs (among them, pdf arranger, firefox, gio info, gedit, atril, etc).
Trying to open the file in Evince (evince 44.3-1
from archlinux) results in the following error:
Unable to open document “file:///run/user/1000/gvfs/ftp:host=192.168.1.101,user=scan/usr/home/scan/image2022-11-11-235740.pdf”. Data connection closed
gio info
is able to access the above mentioned gvfs URI to display document metadata.
Atril (atril 1.26.1-1 from archlinux) is also able to open and display the remote file right from Nautilus.
So do other programs such as pdf arranger, and even Evince from Ubuntu 22.04 (evince 42.3
) is able to open the remote file, so I think this might be a regression.
Gimp 2.10 fails with a Stream is not seekable
error.
I'm attaching a video recording of a reproduction of the bug, and an archive containing the output of Evince trying to open the remote file under strace
with strace -ffo ev_strace evince "/run/user/1000/gvfs/ftp:host=192.168.1.101,user=scan/usr/home/scan/image2022-11-11-235740.pdf"
in particular, as visible in pid 50991 (ev_strace.50991), Evince 44.3 successfully opens the file via gvfs on FD 16, then attempts an lseek on it (which fails), closes the file descriptor and then attempts to read again from it right away:
openat(AT_FDCWD, "/run/user/1000/gvfs/ftp:host=192.168.1.101,user=scan/usr/home/scan/image2022-11-11-235740.pdf", O_RDONLY|O_CLOEXEC) = 16
newfstatat(16, "", {st_mode=S_IFREG|0600, st_size=515096, ...}, AT_EMPTY_PATH) = 0
lseek(16, 0, SEEK_END) = -1 ESPIPE (Illegal seek)
close(16) = 0
getpid() = 50972
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 16
poll([{fd=16, events=POLLIN}], 1, 0) = 0 (Timeout)
write(16, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x7f1c680010b0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
close(16) = 0
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 16
write(9, "\1\0\0\0\0\0\0\0", 8) = 8
poll([{fd=16, events=POLLIN}], 1, -1) = 1 ([{fd=16, revents=POLLIN}])
futex(0x7f1c6803c9a0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
read(16, "\1\0\0\0\0\0\0\0", 8) = 8
read(16, 0x7f1c777fca80, 8) = -1 EAGAIN (Resource temporarily unavailable)