Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 683080 - gnome-base/nautilus-3.30 won't generate thumbnails
Summary: gnome-base/nautilus-3.30 won't generate thumbnails
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-11 08:52 UTC by sebB
Modified: 2023-10-26 15:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
test.patch (test.patch,21.64 KB, patch)
2019-11-14 20:28 UTC, sebB
Details | Diff
disable unshare all (3.30.5-disable-unshare.patch,464 bytes, patch)
2019-11-19 16:44 UTC, sebB
Details | Diff
3.32 disable unshare all (3.32.3-disable-unshare.patch,464 bytes, patch)
2019-11-19 17:01 UTC, sebB
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sebB 2019-04-11 08:52:43 UTC
According too https://bugs.gentoo.org/show_bug.cgi?id=653786 , thumbnails are supposed to work in nautilus.

Running gnome-light 3.30 (gnome/systemd profile) in a stable system don't generate thumbnails.
Files are create in .cache/thumbnails/fail/gnome-thumbnail-factory.

If I open an image with gimp, thumbnails is create after I refresh nautilus.

I've try with full gnome-3.30 and same issue.

Thanks

Reproducible: Always
Comment 1 Mart Raudsepp gentoo-dev 2019-10-13 10:41:52 UTC
Perhaps this is a manifestation of bug 697602 ?
Comment 2 sebB 2019-10-15 16:17:39 UTC
I've try with gdk-pixbuf 2.38.2 and 2.40 and same result.
No thumbnails.

Files are allways create in .cache/thumbnails/fail/gnome-thumbnail-factory.
Comment 3 Flesh 2019-11-05 19:43:19 UTC
I confirm this issue on a full ~amd64 system with gnome 3.32.

The problem persist since upgrade from 3.26.

Thanks
Comment 4 sebB 2019-11-14 20:27:39 UTC
Looking at dantrell overlay and the difference is this patch

https://github.com/dantrell/gentoo-overlay-dantrell-gnome-3-30/blob/master/gnome-base/nautilus/files/nautilus-3.30.0-dont-sandbox-thumbnailers-on-linux.patch

He revert this commit from gnome-desktop-thumbnail-script.c

https://gitlab.gnome.org/GNOME/gnome-desktop/commit/8b1db18aa75c2684b513481088b4e289b5c8ed92

I've test and it work.

To test I simply modify nautilus-3.30.5-r1 ebuild, mask all patch, and apply the test.patch (wich revert the commit 8b1db18a).

PATCHES=(
#       "${FILESDIR}"/${PV}-docs-build.patch
#       "${FILESDIR}"/${PV}-thumbnailer-updates{,2}.patch
#       "${FILESDIR}"/${PV}-seccomp-sparc32.patch
#       "${FILESDIR}"/${PV}-CVE-2019-11461.patch
        "${FILESDIR}"/${PV}-test.patch
)


Thumbnails are working.
Comment 5 sebB 2019-11-14 20:28:49 UTC
Created attachment 596172 [details, diff]
test.patch
Comment 6 Mart Raudsepp gentoo-dev 2019-11-17 22:15:37 UTC
Security will not be made optional. Need some hints why it would be broken with bubblewrap still for some. The only idea I have offhand is that there may be problems if the whole system is running under virtualization or containers, but I don't know of any details about any problems otherwise with it remaining.

Perhaps some comparison between bubblewrap ran thumbnailer and running it manually via
/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
could yield some interesting info.
%s is the size of thumbnail, probably something like "100x100".
%u is the input file.
%o is the output file of the thumbnail.

Though I guess that won't help, if patching bubblewrap and seccomp out makes it work.
Comment 7 sebB 2019-11-18 22:44:41 UTC
Running gdk-pixbuf-thumbnailer -s 256 image.jpg thumb.png work fine.

I've strace nautilus and this is the bwrap command invoqued

execve("/usr/lib/llvm/8/bin/bwrap", ["bwrap", "--ro-bind", "/usr", "/usr", "--ro-bind", "/etc/ld.so.cache", "/etc/ld.so.cache", "--ro-bind", "/bin", "/bin", "--ro-bind", "/lib64", "/lib64", "--ro-bind", "/lib", "/lib", "--ro-bind", "/sbin", "/sbin", "--ro-bind-try", "/var/cache/fontconfig", "/var/cache/fontconfig", "--proc", "/proc", "--dev", "/dev", "--chdir", "/", "--setenv", "GIO_USE_VFS", "local", "--unshare-all", "--die-with-parent", "--bind", "/tmp/gnome-desktop-thumbnailer-Y0BUB0", "/tmp", "--ro-bind", "/home/seb/a.jpg", "/tmp/gnome-desktop-file-to-thumbnail.jpg", "--seccomp", "28", "/usr/bin/gdk-pixbuf-thumbnailer", "-s", "256", "file:///tmp/gnome-desktop-file-to-thumbnail.jpg", "/tmp/gnome-desktop-thumbnailer.png"], 0x7ffead218c30 /* 54 vars */) = -1 ENOENT (Aucun fichier ou dossier de ce type)

I've try running

bwrap --ro-bind /usr /usr --ro-bind /etc/ld.so.cache /etc/ld.so.cache --ro-bind /bin /bin --ro-bind /lib64 /lib64 --ro-bind /lib /lib --ro-bind /sbin /sbin --ro-bind-try /var/cache/fontconfig /var/cache/fontconfig --proc /proc --dev /dev --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --bind /tmp/gnome-desktop-thumbnailer-Y0BUB0 /tmp --ro-bind /home/seb/a.jpg /tmp/gnome-desktop-file-to-thumbnail.jpg --seccomp 28 /usr/bin/gdk-pixbuf-thumbnailer -s 256 file:///tmp/gnome-desktop-file-to-thumbnail.jpg /tmp/gnome-desktop-thumbnailer.png

The error mesage is: bwrap: Creating new namespace failed: Invalid argument
Comment 8 sebB 2019-11-19 16:42:16 UTC
The Invalid argument is caused by "--unshare-all"

So disabling it with patch 3.30.5-disable-unshare make thumbnails work.

In the ebuild I simply apply this patch

PATCHES=(
       "${FILESDIR}"/${PV}-docs-build.patch
       "${FILESDIR}"/${PV}-thumbnailer-updates{,2}.patch
       "${FILESDIR}"/${PV}-seccomp-sparc32.patch
       "${FILESDIR}"/${PV}-CVE-2019-11461.patch
       "${FILESDIR}"/${PV}-disable-unshare.patch
)
Comment 9 sebB 2019-11-19 16:44:36 UTC
Created attachment 596776 [details, diff]
disable unshare all
Comment 10 sebB 2019-11-19 17:01:13 UTC
Created attachment 596784 [details, diff]
3.32 disable unshare all

Same think with nautilus 3.32.

Disabling --unshare-all make thumbnails work.

I don't know why this option is not working on gentoo.
I've strace nautilus on archlinux and this option is present and work.
Comment 11 Joonas Niilola gentoo-dev 2019-11-20 04:08:12 UTC
(In reply to sebB from comment #7)
> 
> The error mesage is: bwrap: Creating new namespace failed: Invalid argument

Thumbnailing works for me in nautilus without any patches, but this error led me to believe USER_NS might have something to do with it.

  # zgrep -i user_ns /proc/config.gz 
  CONFIG_USER_NS=y
  CONFIG_USER_NS_UNPRIVILEGED=y

I think Arch has disabled USER_NS in their kernel, and that's why they patch it.
Comment 12 sebB 2019-11-20 20:00:24 UTC
Thanks Joonas,

Enabling CONFIG_USER_NS=y do the job.
Comment 13 Mart Raudsepp gentoo-dev 2019-12-25 21:19:56 UTC
bubblewrap package already checks for USER_NS and complains if you don't have it. I'm not sure if we really want to add the same checks to gnome-desktop and nautilus too..
Comment 14 Pacho Ramos gentoo-dev 2023-10-26 15:12:36 UTC
(In reply to Mart Raudsepp from comment #13)
> bubblewrap package already checks for USER_NS and complains if you don't
> have it. I'm not sure if we really want to add the same checks to
> gnome-desktop and nautilus too..

I think it is enough to have them in bubblewrap ebuild