Open a21152 opened 5 months ago
Hi @a21152 , could you provide the code for reproducing the error? thanks!
I don't have the code off my hand, but you will be able to reproduce the problem with the following simple steps.
impl Drop for DiffieHellman {
fn drop(&mut self) {
trace_println!("Dropping DiffieHellman!");
}
}
fn invoke_command
.The following PR adds an example, test, and fix.
https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/127
I was playing with a TA built with teaclave SDK and got a panic when using the optional session_ctx parameter with a Vec inside of it.
It seems the
mem::forget(b)
call at https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/master/optee-utee/macros/src/lib.rs#L393 also apply to the Err path and doing so indeed fixes the panic.I am not sure if my logic is air tight. It would be great if someone could confirm.