-
Notifications
You must be signed in to change notification settings - Fork 198
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
Deadlock in when poll is hooked by coroutine lib #355
Comments
Do you mean that You could "fix" it by using a patched version of |
Yes, the yield in libco's poll is what I mean. But getrandom is a very general function and will be called in any situation, which means this function should be extremely safe, and the behavior need be predictable. So there should be a not infinity timeout and make a fast fail with a assert. In another case, if /dev/random is not readable, dose the poll wait forever? |
Not in situations where you break fundamental assumptions used in Rust. We can not be and will not be responsible for situations where you intercept syscalls, fundamentally change their behavior, and change threading model under our foot. At the very least you (read,
Yes, it's possible in low-entropy scenarios (e.g. on virtual machines early in the boot process). Security is one of the highest priorities for us. But we may introduce an option for explicitly opting-in into less blocking, but potentially less secure version of |
Ok, I understand that it's actually the limitations of libco, but I was truly confused when it happened in such a general function. |
I meet a deadlock case when using 'getrandom_inner' in libco environment, and libco will hook poll.
co1 and co2 are two coroutine, and this happen at the first call of getrandom_inner: co1 poll and switch to co2, co2 deadlock when call mutex.lock
The text was updated successfully, but these errors were encountered: