Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLinux: UnixCmsg: Don't deduce maximum cmsg size from data size #60
Conversation
Just because we allocate a generous receive buffer for auxilllary data, doesn't mean that a message can't use the space for other things when it doesn't actually carry that amount of auxillary data. In fact, there is no reason to expect every message we receive to have auxillary data at all -- so let's just allocate a data buffer matching the total maximal receive size. This will enable some optimisations to be implemented; and it simplifies the code too. Note that the extra space is not used yet, until the sender side is adapted to actually send larger messages making use of the extra space. (Or even messages without auxillary data.)
|
This works for me; I'm not getting any IPC related crashes. |
|
If this can wait till later today or maybe tomorrow, I'd put up a more polished PR: with a reworked commit message mentioning the bug fix; and adding a test case... It's not too important though, if this fix is urgent. |
|
Please close in favour of #61 |
bors-servo
added a commit
that referenced
this pull request
Apr 6, 2016
Linux: Fix receive for message sizes close to packet size Fixes servo/servo#10260 This supersedes #60 -- which is basically the same change; but now we have a test case, and an improved commit message. (Pointing out the bug fix; and also fixing a very confusing typo in the title...) The extra commit does some refactoring necessary for the new test case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
eddyb commentedApr 1, 2016
@antrik committed 10f4032:
This also fixes servo/servo#10260, but unlike #59, it's not just a hack.
I've put this up as a PR because @antrik might not get to it for a few days.
cc @Manishearth @pcwalton