Closed lalten closed 1 year ago
I reproduce, nautilus must be doing something special with the libraries when using a thumbnailer, will investigate.
here is the backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007ff6a54f80ed in XSync () from /usr/lib/libX11.so.6
(gdb) bt
#0 0x00007ff6a54f80ed in XSync () at /usr/lib/libX11.so.6
#1 0x00007ff6ae0a33cb in vtkXRenderWindowInteractor::Initialize() () at /usr/lib/libvtkRenderingUI.so.1
#2 0x00007ff6b0a1c167 in () at /usr/lib/libf3d.so
#3 0x00007ff6b0a19f41 in () at /usr/lib/libf3d.so
#4 0x00007ff6b0a07687 in f3d::engine::engine(f3d::window::Type) () at /usr/lib/libf3d.so
#5 0x00005653367f9145 in std::make_unique<f3d::engine, f3d::window::Type>(f3d::window::Type&&) ()
at /usr/include/c++/12.2.0/bits/unique_ptr.h:1065
#6 0x00005653367f6d8b in F3DStarter::Start(int, char**) (this=0x7ffe02e47b50, argc=5, argv=0x7ffe02e47c88)
at /home/glow/dev/f3d/src/application/F3DStarter.cxx:112
#7 0x00005653367fa32c in main(int, char**) (argc=5, argv=0x7ffe02e47c88)
at /home/glow/dev/f3d/src/application/main.cxx:13
(gdb)
So this may have something to do with permissions to access Xorg from the thubnailer in nautilus, F3D cant generate an image without an Xorg server running (for now, this may come in the future). You may want to investigate in this direction.
Somehow similar issue in VTK with docker ?
Turns out this is cause by nautilus using bwrap to sandbox the thumbnailers. There is no fix for this unless F3D start supporting headless rendering (through EGL or OSMESA). This may come at some point but not in the short term for sure. You can also build VTK in headless (EGL or OSMESA) and build F3D yourself in order to get a f3d binary that should work in nautilus.
Related issues: https://github.com/xournalpp/xournalpp/issues/1612
That being said, a work around that works right away is to use a virtual X server like xvfb or Xephyr. We use xvfb in our CI. By simply adding xvfb-run in the thumbnailer file like this:
Exec=xvfb-run f3d --dry-run -sta --no-background --output=%o --resolution=%s,%s %i
I was able to generate this in nautilus:
However, starting Xvfb comes with a big hoverhead, so this is more a hack than an actual solution.
We can keep this open until headless is supported by our binary.
I will add the workaround in our doc.
btw I opened a discussion on gnome discourse: https://discourse.gnome.org/t/about-the-use-of-bwrap-sandboxing-in-nautilus-thumbnailer/11314
We discussed this with @Meakk , it may be not that hard to add EGL support to F3D, we will look into it !
Thanks a lot for the quick investigation and workaround @mwestphal!
I can confirm the workaround works and I can confirm it is very slow ;P
❯ cat /usr/share/thumbnailers/f3d.thumbnailer
[Thumbnailer Entry]
Type=X-Thumbnailer
Name=f3d Thumbnailer
TryExec=f3d
Exec=xvfb-run f3d --config=thumbnail --quiet --output=%o --resolution=%s,%s %i
MimeType=application/vnd.3ds;application/gml+xml;application/dicom;model/gltf-binary;model/gltf+json;application/vnd.mhd;application/vnd.nrrd;model/obj;application/vnd.ply;application/vnd.pts;model/stl;application/x-tgif;model/vrml;application/vnd.vtk;application/vnd.vtp;application/vnd.vtu;application/vnd.vtr;application/vnd.vti;application/vnd.vts;application/vnd.vtm;model/iges;application/vnd.step;application/vnd.fbx;application/vnd.dae;image/vnd.dxf;application/vnd.off;application/vnd.abc;application/vnd.exodus
not even the workaround did work for me :(
(gnome 43, x11 session)
(org.gnome.Nautilus:206148): GnomeDesktop-DEBUG: 18:54:42.321: Failed to launch script: X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 150 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 61
Current serial number in output stream: 62
(org.gnome.Nautilus:206148): GnomeDesktop-DEBUG: 18:54:39.187: About to launch script: bwrap --ro-bind /usr /usr --ro-bind-try /etc/ld.so.cache /etc/ld.so.cache --symlink /usr//bin /bin --symlink /usr//lib64 /lib64 --symlink /usr//lib /lib --symlink /usr//sbin /sbin --ro-bind-try /var/cache/fontconfig /var/cache/fontconfig --setenv GST_REGISTRY_1_0 /home/knoopx/.cache/gnome-desktop-thumbnailer/gstreamer-1.0/gstreamer-1.0.registry --bind /home/knoopx/.cache/gnome-desktop-thumbnailer/gstreamer-1.0 /home/knoopx/.cache/gnome-desktop-thumbnailer/gstreamer-1.0 --ro-bind-try /etc/alternatives /etc/alternatives --proc /proc --dev /dev --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --setenv G_MESSAGES_DEBUG all --bind /tmp/gnome-desktop-thumbnailer-1YI7U1 /tmp --ro-bind file.obj /tmp/gnome-desktop-file-to-thumbnail.obj --seccomp 54 xvfb-run f3d --config=thumbnail --quiet --output=/tmp/gnome-desktop-thumbnailer.png --resolution=512,512 /tmp/gnome-desktop-file-to-thumbnail.obj
Thats unexpecte. Is F3D working locally, with or without xvfb-run ?
yes, working natively and under xvfb-run
but not under bwrap
Here is an experimental EGL version, feel free to test it in Nautilus. It works without a Xorg server here, but I need to install a nautilus setup to test it. https://transfer.sh/8li3fa/F3D-Linux-raytracing-egl.zip
headless version is now part of the release system and the nightly release contains it !
Download it here (the ones with headless in the name): https://github.com/f3d-app/f3d/releases/tag/nightly
We also documented the usecase here: https://f3d.app/doc/user/LIMITATIONS_AND_TROUBLESHOOTING.html#linux
However it is not possible to install both .deb release, so if you want to use the classic F3D release at the same time, you will want to extract the archive somewhere bwrap has access to and modify the .thumbnailer files (yes, they are now multiple) to point to it.
@lalten @knoopx
Describe the bug F3D segfaults when Nautilus asks it to generate thumbnails.
To Reproduce Steps to reproduce the behavior:
journalctl -f
Note that I can open the files just fine in
f3d
directly and can also doExpected behavior I expected thumbnails to be generated and shown in the file manager.
System Information:
❯ uname -a Linux tpxy 5.19.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Sep 2022 18:09:09 +0000 x86_64 GNU/Linux
Mesa Intel® HD Graphics 620 (KBL GT2)
F3D Information Paste the content of
f3d --version
:Additional context
Stacktrace (via
coredumpctl -1 debug
):Attached dumpfile:
Dumpfile: f3d-crash-2022092.dump.tar.gz