-
Notifications
You must be signed in to change notification settings - Fork 645
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
Precondition that read doesn't return EINVAL #2022
Precondition that read doesn't return EINVAL #2022
Conversation
IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh
Outdated
Show resolved
Hide resolved
IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh
Outdated
Show resolved
Hide resolved
@swift-server-bot test this please |
@weissi Do you have any idea why these tests are failing? They are also failing for me locally on main and I cannot figure out why they are returning the wrong value now. |
IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh
Outdated
Show resolved
Hide resolved
2b2eac4
to
719a0a6
Compare
IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh
Outdated
Show resolved
Hide resolved
f344c9e
to
ac54847
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is good, but it's a bit too narrow and a bit too broad.
The original issue only asked to forbid EINVAL
on read
. This change adds it to all syscalls in NIOCore, but does not affect those in NIOPosix, which is where the relevant read
is actually made. As a result, it does not resolve the original issue.
Additionally, the change as written affects all system calls. However, some EINVALs we actually want to tolerate. As an example, see #1030. As a result, we likely need a more complex solution that only adds EINVAL policing to some specific system calls, not all of them.
14ad972
to
bfb8b10
Compare
IntegrationTests/tests_02_syscall_wrappers/test_03_unacceptable_read_errnos.sh
Outdated
Show resolved
Hide resolved
@swift-nio-bot test perf please |
performance reportbuild id: 94 timestamp: Sun Dec 19 22:28:51 UTC 2021 results
comparison
significant differences found |
Yup, that report above is not right: those are clearly the results from @weissi's previous PR. |
@tomerd Seems like the NIO performance builds aren't working again. |
bfb8b10
to
f7790da
Compare
### Motivation: `read` should never return `EINVAL`. If it does return it though it is a bug inside NIO and we should precondition for it similar to what we do for `EBADF` & `EFAULT`. Closes apple#1339 ### Modifications: This PR adds a new precondition for `EINVAL` and adds test that exercise this precondition. ### Result: We are now preconditioning against `read` returning `EINVAL`.
f7790da
to
869fca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice one!
Motivation:
read
should never returnEINVAL
. If it does return it though it is a bug inside NIO and we should precondition for it similar to what we do forEBADF
&EFAULT
. Closes #1339Modifications:
This PR adds a new precondition for
EINVAL
and adds test that exercise this precondition.Result:
We are now preconditioning against
read
returningEINVAL
.