Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating thumbnails in Dolphin #5

Open
paul opened this issue Jun 1, 2023 · 4 comments
Open

Error generating thumbnails in Dolphin #5

paul opened this issue Jun 1, 2023 · 4 comments

Comments

@paul
Copy link

paul commented Jun 1, 2023

When I open Dolphin in a folder full of .stl files, a few render thumbnails, but most do not.

image

If I watch the log when I open the folder, it gets filled with error messages like this:

Jun 01 10:47:43 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:43 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:43 ava.home kioslave5[2788635]: com.stl-thumb-kde: STL-THUMB :: lib returned error
Jun 01 10:47:43 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:43 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:43 ava.home kioslave5[2788635]: com.stl-thumb-kde: STL-THUMB :: lib returned error
Jun 01 10:47:44 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:44 ava.home plasmashell[2788635]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 10:47:44 ava.home kioslave5[2788635]: com.stl-thumb-kde: STL-THUMB :: lib returned error

This is using plasmashell 5.27.5 on Fedora 38. It also reports the same error in a folder with only a single .stl file in it.

Not sure if its relevant, I commented out some stuff in create_headless_display and replaced it with context = cb.build_osmesa(size)?; and it logged this the first time, then the same "Creating EventLoop multiple times" after that:

Jun 01 11:00:49 ava.home kioslave5[2792683]: kf.coreaddons: "Could not load plugin from /usr/lib64/qt5/plugins/stlthumbnail.so: Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/stlthumbnail.so'"
Jun 01 11:00:49 ava.home plasmashell[2792683]: thread '<unnamed>' panicked at 'Initializing the event loop outside of the main thread is a significant cross-platform compatibility hazard. If you absolutely need to create an EventLoop on a different thread, you can use the `EventLoopBuilderExtUnix::any_thread` function.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/platform_impl/linux/mod.rs:658:13
Jun 01 11:00:49 ava.home plasmashell[2792683]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jun 01 11:00:49 ava.home kioslave5[2792683]: com.stl-thumb-kde: STL-THUMB :: lib returned error
Jun 01 11:00:57 ava.home plasmashell[2792683]: thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/rando/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/winit-0.27.3/src/event_loop.rs:106:13
Jun 01 11:00:57 ava.home kioslave5[2792683]: com.stl-thumb-kde: STL-THUMB :: lib returned error
...
@twelho
Copy link

twelho commented Jul 28, 2023

Same issue, with stl-thumb 0.5.0 and stl-thumb-kde 0.4.0 built from source on Fedora 38:

thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.27.3/src/event_loop.rs:106:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'Creating EventLoop multiple times is not supported.', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.27.3/src/event_loop.rs:106:13
com.stl-thumb-kde: STL-THUMB :: lib returned error

Sometimes when re-entering a directory I get a single additional thumbnail before stl-thumb panics.

@alextrical
Copy link
Contributor

alextrical commented Dec 24, 2023

I have noticed similar issues too, but not had chance to look into the cause of the issue. Its something I will be investigating over the holiday

Base OS: Fedora Kinoite 39
Window Manager: Wayland
Desktop: KDE

image

@alextrical
Copy link
Contributor

So from what I can tell some of those errors are coming from stl-thumb, but also don't look to be terminal, but could be causing some of the issues of "Running multiple times" as parts are "still attached"
image

@twelho
Copy link

twelho commented Dec 27, 2023

From what I remember looking into this, the core issue is the following: Dolphin will load stl-thumb-kde into memory once on startup and then call render_to_buffer for every file. render_to_buffer calls render_to_image in a separate thread, which then calls create_headless_display. However, there was a global static OnceCell in place, which prevented creating multiple contexts, even across threads, without unloading and reloading the application, resulting in #5 (comment). However, it seems like stuff has changed a lot over in glutin/glium land. The currently used version in stl-thumb still has the check in place. Similarly, for the latest glium, one needs to use winit directly for creating the event loop, and the check is still there, however, it is a bit more graceful now.

Ultimately, the correct solution would be to initialize the event loop and graphics context exactly once as the application is initialized, and not for every thumbnail rendering invocation. As a bonus, this should also be faster, since rendering a single thumbnail will not require a full context initialization. Hopefully this helps in the debugging quest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants