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

PE loader: handle EINTR properly #21639

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

PE loader: handle EINTR properly #21639

wants to merge 2 commits into from

Conversation

DzmitryKN
Copy link
Contributor

@DzmitryKN DzmitryKN commented Apr 7, 2023

open() may fail if process receives signal and open() requires blocked IO wait, like in case FS structures needed to open file are not cached at that moment. Proper way to handle such situation is to repeat operation if errno == EINTR.
Note that there're cases when Mono doing this correctly, like here: https://github.com/mono/mono/blob/main/mono/metadata/w32file-unix.c#L285 but its not doing this in the PE-loader's open(), that happen to fail sporadically with such error in our case. So this PR adds looping while (errno == EINTR) in this and similar places.

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.

None yet

1 participant