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

CA-387588: Unixext.really_read: restart on EINTR #86

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

edwintorok
Copy link
Contributor

To reproduce a forkexecd unit test failure I've run it under rr. This caused a different failure: EINTR from read.

Unixext already has code to defend against EINTR on write, but not on read: add missing loop.

It is unclear whether this is a bug in rr or not, but according to the signal(7) manpage some syscalls may return EINTR even when RESTARTSYS handling is set for the signal, but read isn't one of those syscalls:
https://man7.org/linux/man-pages/man7/signal.7.html see "Interruption of system calls and library functions by signal handlers"

And although RESTARTSYS seems to be the default handling for signals, if you establish a custom handler for any signal in OCaml I think you may always risk getting EINTR, because the sigaction call in OCaml doesn't pass the SA_RESTARTSYS flag.
(which probably means we have bugs elsewhere like this in XAPI, I know of at least one place that would assert/raise exception on EINTR on the basis that it should never be received, I think it is one of the select calls in fact...)

To reproduce a forkexecd unit test failure I've run it under 'rr'.
This caused a different failure: EINTR from read.

Unixext already has code to defend against EINTR on write, but not on read: add missing loop.

Signed-off-by: Edwin Török <[email protected]>
Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a description to the changelog?

Similar to this: CHANGES.md

@lindig lindig merged commit a8661d1 into xapi-project:master Jan 17, 2024
2 checks passed
@edwintorok
Copy link
Contributor Author

Could you add a description to the changelog?

Similar to this: CHANGES.md

Thanks, looks like you already did that for me in the other PR.

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