You can try two methods: 1.sgx_std::alloc::set_alloc_error_hook. Custom memory allocation error handling function.
2.sgx_signal::exception::register_exception Register exception handling function to capture SIGILL signal. example: https://github.com/apache/incubator-teaclave-sgx-sdk/blob/master/samplecode/unit-test/enclave/src/test_exception.rs Although you can capture the event of memory allocation failure, but because there is not enough memory, the handler may raise exception again. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/254#issuecomment-652547501