-
Notifications
You must be signed in to change notification settings - Fork 82
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
Segmentation fault in safe code when writing to wayland window managed by winit #293
Comments
It should work if you store the event queue and dispatch it during
|
I considered trying something like that myself, but when I have the event queue not dropped by the time that set_buffer is called, the entire desktop (mouse movement and everything) freezes, and then my program terminates with the following error message:
This happens even if I process the event queue's events exactly as you do in your example code. |
Dropping the event queue is probably the cause of the segfault. Dispatching the queue before everything else should fix the pool error (it does for me). I think the yanky mouse could be the result of submitting a lot of buffers in a short period. Had not much time to check but I think the example renders without a delay, so you fill up the server with buffers. |
I am currently working on rewriting the Wayland backend in my crate Softbuffer. I am using this client toolkit to do so since its automatic buffer management from the pool seems useful. I'm writing my code based on the image_viewer example in commit f03c4b7. My current code is here, which is a pretty good almost minimum example.
The issue is that when I run this (on Gnome 42.4 on Fedora), I get segmentation faults shortly after running. According to GCC these faults take place in wayland-client at src/native_lib/event_queue.rs. It seems quite likely to me that I am doing something wrong, but this also looks like a safety bug in either the client toolkit or wayland-client, as my only unsafe code for this backend in Softbuffer is to cast the handles from raw window handle, and the client toolkit advertises safety in its readme on crates.io.
To reproduce this bug, simply run an example. I am testing with the animation example primarily, however the others seem to have the problem too.
cargo run --example animation
The text was updated successfully, but these errors were encountered: