occlum/test
Tate, Hongliang Tian 663f548f94 Workaround exit_group syscall
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.
2019-11-07 13:34:53 +00:00
..
client Fix server_epoll test 2019-10-07 04:36:12 +00:00
cout Add c++ examples 2019-06-01 11:22:04 +08:00
cpuid Introduce GCC-base toolchain and use it by default 2019-09-06 13:02:45 +00:00
dev_null Add pipe throughput benchmark 2019-02-16 16:24:08 +08:00
device Add /dev/zero, /dev/random, /dev/urandom, and /dev/arandom 2019-07-19 12:30:15 +00:00
empty Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
env Introduce GCC-base toolchain and use it by default 2019-09-06 13:02:45 +00:00
exit_group Workaround exit_group syscall 2019-11-07 13:34:53 +00:00
file Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
fs_perms Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
getpid Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
hello_world Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
hostfs Add a command-line interface tool named occlum 2019-08-28 06:05:12 +00:00
include Add clock_gettimeofday 2019-07-18 10:51:12 +00:00
link Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
malloc Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
mkdir Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
mmap Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
pipe Add the integrity-only mode SEFS 2019-08-17 04:20:11 +00:00
pipe_throughput load program bin from SEFS 2019-03-29 14:20:25 +08:00
pthread Workaround exit_group syscall 2019-11-07 13:34:53 +00:00
rdtsc Handle cpuid and rdtsc instruction 2019-07-18 13:51:50 +08:00
readdir fix process cwd. fix open path 2019-03-29 14:20:25 +08:00
rlimit Add prlimit64, getrlimit, and setrlimit 2019-04-10 09:03:41 +08:00
sched Add the integrity-only mode SEFS 2019-08-17 04:20:11 +00:00
server Fix address-in-use error in server and server_epoll tests 2019-10-14 14:33:27 +08:00
server_epoll Fix address-in-use error in server and server_epoll tests 2019-10-14 14:33:27 +08:00
sleep Add nanosleep syscall 2019-11-07 13:24:02 +00:00
spawn Add the integrity-only mode SEFS 2019-08-17 04:20:11 +00:00
spawn_and_exit_latency load program bin from SEFS 2019-03-29 14:20:25 +08:00
time Add clock_gettimeofday 2019-07-18 10:51:12 +00:00
tls Enable Thread Local Storage (TLS) 2019-04-06 22:55:16 +08:00
truncate Harden SEFS with extra MAC and permission checks 2019-10-12 16:55:57 +00:00
uname Add uname 2019-04-10 09:03:41 +08:00
unix_socket Add the integrity-only mode SEFS 2019-08-17 04:20:11 +00:00
unix_socket_throughput Introduce GCC-base toolchain and use it by default 2019-09-06 13:02:45 +00:00
Enclave.xml Add a command-line interface tool named occlum 2019-08-28 06:05:12 +00:00
Makefile Workaround exit_group syscall 2019-11-07 13:34:53 +00:00
Occlum.json Refactor program loader to handle many loadable segments 2019-11-07 13:19:09 +00:00
test_common.mk Introduce GCC-base toolchain and use it by default 2019-09-06 13:02:45 +00:00