[Xmonad] darcs patch: zombie_children

Don Stewart dons at galois.com
Wed Oct 24 19:09:48 EDT 2007

> dbenbenn:
> > Tue Oct 23 18:13:48 PDT 2007  David Benbennick <dbenbenn at gmail.com>
> >   * zombie_children
> >   
> >   My .xinitrc file looks like this:
> >   
> >   xterm &
> >   firefox &
> >   exec xmonad
> >   
> >   The result is that when xmonad starts, it has two child processes that it didn't create.  When I quit either process, the process remains forever as a zombie, because xmonad never waits on children.
> >   
> >   My previous window manager (Window Maker) didn't suffer from this issue.
> >   
> >   Here's a pretty simple change that makes xmonad wait on children in its main loop.  We can also change spawn to only create one process instead of two, and keep spawned processes as children.
> >   
> So there's a portability problem, getAnyProcessStatus calls
> getGroupProcessStatus, which fails on OpenBSD for some reason.
> We can't apply this as is, at least, since it breaks xmonad on that
> platform (possibly others too, I guess).
> This is probably the fault of the unix System.Process binding.

Ah, the issue is this uncaught exception is thrown

    Prelude System.Posix.Process> getAnyProcessStatus False False
    *** Exception: getGroupProcessStatus: does not exist (No child processes)

Which is not handled at any level. At a minimum you'd need to catch and 
ignore this exception in the main loop.

-- Don

More information about the Xmonad mailing list