diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index 43d9179d9..a9df1be60 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -200,8 +200,15 @@ static int childEntry(void * arg) pid_t startProcess(std::function fun, const ProcessOptions & options) { ChildWrapperFunction wrapper = [&] { - if (!options.allowVfork) + if (!options.allowVfork) { + /* Set a simple logger, while releasing (not destroying) + the parent logger. We don't want to run the parent + logger's destructor since that will crash (e.g. when + ~ProgressBar() tries to join a thread that doesn't + exist. */ + logger.release(); logger = makeSimpleLogger(); + } try { #if __linux__ if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)