You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new code looks good and I can't find any safety issues with it.
I do think that the abort message should be Waker::clone and not Waker::drop at line 194 for the owned vtable clone method.
Also in the poll_fn function, is there a reason to not call Pin::new_unchecked and (*context_ptr).with_context inside the catch_unwind closure (seems like that would be safer if that code was ever changed to introduce a panic somewhere even if they can't panic currently).
I do think that the abort message should be Waker::clone and not Waker::drop at line 194 for the owned vtable clone method.
Also in the poll_fn function, is there a reason to not call Pin::new_unchecked and (*context_ptr).with_context inside the catch_unwind closure (seems like that would be safer if that code was ever changed to introduce a panic somewhere even if they can't panic currently).
Thanks for the review. They are both fixed in b81ef7f now. Documentations are also updated on master.
I was looking through the source code of this crate after reading the article Plugins in Rust: Reducing the Pain with Dependencies | NullDeref and I noticed that currently panicking is only handled for the
LocalBorrowingFfiFuture::poll
method and even that could be better since theBox
that the is caught could panic when it is dropped, see Footgun withcatch_unwind
when catching panic-on-drop types · Issue #86027 · rust-lang/rust. This crate should probably do something similar to the preposeddrop_unwind
fn or to theAbortBomb
inabi_stable
.All of the following
extern "C"
functions should probably handle panics since they call arbitrary user provided functions:LocalBorrowingFfiFuture::drop
LocalBorrowingFfiFuture::poll
(currently handled except for caught panic payloads that panic when dropped)FfiWaker(reference)::wake_by_ref
FfiWaker(reference)::clone
FfiWaker(owned)::drop
FfiWaker(owned)::wake_by_ref
FfiWaker(owned)::wake
FfiWaker(owned)::clone
The text was updated successfully, but these errors were encountered: