Skip to content

Commit

Permalink
orch kernutil fix MUSL hang problem due to improper exit (vs _exit)
Browse files Browse the repository at this point in the history
updated test and doc
  • Loading branch information
flhofer committed Jun 20, 2024
1 parent 68c4a94 commit c269d38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/README
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The static version limits the allocation to configuration values and does not re
REQUIREMENTS
==============

'orchestrator' runs on GNU/Linux compliant systems with 'BusyBox' (Musl is not completely supported yet). It needs GNU 'make' and a recent compiler (tested on: gcc) for basic features with the following development packages for compilation:
'orchestrator' runs on GNU/Linux compliant systems also with 'BusyBox', GNU libc, or Musl. It needs GNU 'make' and a recent compiler (tested on: gcc) for basic features with the following development packages for compilation:
* libnuma-dev (NUMA manipulation)
* libcap-dev (POSIX Capabilities library)
* check (CHECK C based run-time test framework)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/kernutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ popen2(const char * command, const char * type, pid_t * pid)
else
close(fd[WRITE]);

exit(EXIT_FAILURE);
_exit(EXIT_FAILURE); // use _exit for child process to avoid parent hang!
}

*pid = child_pid;
Expand Down
17 changes: 4 additions & 13 deletions test/orchestrator/updateTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,8 @@ START_TEST(orchestrator_update_stop)
{
pthread_t thread1;
int iret1;
#ifdef BUSYBOX
int stat1 = 1; // FIXME: MUSL/BUSYBOX start halfway, when dockerlink child process is dead, hangs indefinitely
#else
int stat1 = 0;
#endif

iret1 = pthread_create( &thread1, NULL, thread_update, (void*) &stat1);
ck_assert_int_eq(iret1, 0);

Expand All @@ -216,11 +213,8 @@ START_TEST(orchestrator_update_findprocs)
{
pthread_t thread1;
int iret1;
#ifdef BUSYBOX
int stat1 = 1; // FIXME: MUSL/BUSYBOX start halfway, when dockerlink child process is dead, hangs indefinitely
#else
int stat1 = 0;
#endif

pid_t pid1, pid2, pid3;
FILE * fd1, * fd2, * fd3;

Expand Down Expand Up @@ -274,11 +268,8 @@ START_TEST(orchestrator_update_findprocsall)
{
pthread_t thread1;
int iret1;
#ifdef BUSYBOX
int stat1 = 1; // FIXME: MUSL/BUSYBOX start halfway, when dockerlink child process is dead, hangs indefinitely
#else
int stat1 = 0;
#endif

// set detect mode to pid
free (prgset->cont_pidc);
prgset->cont_pidc = strdup(""); // all!
Expand All @@ -304,7 +295,7 @@ START_TEST(orchestrator_update_rscs)
{
pthread_t thread1;
int iret1;
int stat1 = 1; // FIXME: MUSL/BUSYBOX start halfway, when dockerlink child process is dead, hangs indefinitely
int stat1 = 0;
pid_t pid1, pid2;
FILE * fd1, * fd2;

Expand Down

0 comments on commit c269d38

Please sign in to comment.