ftxsgx-runner-cargo supports specifying the number of threads that need to be available in the enclave. Unfortunately that is not sufficient; The enclave-runner library always spawns n worker threads where n are the number of logical cores available. On very constraint VMs, this may only be one. As a result, enclaves with an infinite loop may never return control back to the enclave and the enclave hangs, even when there are multiple threads running in the enclave.
Example (with package.metadata.fortanix-sgx.threads=5 in Cargo.toml):
ftxsgx-runner-cargo
supports specifying the number of threads that need to be available in the enclave. Unfortunately that is not sufficient; Theenclave-runner
library always spawnsn
worker threads wheren
are the number of logical cores available. On very constraint VMs, this may only be one. As a result, enclaves with an infinite loop may never return control back to the enclave and the enclave hangs, even when there are multiple threads running in the enclave.Example (with
package.metadata.fortanix-sgx.threads=5
inCargo.toml
):