Skip to content

Commit 67153e8

Browse files
author
Arash Sahebolamri
committed
Make sure secondary thread panics are also forwarded
1 parent 8d9b2c9 commit 67153e8

File tree

1 file changed

+2
-3
lines changed
  • intel-sgx/enclave-runner/src/usercalls

1 file changed

+2
-3
lines changed

intel-sgx/enclave-runner/src/usercalls/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl EnclaveState {
872872
io_queue_send: tokio::sync::mpsc::UnboundedSender<UsercallSendData>,
873873
work_sender: crossbeam::channel::Sender<Work>,
874874
) -> EnclaveResult {
875-
let (tx_return_channel, mut rx_return_channel) = tokio::sync::mpsc::unbounded_channel();
875+
let (tx_return_channel, mut rx_return_channel) = tokio::sync::mpsc::unbounded_channel::<(EnclaveResult, ReturnSource)>();
876876
let enclave_clone = enclave.clone();
877877
let mut rt = RuntimeBuilder::new_current_thread()
878878
.enable_all()
@@ -888,13 +888,12 @@ impl EnclaveState {
888888

889889
(e, ReturnSource::Library) |
890890
(e, ReturnSource::ExecutableMain) |
891-
(e @ Err(EnclaveAbort::Exit { panic: None }), _)
891+
(e @ Err(EnclaveAbort::Exit { panic: _ }), _)
892892
=> e,
893893

894894
(Ok(_), ReturnSource::AsyncUsercall) |
895895
(Err(EnclaveAbort::MainReturned), ReturnSource::AsyncUsercall) => unreachable!(),
896896

897-
(Err(e @ EnclaveAbort::Exit { panic: Some(_) }), _) |
898897
(Err(e @ EnclaveAbort::InvalidUsercall(_)), _) => {
899898
let e = e.map_panic(|opt| opt.unwrap());
900899
let cmd = enclave_clone.kind.as_command().unwrap();

0 commit comments

Comments
 (0)