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

Linux: Fix receive for message sizes close to packet size #61

Merged
merged 2 commits into from Apr 6, 2016

Conversation

@antrik
Copy link
Contributor

antrik commented Apr 2, 2016

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.

@Manishearth
Copy link
Member

Manishearth commented Apr 2, 2016

@Manishearth
Copy link
Member

Manishearth commented Apr 2, 2016

Btw,

/home/manishearth/Mozilla/Git/ipc-channel/lib.rs:11:12: 11:23 warning: unused or unknown feature, #[warn(unused_features)] on by default
/home/manishearth/Mozilla/Git/ipc-channel/lib.rs:11 #![feature(mpsc_select, borrow_state)]
                                                               ^~~~~~~~~~~

not sure if this is caused by this PR

@antrik
Copy link
Contributor Author

antrik commented Apr 2, 2016

@Manishearth nah, that warning has been there for several months. I guess it comes from newer compiler versions?

@Manishearth
Copy link
Member

Manishearth commented Apr 2, 2016

Perhaps.

@Manishearth
Copy link
Member

Manishearth commented Apr 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

The latest upstream changes (presumably #62) made this pull request unmergeable. Please resolve the merge conflicts.

antrik added 2 commits Apr 2, 2016
Introduce a new separate method for checking the maximum packet size
that can be sent over the socket.

This is mostly for the benefit of upcoming test cases, that will need to
know this value -- which is why we make it public.
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) when the sender does
explicit fragment size calculations; however, the sender presently tries
to send the message in a single packet first, without any advace size
checks at all -- so when the data size was close to the maximum packet
size, this actually resulted in the message not fitting in the receive
buffer!

This is what caused servo/servo#10260 , which
became (more) visible in Servo as a result of
#57 -- though the underlying
issue existed before...
@antrik antrik force-pushed the antrik:fix-recv_buffer_size branch from baa3e14 to 1a37a9b Apr 6, 2016
@antrik
Copy link
Contributor Author

antrik commented Apr 6, 2016

Rebased.

@pcwalton
Copy link
Collaborator

pcwalton commented Apr 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

📌 Commit 1a37a9b has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

Testing commit 1a37a9b with merge f85a07b...

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.
@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

☀️ Test successful - travis

@bors-servo bors-servo merged commit 1a37a9b into servo:master Apr 6, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
antrik added a commit to antrik/servo that referenced this pull request Apr 6, 2016
This fixes servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: ipc-channel was updated
to `uuid` 0.2 (don't know why...), while other crates are still with
0.1. This was blocking the urgent bug fix; and according to discussion
on #servo, the override should be OK in this case.
antrik added a commit to antrik/servo that referenced this pull request Apr 6, 2016
This fixes servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: ipc-channel was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with @mbrubeck on
IRC, the override should be OK in this case.
antrik added a commit to antrik/servo that referenced this pull request Apr 6, 2016
This fixes servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: ipc-channel was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with @mbrubeck on
IRC, the override should be OK in this case.
antrik added a commit to antrik/servo that referenced this pull request Apr 6, 2016
This fixes servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: `ipc-channel` was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with @mbrubeck on
IRC, the override should be OK in this case.
bors-servo added a commit to servo/servo that referenced this pull request Apr 6, 2016
Update ipc-channel for two important bug fixes

This fixes #10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: `ipc-channel` was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with @mbrubeck on
IRC, the override should be OK in this case.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10447)
<!-- Reviewable:end -->
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…(from antrik:update-ipc_channel-5); r=jdm

This fixes servo/servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: `ipc-channel` was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with mbrubeck on
IRC, the override should be OK in this case.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b951f65b969ccc3445079a70686cf2146e365d7

UltraBlame original commit: c026ec733ec28813f9d6a5a4c7ab43d8cb8b3cac
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…(from antrik:update-ipc_channel-5); r=jdm

This fixes servo/servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: `ipc-channel` was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with mbrubeck on
IRC, the override should be OK in this case.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b951f65b969ccc3445079a70686cf2146e365d7

UltraBlame original commit: c026ec733ec28813f9d6a5a4c7ab43d8cb8b3cac
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…(from antrik:update-ipc_channel-5); r=jdm

This fixes servo/servo#10260 by pulling in
servo/ipc-channel#61 (fix receive for messages
close to packet size) and servo/ipc-channel#62
(properly handle ENOBUFS); where the latter is not critical per se, as
there was a workaround already -- but that workaround aggrevated the
first bug, resulting in the urgent issue...

This bump requires a tidy override for `uuid`: `ipc-channel` was updated
to `uuid 0.2` in servo/ipc-channel#63 (don't
know why...), while other crates are still with `0.1`. That was blocking
this urgent bug fix; and according to a discussion with mbrubeck on
IRC, the override should be OK in this case.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b951f65b969ccc3445079a70686cf2146e365d7

UltraBlame original commit: c026ec733ec28813f9d6a5a4c7ab43d8cb8b3cac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.