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

Prevent the constellation from panicking if there is a deserialization error #15618

Merged
merged 1 commit into from Feb 20, 2017

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Feb 17, 2017

At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in /html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html due to the URL deserialization errors caused by servo/rust-url#278.

This PR stops the constellation from panicking, so we can get a crash report for deserialization errors.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because we don't test panic recovery

This change is Reviewable

@nox
Copy link
Member

nox commented Feb 17, 2017

Let's not merge this now, I don't want any more bitrot on my serde bump, and the Error type changed.

@Manishearth
Copy link
Member

Manishearth commented Feb 17, 2017

r=me

@bors-servo
Copy link
Contributor

bors-servo commented Feb 18, 2017

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

@antrik
Copy link
Contributor

antrik commented Feb 19, 2017

I'm a little confused here. Since the de-serialisation in ipc-channel is only done on messages created by the corresponding serialiser implementation, I don't think we can get actual de-serialisation errors, unless the serialiser or de-serialiser implementation is buggy, or if there are I/O errors in the IPC itself?...

Either way, it does seem a valid concern, since I/O errors at least can happen due to circumstances out of our control. (Such as the sender process dying in the middle of a large transfer; or possibly some kind of operating system resource exhaustion...) As such, I'd say this should be addressed in ipc-channel, rather then just working around it for this specific case?...

The downside is that switching between MPSC channels and IPC channels becomes less transparent this way -- but then again, when routing is needed, it's not really transparent anyway...

@nox
Copy link
Member

nox commented Feb 19, 2017

I'm a little confused here. Since the de-serialisation in ipc-channel is only done on messages created by the corresponding serialiser implementation, I don't think we can get actual de-serialisation errors, unless the serialiser or de-serialiser implementation is buggy, or if there are I/O errors in the IPC itself?...

It is indeed a bug in rust-url that causes the deserialisation error, but the constellation really should never panic ever, so ipc-channel must provide a way to not panic even when there is such a bug somewhere.

@asajeffrey
Copy link
Member Author

asajeffrey commented Feb 20, 2017

Indeed, this can only happen if there are errors in the deserializer, this is bullet-proofing the constellation against such errors. Or at least trying to, it's hard to protect against double-panicking if the deserializer for panic messages panics. We could add this function to ipc-channel at some point, I'd rather not hold up this PR though.

@antrik
Copy link
Contributor

antrik commented Feb 20, 2017

Well, this didn't sound like an urgent issue... But it's your call of course :-)

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-ipc-dont-panic branch from d53da10 to aee1291 Feb 20, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Feb 20, 2017

Rebased now that #15588 has landed.

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Feb 20, 2017

📌 Commit aee1291 has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Feb 20, 2017

Testing commit aee1291 with merge 524a117...

bors-servo added a commit that referenced this pull request Feb 20, 2017
…ishearth

Prevent the constellation from panicking if there is a deserialization error

<!-- Please describe your changes on the following line: -->

At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278.

This PR stops the constellation from panicking, so we can get a crash report for deserialization errors.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because we don't test panic recovery

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15618)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 20, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev
Approved by: Manishearth
Pushing 524a117 to master...

@bors-servo bors-servo merged commit aee1291 into servo:master Feb 20, 2017
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
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.

None yet

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