-
Notifications
You must be signed in to change notification settings - Fork 673
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
Recvmmsg can return fewer than specified number of messages #1325
Comments
philipstears
added a commit
to philipstears/nix
that referenced
this issue
Nov 24, 2020
bors bot
added a commit
that referenced
this issue
Nov 28, 2020
1341: Fix recvmmsg(2) implementation r=asomers a=codeslinger There were two problems discovered with the `recvmmsg(2)` implementation that this changeset attempts to fix: 1. As mentioned in /issues/1325, `recvmmsg(2)` can return fewer messages than requested, and 2. Passing the return value of `recvmmsg(2)` as the number of bytes in the messages received is incorrect. This changeset incorporates the proposed fix from /issues/1325, as well as passing the correct value (`mmsghdr.msg_len`) for the number of bytes in a given message. Co-authored-by: Toby DiPasquale <[email protected]>
asomers
pushed a commit
to asomers/nix
that referenced
this issue
Nov 29, 2020
There were two problems discovered with the `recvmmsg(2)` implementation that this changeset attempts to fix: 1. As mentioned in nix-rust/issues/1325, `recvmmsg(2)` can return fewer messages than requested, and 2. Passing the return value of `recvmmsg(2)` as the number of bytes in the messages received is incorrect. This changeset incorporates the proposed fix from nix-rust/issues/1325, as well as passing the correct value (`mmsghdr.msg_len`) for the number of bytes in a given message.
Probably can close this one now, right? |
Fixed by #1341 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The recvmmsg system call can result in fewer than the specified number of message buffers being filled. For example if the system call is interrupted after some data has been received. However the implementation of
nix::sys::socket::recvmmsg()
does not allow for this and unconditionally attempts to process all of the message buffers, and crashes with a failed assertion.Fortunately, I believe the fix is simple.
The text was updated successfully, but these errors were encountered: