Closed fzyzcjy closed 4 months ago
Another way, is to take into account a null ptr when the vec is empty before we go and dealloc it: https://github.com/shekohex/allo-isolate/blob/0ae80ab08ba788776e5585aaa34238dfa6111aba/src/ffi.rs#L184-L191
You can see from the following frames:
10: <<allo_isolate::ffi::DartCObject as core::ops::drop::Drop>::drop::MyVisitor as allo_isolate::into_dart::DartTypedDataTypeVisitor>::visit
at ./src/ffi.rs:186:29
11: allo_isolate::into_dart::visit_dart_typed_data_type
at ./src/into_dart.rs:268:35
Hi thanks for the lib! It seems that it panics under some scenarios.
Reproduction:
Firstly, use Rust 1.79.0
Then add these lines to
tests/containers.rs
(or whatever other places) and runRUST_BACKTRACE=1 cargo run --features="anyhow backtrace chrono uuid" --example containers
:And see
EDIT: Very briefly glanced at the code, and I guess this line may be related: https://github.com/shekohex/allo-isolate/blob/0ae80ab08ba788776e5585aaa34238dfa6111aba/src/into_dart.rs#L171
Hack it by changing to such a not-allocated pointer (definitely should not be the final solution, just a quick test), and the error disappears.
P.S. the empty non-allocated vec looks like to have address like the following.