[xmonad] xmonad-0.9.1 leaves zombie processes around

Matthias Kilian kili at outback.escape.de
Sat Apr 10 16:05:38 EDT 2010

On Sat, Apr 10, 2010 at 08:43:39PM +0200, Matthias Kilian wrote:
> after updating xmonad on my OpenBSD machine from 0.7 to 0.9.1 (built
> with ghc-6.12.2-rc1), I noticed that xmonad now leaves zombie
> processes around, [...]

The below part from Core.hs is completely wrong, you can't just
ignore SIGCHLD and hope for some deity cleaning up the mess. And,
BTW the default action of SIGCHLD is SIG_IGN, so both calls of
`installHandler sigCHLD ...' are equivalent (and thus bogus).

(I can't fix this right now, since I'm still waiting for a ghc rebuild
on my machine)


-- | Ignore SIGPIPE to avoid termination when a pipe is full, and SIGCHLD to
-- avoid zombie processes, and clean up any extant zombie processes.
installSignalHandlers :: MonadIO m => m ()
installSignalHandlers = io $ do
    installHandler openEndedPipe Ignore Nothing
    installHandler sigCHLD Ignore Nothing
    try $ fix $ \more -> do
        x <- getAnyProcessStatus False False
        when (isJust x) more
    return ()

uninstallSignalHandlers :: MonadIO m => m ()
uninstallSignalHandlers = io $ do
    installHandler openEndedPipe Default Nothing
    installHandler sigCHLD Default Nothing
    return ()

More information about the xmonad mailing list