-
Notifications
You must be signed in to change notification settings - Fork 891
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
X11 specific interrupted syscall panic during multi-threaded debugging #1972
Comments
There's a PR open that aims to fix a similar issue (#1952), but the bug report and offer to fix it are appreciated nevertheless. |
Ah, thanks for the info @maroider. I should have checked the PRs as well, I kinda forgot about that, sorry. Should I close this issue then and just mention my points there? The PR is really quite related after all |
I'd say you should keep the issue open and put in your 2 cents in the PR. |
From a quick glance over all the |
During suspend/resume cycle there's a chance that polling syscall could be interrupted resulting in getting EINTR, however there's no reason to crash when getting this signal and we should retry polling. Fixes rust-windowing#1972.
The following line of code in the X11 platform implementation of the event loop reliably fails due to an EINTR when a debugger pauses all threads due to a breakpoint in another thread.
winit/src/platform_impl/linux/x11/mod.rs
Line 360 in 1c4d6e7
These panics look as follows:
Instead of simply being unwrapped, the
io::Result<()>
should probably be checked forkind == Interrupted
, in which case the polling should just be retried in a loop.As far as I can tell
SA_RESTART
will not prevent these kind of signal caused interruption errors.MCVE:
You may need to continue running the code / remove and re-add the breakpoint a few times, but for me it happens pretty reliably and pretty much immediately.
Given a couple days time I should be able to make a PR fixing this (though as a small heads-up, I have no experience with the winit codebase).
It might also be worth looking through the codebase for similar issues. The easiest way is probably looking for returned
io::Result<T>
s that just get.unwrap()
ed.While I found the issue during debugging, some other OS signals might also cause this issue.
The text was updated successfully, but these errors were encountered: