BACKGROUND The exit_group syscall, which is implicitly called by libc after the main function returns, kills all threads in a thread group, even if these threads are running, sleeping, or waiting on a futex. PROBLEM In normal use cases, exit_group does nothing since a well-written program should terminate all threads before the main function returns. But when this is not the case, exit_group can clean up the mess. Currently, Occlum does not implement exit_group. And the Occlum PAL process waits for all tasks (i.e., SGX threads) to finish before exiting. So without exit_group implemented, some tasks may be still running if after the main task exits. And this causes the Occlum PAL process to wait---forever. WORKAROUND To implement a real exit_group, we need signals to kill threads. But we do not have signals, yet. So we come up with a workaround: instead of waiting all tasks to finish in PAL, we just wait for the main task. As soon as the main task exits, the PAL process terminates, killing the remaining tasks.
6 lines
76 B
Makefile
6 lines
76 B
Makefile
include ../test_common.mk
|
|
|
|
EXTRA_C_FLAGS :=
|
|
EXTRA_LINK_FLAGS :=
|
|
BIN_ARGS :=
|