From: Jennifer Richards Date: Tue, 8 May 2018 17:01:31 +0000 (-0400) Subject: Abort instead of exit from forked tids and mons subprocesses X-Git-Tag: 3.4.0~1^2~26 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=commitdiff_plain;h=a0640fbfff65d0f9327f6e6bfadf40655f048136 Abort instead of exit from forked tids and mons subprocesses --- diff --git a/mon/mons.c b/mon/mons.c index b0a0400..cebe329 100644 --- a/mon/mons.c +++ b/mon/mons.c @@ -255,7 +255,11 @@ int mons_accept(MONS_INSTANCE *mons, int listen) break; } close(conn); - exit(0); /* exit to kill forked child process */ + + /* This ought to be an exit(0), but log4shib does not play well with our (mis)use of threads and + * fork() in the main process. Until we sort that out, we abort() to force termination of this + * process. */ + abort(); /* exit hard */ } /* Only the parent process gets here */ diff --git a/tid/tids.c b/tid/tids.c index 0569333..1a29620 100644 --- a/tid/tids.c +++ b/tid/tids.c @@ -442,7 +442,11 @@ static void tids_handle_proc(TIDS_INSTANCE *tids, int conn_fd, int result_fd) close(result_fd); close(conn_fd); - exit(0); /* exit to kill forked child process */ + + /* This ought to be an exit(0), but log4shib does not play well with our (mis)use of threads and + * fork() in the main process. Until we sort that out, we abort() to force termination of this + * process. */ + abort(); /* exit hard */ } /* Accept and process a connection on a port opened with tids_get_listener() */