-
Notifications
You must be signed in to change notification settings - Fork 163
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
Proto: Catch pogs panic #2605
Proto: Catch pogs panic #2605
Conversation
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.
Please add a comment to the upstream issue (capnproto/go-capnp#137) in the commit message and in the code. I guess normally we shouldn't expect the library to panic?
So once this is fixed upstream can we remove this patch again?
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @scrye)
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.
I think the catching the panic is actually the right thing to do, even when the issue is fixed.
Our services should not panic because of malformed input.
Sure, panics should not cross package boundaries as per go convention. However, as this has shown, we cannot always rely on this.
I feel a lot more comfortable if we have a recover
after calls to libraries that handle tainted input.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @scrye)
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.
I would keep the recover
code, just to minimize risk of services crashing. Otherwise we need to perform a fuzzing check (which might be incomplete) every time we change the commit.
(Also related, historically we did not deploy adapters/API regression tests on top of third-party libraries, but cases like this show why in some cases it is useful to have them, especially for very complex libraries that deal with encoding/decoding).
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @scrye)
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.
Reviewed 1 of 1 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved
7659344
to
9d98ff4
Compare
Catch panics when deserializing capnp messages using pogs. This could happen on malformed input, see capnproto/go-capnp#137
9d98ff4
to
b724027
Compare
Catch panics when deserializing capnp messages using pogs.
This could happen on malformed input, see capnproto/go-capnp#137
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)