-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
eframe X11 crash after using thread spawn #1358
Comments
Same here
OS: Arco Linux X11 |
I think this is a problem that should be reported to |
Have same on Arch Linux x64 (Manjaro), X11, Intel HD 3000, mesa 21.3.7-2. |
Anyone wants to dig into this? Likely culprits include |
I have this in Cargo.toml: |
same issue. i suspect there's an issue somewhere inside glutin, i tried (ubuntu/latest mesa driver [from obiaf repo]) using both fltk and sdl with glow... even winit with egui wgpu backend, everything's working fine. |
Just as a data point I just upgraded to a much faster machine (from circa 2009 4 core i7 to 16 core ryzen), and my egui app does this every time. I have yet to see it run :-( On the slower machine, it never happened. |
Seems like a lot of people have problem with this, yet nobody has tried to reproduce it using pure Try https://github.com/grovesNL/glow/tree/main/examples/hello with the glutin backend and spawn a thread and see if you can reproduce. Maybe try |
I can't test https://github.com/grovesNL/glow/tree/main/examples/hello : But I have same error on https://github.com/emilk/egui/blob/0.17.0/egui_glow/examples/pure_glow.rs and https://github.com/emilk/egui/blob/0.17.0/egui_glium/examples/pure_glium.rs |
I tried glow hello w/glutin backend. The same error occurs. There is no backtrace, just core dump. I was able to get something of a backtrace from the core dump:
|
I should note I didn't modify hello at all, just built debug, and ran it. It ran as expected once out of about 20 runs. I am using i3. It runs more often if I run it in a subdivided screen so the initial window is smaller. Maybe 1/3 of the time it works this way. |
I am using a 3rd generation pentium, just putting it there for context |
@ambihelical please open an issue in the glutin repository! |
@emilk Hmmm, it turned out my new system did not have correctly set up nvidia drivers and was using software rendering. After I fixed, this I no longer get the crash. Possibly I was seeing a different bug than everyone else? I will continue to monitor things, if it occurs I'll do that. |
@emilk the root cause of this problem is that glutin can't tolerate any gpu without vsync support (i have no idea why the reason behind this, intentionally or just a poorly written bug?), and the simple solution to this problem is that just ignore swap_interval only if the gpu has no swap interval extension (vsync) support as mentioned on this PR: rust-windowing/glutin#1387 or we can just simply remove this (needless error message) line inside glutin. but nobody seems to care and not being merged. |
the PR: rust-windowing/glutin#1387 finally being merged a while ago, waiting for glutin > v0.28.0 release |
I finally installed an Ubuntu VM and ran into this exact issue ^^ probably because of using a software renderer like @ambihelical suspected. |
for glutin > v0.28.0 or patched glutin, turn off vsync. // When compiling natively:
fn main() {
// Log to stdout (if you run with `RUST_LOG=debug`).
// tracing_subscriber::fmt::init();
let mut options = eframe::NativeOptions {
// Let's show off that we support transparent windows
transparent: true,
drag_and_drop_support: true,
..Default::default()
};
// like so
options.vsync = false;
eframe::run_native(
"egui demo app",
options,
Box::new(|cc| Box::new(egui_demo_lib::WrapApp::new(cc))),
);
} the error will be gone. |
@emilk exactly, even in software render egui runs quite fast. |
I just turned off vsync for test, but this doubles the CPU load for me. Not really on option therefore. |
@sourcebox of course, the main purpose of vsync is... to stabilize the frame rate and it also reduce the CPU consumtion on HW with GPU acceleration, but when it comes down to software render that's different story. |
@ar37-rs I do some frame limiting on my own now, but even with vsync disabled I get the error on my old notebook which is only supporting OpenGL ES2. But I have some multithreading going on, so this might be the cause. On my newer notebook which basically the same software configuration, everything is running fine even with vsync enabled. |
@sourcebox i'm using mesa OpenGL 4.5 llvmpipe software render > 20.x.x on ubuntu vm intel skylake, even if i use the latest patched glutin from rust-windowing github repo (not the current version of glutin which 0.28.0) my egui app suddenly crashing with vsync enabled, so i have to disable vsync in my case in other to work. |
For a simple app like this with no complex 3D rendering, VSync is not required. See also emilk/egui#1358
Maybe your GPU doesn't support the latest OpenGL version? I just tried looking into this bug by playing with the hello example, and I got the same issue with that example. However, when I added this line below line 35, and ran it using
I didn't have this issue any more. I also experienced a similar issue with another app/game, but I was able to fix that issue for myself by telling it what OpenGL version to use when creating the OpenGL context. |
Is some of your problems solved with #1693 ? |
Unfortunately not. |
i have the same error, using linux mint 20.3 with KDE plasma as the desktop, eframe & egui 0.19.0 |
This shouldn't happen with the wgpu backend (?) |
Describe the bug
Random crash 1 out of 4 times when spawning a thread with
thread::spawn
on X11To Reproduce
Steps to reproduce the behavior:
eframe
appthread::spawn
withloop{}
Expected behavior
N/A
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: