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
a panic should never unwind the stack past the FFI #553
Labels
Comments
vmx
added a commit
that referenced
this issue
May 31, 2019
This code currently doesn't even compile. But I upload it though, in case someone else would like to push that over the finish line. Closes #553.
Closed
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Jun 23, 2019
This is a new WIP about catching panics. If we can agree that this is the way to go, it would make sense to put this macro into rust-fil-ffi-toolkit. This patch is best viewed with `git diff --ignore-all-space`. Closes filecoin-project/rust-fil-proofs#553.
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Jun 23, 2019
This is a new WIP about catching panics. If we can agree that this is the way to go, it would make sense to put this macro into rust-fil-ffi-toolkit. This patch is best viewed with `git diff --ignore-all-space`. Closes filecoin-project/rust-fil-proofs#553.
Also see @vmx PR to cbdingen: mozilla/cbindgen#347 (comment) |
vmx
added a commit
to filecoin-project/rust-fil-ffi-toolkit
that referenced
this issue
Oct 17, 2019
When panics happen on the Rust side of the FFI, normally it just aborts and the caller has no chance to catch the error. When a a FFI function is wrapped in a `catch_panic_response()` closure, then whenever a panic (where unwinding is possible) occurs it will respond to the caller with the `FCPResponseStatus::FCPUnclassifiedError` error code and the error message prefixed with "Rust panic: ". Now the caller can react accordingly. This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-proofs-ffi
that referenced
this issue
Oct 17, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-proofs-ffi
that referenced
this issue
Oct 23, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
laser
pushed a commit
to filecoin-project/rust-fil-proofs-ffi
that referenced
this issue
Oct 23, 2019
* feat: use enum for FFI response status Use the central `FCPResponseStatus` enum from ffi-toolkit for the FFI responses. Closes #8. * fix: catch panics When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 23, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553 TODO: update Cargo.lock
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 23, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 28, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 28, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
vmx
added a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 30, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
laser
pushed a commit
to filecoin-project/rust-fil-sector-builder
that referenced
this issue
Oct 30, 2019
When panics happen, don't just abort, but catch them and send an error response back with status code `FCPResponseStatus::FCPUnclassifiedError` and an error message prefixed with "Rust panic: ". This is part of filecoin-project/rust-fil-proofs#553
I close this issue as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
go-filecoin depends on rust-fil-proofs via CGO. A panic in rust-fil-proofs should not propagate to go-filecoin where it cannot be handled.
Acceptance criteria
Trap all panics at the FFI boundary. Transmute panic to an error message, and send that error message back to FFI consumer.
Where to start
This portion of the Rust docs outline an approach for catching panics before propagating back to FFI consumers. This blog post gives some examples of how we might use the
UnwindSafe
trait.The text was updated successfully, but these errors were encountered: