-
Notifications
You must be signed in to change notification settings - Fork 36
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
Seeming deadlock on select! #51
Comments
huh, interesting failure! i have a bit of async experience but, the internals of this are unfamiliar to me... @mgottschlag no obligations but, any ideas? absolutely grasping at straws but:
|
Thanks for your response :) I've tried running it with A detail I forgot to mention: I'm running this in a Buildroot environment on kernel 4.19.97, in case anyone is trying to reproduce this issue. I've not quite figured out how to build a newer kernel this way, so I hope that this version isn't missing some important fixes to the gpio device driver that could affect this issue. |
Additionally: I'd completely missed it while trying to look for similar issues, but it seems that I'm effectively trying to accomplish what #18 is describing. Sadly no real solution to the problem/how to do it either, so this is just what I came up with. |
When running this with Seems like this futex_wait is actually due to the When switching to a single thread of execution (using I'll also be trying this with the gpiomon tool. |
I've tried this with |
After some more investigation, it seems that it might be an issue in Tokio itself or the way Streams are implemented, somehow. I made my own fork and updated it to Tokio 1 (master...datdenkikniet:tokio-update), but it seems to exhibit the exact same behaviour. What happens is: the Removing the I'm unsure if this issue still belongs in gpio-cdev (possibly an incorrect implementation of poll_event?) or in Tokio/Futures. Any guidance would be appreciated. |
I am sorry I cannot contribute - I actually do not have much low-level tokio experience. Anyways, so the summary right now is:
|
Whoops, pressed the wrong button. Thanks for the feedback. Yes, your summary seems to reflect what I've found so far. AFAIK I'm using
|
So, I wasn't entirely correct: What happens is that the Very unsure why it happens. |
Hello,
When using the following snippet in my code (as part of a Wiegand reader program) on a Raspberry Pi 0:
it seems like the code ends up in a Deadlock in the select! macro after running this snippet for 128 times, after which the program uses 100% CPU but neither of the
Next
s ever completes.events0
andevents1
areAsyncLineEventHandle
s that come fromLine
s that come from the sameChip
.Introducing a millisecond delay at the very top increases the amount of bytes that can be read to 256.
Introducing a larger delay seems to remove the deadlock all together, but the ordering of the events is lost causing the data to become garbage as the order of the events determines the final data output.
I'm not certain if this is a gpio-cdev problem, a kernel problem, or if I'm simply doing this incorrectly.
Any feedback is highly appreciated.
The text was updated successfully, but these errors were encountered: