-
Notifications
You must be signed in to change notification settings - Fork 240
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
Use panic-safety helper functions from ffi-support #32
Labels
blocks-nimbus
Blocks Nimbus SDK on mobile
Comments
For context, note that we currently panic if we receive unexpected data over the FFI, so we need to make that safe as well; ref https://github.com/rfk/uniffi-rs/pull/31#discussion_r460382079 |
data-sync-user
changed the title
Use panic-safety helper functions from ffi-support
SYNC-1556 ⁃ Use panic-safety helper functions from ffi-support
Jul 30, 2020
data-sync-user
changed the title
SYNC-1556 ⁃ Use panic-safety helper functions from ffi-support
Use panic-safety helper functions from ffi-support
Jul 31, 2020
linabutler
added a commit
that referenced
this issue
Aug 5, 2020
linabutler
added a commit
that referenced
this issue
Aug 10, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 10, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 25, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 25, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 26, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 26, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
linabutler
added a commit
that referenced
this issue
Aug 27, 2020
This commit changes all FFI functions to take an `out_err` param, so that they're called using `call_with_result`. Any functions that don't have a `[Throws]` annotation in the IDL will throw a generic `InternalError` instead. Closes #32.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Panics in the rust code are not currently handled very well, and I suspect would actually trigger undefined behaviour by propagating across the FFI boundary. We should use the support functions offered by ffi-support to ensure safe panic handling in all cases.
The most basic thing that could work:
ExternError
out parametercall_with_output
.Object methods could instead rely on the
call
helpers of theHandleMap
for the same effect, but I think it would be worth our while to catch and handle panics in argument conversion or other operations that might occur before we call into theHandleMap
at all.┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: