From d0ede1557b29f833268845ba85fd27bb66fcb23b Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 22 Feb 2016 15:08:05 -0800 Subject: [PATCH] Remove mask of SIGCHLD When a .NET Core program invoked a process that invoked its own child, the masking of SIGCHLD prevented the process from recognizing its child had exited, which some processes require. This caused the .NET Core app to hang in certain internal scenarios. --- src/pal/src/thread/threadsusp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pal/src/thread/threadsusp.cpp b/src/pal/src/thread/threadsusp.cpp index 89e852a..90a10f0 100644 --- a/src/pal/src/thread/threadsusp.cpp +++ b/src/pal/src/thread/threadsusp.cpp @@ -790,7 +790,9 @@ CThreadSuspensionInfo::InitializeSignalSets() // The default signal mask masks all common signals except those that represent // synchronous exceptions in the PAL or are used by the system (e.g. SIGPROF on BSD). // Note that SIGPROF is used by the BSD thread scheduler and masking it caused a - // significant reduction in performance. + // significant reduction in performance. Note that SIGCHLD is used by Linux + // for parent->child process notifications, and masking it caused parents + // not to recognize their children had died. sigaddset(&smDefaultmask, SIGHUP); sigaddset(&smDefaultmask, SIGABRT); #ifdef SIGEMT @@ -801,7 +803,6 @@ CThreadSuspensionInfo::InitializeSignalSets() sigaddset(&smDefaultmask, SIGURG); sigaddset(&smDefaultmask, SIGTSTP); sigaddset(&smDefaultmask, SIGCONT); - sigaddset(&smDefaultmask, SIGCHLD); sigaddset(&smDefaultmask, SIGTTIN); sigaddset(&smDefaultmask, SIGTTOU); sigaddset(&smDefaultmask, SIGIO); -- 2.7.4