On Sun, Aug 13, 2023 at 01:04:00PM +0200, Rhialto wrote:
> On Sat 12 Aug 2023 at 23:49:43 +0200, Michael van Elst wrote:
> > On Sat, Aug 12, 2023 at 03:22:56PM +0200, Rhialto wrote:
> > > 
> > > Or, alternatively, a proper signal handler for SIGCHLD could be set up.
> > 
> > ctwm had a signal handler for SIGCHLD (not 100% correct). And that got 
> > replaced
> > by ignoring the signal to avoid waiting for children.
> 
> Yes, looking at the history, it got replaced in commit 647.1.4. This was
> removed (amongst other things):


> I suppose that the problem was not noticed since 2018 because
> there are several preconditions:

The problem didn't exist for NetBSD before the recent ctwm update in xsrc.


> - session startup script must start some programs in the background, and
>   end with "exec ctwm". Just "ctwm" without "exec" doesn't do it. This
>   is so that the started background processes become children of ctwm
>   (even if ctwm didn't start them itself).

Indeed, that's the standard way to start a session. Exiting the window
manager will then also finish the session.


> - on FreeBSD (and probably Linux too) they apparently don't follow the
>   described semantics of wait*(2) regarding SIGCHLD set to SIG_IGN, OR
>   in system(3) they work around it somehow. Alledgedly, POSIX doesn't
>   require system(3) to work in this state.

I haven't found anything that would even talk about it, but the sematics
of waitpid in this case (wait for all children to finish) seem to forbid
that system can work correctly unless it works outside of POSIX system calls.



Greetings,
-- 
                                Michael van Elst
Internet: mlel...@serpens.de
                                "A potential Snark may lurk in every tree."

Reply via email to