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
I know the wasmer runtime will detect when a host function (i.e. something passed in using imports!()) panics and translate that to a RuntimeError (presumably around here). Is it possible for the top-level caller to use std::panic::resume_unwind() to continue panicking?
The data in RuntimeError::Error is Box<Any>, whereas std::panic::resume_unwind() expects Box<dyn Any + Send>.
I guess one possible solution is to match on the result of call() and then explicitly panic!() if a runtime error was detected. That would let us continue crashing, but would also mean we lose the original backtrace.
I think as a library we don't want to take down the program that's using us by default, though we should make it easy to turn that RuntimeError back into a panic! with the stack information if, as the host program, that's what you want to do.
Maybe it's as simple as making RuntimeError::Error a Box<Any + Send>?
I think it would be. Or maybe add an extra HostFunctionPanicked(Box<dyn Any + Send>) variant to RuntimeError? That way you won't accidentally try to resume a Box<dyn Any + Send> which isn't actually a panic, and can differentiate between whether a function panicked or just returned an error.
I know the wasmer runtime will detect when a host function (i.e. something passed in using
imports!()
) panics and translate that to aRuntimeError
(presumably around here). Is it possible for the top-level caller to usestd::panic::resume_unwind()
to continue panicking?The
data
inRuntimeError::Error
isBox<Any>
, whereasstd::panic::resume_unwind()
expectsBox<dyn Any + Send>
.I guess one possible solution is to match on the result of
call()
and then explicitlypanic!()
if a runtime error was detected. That would let us continue crashing, but would also mean we lose the original backtrace.This may be related to #986 or #827.
The text was updated successfully, but these errors were encountered: