lukexor / tetanes

A cross-platform NES emulator written in Rust using wgpu
https://lukeworks.tech/tetanes-part-1
Apache License 2.0
161 stars 18 forks source link

AccessKit can result in a thread sleep deadlock #309

Open lukexor opened 3 months ago

lukexor commented 3 months ago

When adding AccessKit support, it was discovered that (at least on linux) that the accesskit implementation puts the thread to sleep and never wakes up. This happens in side async-io waiting on a zbus response inside a block_on request.

Need to gather more data for submitting an issue upstream and test on other platforms.

macos does not seem to have this issue

DataTriny commented 3 months ago

Hello @lukexor, thanks for trying out AccessKit.

The issue you describe here might be linked to the fact that the version of accesskit_unix used by egui doesn't implement lazy initialization, which might cause troubles if you are not running any assistive technologies on your system.

I can help investigate this once egui updates the dependency.

CC https://github.com/emilk/egui/pull/4702

lukexor commented 3 months ago

Hello @lukexor, thanks for trying out AccessKit.

The issue you describe here might be linked to the fact that the version of accesskit_unix used by egui doesn't implement lazy initialization, which might cause troubles if you are not running any assistive technologies on your system.

I can help investigate this once egui updates the dependency.

CC emilk/egui#4702

Thanks for the info! I'm actually working on a change to remove the egui winit and wgpu dependencies so that I can update those dependencies, which will mean implementing the access kit integration manually so I should be able to implement the required fixes as soon as that works completes

lukexor commented 3 months ago

I'll also add that it worked fine when the builtin screen reader in popOS was disabled and would read menu items as expected when it was enabled.

However, randomly but consistently when opening a menu or trying to interact with the UI besides just tabbing through widgets, the main thread would go to sleep and never wake up, freezing the main thread requiring it be killed.

lukexor commented 3 months ago

Now blocked on https://github.com/emilk/egui/issues/4219