diff --git a/src/pal/include/occlum_pal_api.h b/src/pal/include/occlum_pal_api.h index 967a0213..db9eced1 100644 --- a/src/pal/include/occlum_pal_api.h +++ b/src/pal/include/occlum_pal_api.h @@ -161,7 +161,7 @@ int occlum_pal_exec(struct occlum_pal_exec_args *args); int occlum_pal_kill(int pid, int sig); /* - * @brief Destroy teh Occlum enclave + * @brief Destroy the Occlum enclave * * @retval if 0, then success; otherwise, check errno for the exact error type. */ diff --git a/src/pal/src/pal_api.c b/src/pal/src/pal_api.c index b1c6dc2d..0eafcaf0 100644 --- a/src/pal/src/pal_api.c +++ b/src/pal/src/pal_api.c @@ -148,10 +148,15 @@ int occlum_pal_init(const struct occlum_pal_attr *attr) { if (pal_run_init_process() < 0) { PAL_ERROR("Failed to run the init process: %s", errno2str(errno)); - goto on_destroy_enclave; + goto stop_interrupt_thread; } return 0; + +stop_interrupt_thread: + if (pal_interrupt_thread_stop() < 0) { + PAL_WARN("Cannot stop the interrupt thread: %s", errno2str(errno)); + } on_destroy_enclave: if (pal_destroy_enclave() < 0) { PAL_WARN("Cannot destroy the enclave");