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

Incorrect error handling in io_epoll_context #636

Open
igor-anferov opened this issue Sep 24, 2024 · 0 comments
Open

Incorrect error handling in io_epoll_context #636

igor-anferov opened this issue Sep 24, 2024 · 0 comments

Comments

@igor-anferov
Copy link

igor-anferov commented Sep 24, 2024

The code in io_epoll_context implies that readv and writev syscalls error codes are returned as different negative values. Instead, they always return -1, and actual error code is returned through errno variable. The only reason it currently works (even though it always adds fds to epoll even if there's an unrecoverable error, not just EAGAIN, never calling set_error in start_io, and calling set_error with EPERM in case of ANY error, hiding it) is because it compares return code with -EPERM, which turns out to be -1 on Linux, and adds such descriptors to epoll. I wonder where the idea of this check comes from, cause adding such descriptor to epoll wouldn't fix real EPERM error...

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

No branches or pull requests

1 participant