-
Notifications
You must be signed in to change notification settings - Fork 167
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
segfault when enabling EGL hardware-acceleration and stopping the wayland loop #1443
Comments
From what I've noticed, it happens when you did Not unlikely that this has something to do with drop order, but I'm pretty sure I tried different drop orders a while ago and they all caused this segfault. |
that's the most consistent way i can reproduce this segfault in my own compositor too, opening |
i don't know how helpful that is, but you can "fix" (it doesn't happen anymore) the segfault by leaking a reference to the diff --git a/smallvil/src/main.rs b/smallvil/src/main.rs
index 6c4c46e33f..78e0f7aaea 100644
--- a/smallvil/src/main.rs
+++ b/smallvil/src/main.rs
@@ -29,6 +29,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let display: Display<Smallvil> = Display::new()?;
let display_handle = display.handle();
+
+ let _display_handle = display_handle.clone();
+ let _leak = Box::leak(Box::new(_display_handle));
+
let state = Smallvil::new(&mut event_loop, display);
let mut data = CalloopData { i don't know how to change the drop order, so i'm sorry for not being able to provide more, but i'll try to get back to it some other time i guess |
did some more testing, and found out that the segfault in my smallvil reproduction example does not happen at the same place as in using smithay/src/backend/egl/display.rs Line 1228 in 3731734
you can properly fix the segfault by dropping the diff --git a/smallvil/src/main.rs b/smallvil/src/main.rs
index 6c4c46e33f..d3ec176df3 100644
--- a/smallvil/src/main.rs
+++ b/smallvil/src/main.rs
@@ -55,5 +55,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Smallvil is running
})?;
+ drop(event_loop);
+
Ok(())
} in niri and in my own compositor the segfault happens at https://github.com/Smithay/wayland-rs/blob/48e74e9ef497d62b770b9b862ee4cb0876dc2494/wayland-backend/src/sys/server_impl/mod.rs#L434 and dropping the |
i did a bisection on my own compositor when the segfault first appears in m4rch3n1ng/mayland@85c9e66 it also happens at smithay/src/backend/egl/display.rs Line 1228 in 3731734
event_loop earlier it doesn't fix it, instead it happens where it happens now.
a commit later, after a refactor with winit in m4rch3n1ng/mayland@e1d9046 it just happens at https://github.com/Smithay/wayland-rs/blob/48e74e9ef497d62b770b9b862ee4cb0876dc2494/wayland-backend/src/sys/server_impl/mod.rs#L434 now and hasn't changed since. |
trying to spawn
smallvil
with--comannd "kitty"
(or alacritty) doesn't actually spawn them, but instead gives me this errori found out that to fix that, i have to enable EGL hardware-acceleration like i did in m4rch3n1ng@0d083cf.
now, kitty and alacritty spawn just fine, but closing the winit window will now cause a segfault:
for me this also happens in my own compositor and in niri, but i can't get it to reproduce in
anvil
and i don't know how to fix it.i don't know where exactly this issue lays, but since i don't actually use
unsafe
there, i don't think it should segfault.the segfault happens both when closing the winit window using
toplevel.send_close()
and stopping the event loop usingloop_signal.stop()
, with awinit
and audev
backend and in bothrelease
anddebug
mode.The text was updated successfully, but these errors were encountered: