spacemeshos / svm

SVM - Spacemesh Virtual Machine
https://spacemesh.io
MIT License
86 stars 14 forks source link

FFI - Tracking leaked SVM errors #391

Closed YaronWittenstein closed 2 years ago

YaronWittenstein commented 3 years ago

In a very similar way to the #401 issue - this issue asks to add tracking for leaking errors.

When the Wasm code running panics, the Wasm runtime (Wasmer) catches it and finishes its execution gracefully, and the panic isn't propagated back to the Rust code calling Wasmer. Thus, an error returned from the FFI layer is usually a bad sign since it implies that SVM has panicked.

Here is where the code builds an error to be returned: https://github.com/spacemeshos/svm/blob/master/crates/runtime-ffi/src/api.rs#L522

And this is where the leaking takes place: https://github.com/spacemeshos/svm/blob/76be2e2e7f701be0cb0de6cb226b5166ce730fda/crates/runtime-ffi/src/result.rs#L50

neysofu commented 2 years ago

Closing - not relevant; much like #401.