Skip to content
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

spt: Fix hang in solo5_yield #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

reynir
Copy link
Contributor

@reynir reynir commented Sep 19, 2024

Same fix as in 97a66f6

Calling solo5_yield(0, ...) results in passing a struct itimerspec with an it_value of zero in both fields to timerfd_settime(), which disarms the timer, which causes the subsequent call to epoll_pwait() to hang forever if no other file descriptors (external events) have been registered with the waitset.

This addresses mirage/mirage-solo5#97

Dune cache was interfering and this patch only worked once I disabled the dune cache.

Same fix as in 97a66f6

Calling solo5_yield(0, ...) results in  passing a struct itimerspec with
an it_value of zero in both fields to timerfd_settime(), which disarms
the timer, which causes the subsequent call to epoll_pwait() to hang
forever if no other file descriptors (external events) have been
registered with the waitset.
@Firobe
Copy link

Firobe commented Sep 19, 2024

I confirm this fixes the issue, thank you :)

@reynir
Copy link
Contributor Author

reynir commented Sep 20, 2024

I think it could be nicer both in spt and hvt to check if deadline is zero and then call epoll_pwait() with 0 as timeout instead of -1, but it requires a bit more code and I don't feel confident with that task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants