Better synchronization poisoning
nick-mobilecoin opened this issue · comments
Nick Santana commented
Currently the poisoning logic in rust std::sync relies on unwinding.
MutexGuard::drop()
will call the drop()
on the Mutex
es poison
flag.
The current panicking in SGX does not unwind which means the poisoning will never happen.
If we chose to utilize a global panic count for poisoning then all other [Mutex']es, not just the one held in the panicked thread, will report poisoned. This may be ok since the
abort()` function used in the panic handler sets the enclave crashed flag, which means any threads still working will finish, but no new ones will start. This results in requiring an enclave reload.