Re: [dev] [surf] Zombies when forking

From: Markus Wichmann <nullplan_AT_gmx.net>
Date: Tue, 17 Sep 2019 17:08:09 +0200

On Tue, Sep 17, 2019 at 12:15:59PM +0200, C.J. Wagenius wrote:
> Hi.
>
> I'm using surf on void linux (musl). I get a whole lot of zombies (sh <defunct>) when spawning child processes (Go & Find). I don't know where the optimal place is to put a waitpid for them but this works for me.
>
> # --- Start patch
> index 2b54e3c..ef1309b 100644
> --- a/surf.c
> +++ b/surf.c
> _AT_@ -1327,6 +1327,7 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c)
> {
>         int i;
>
> +       waitpid((pid_t)-1, NULL, WNOHANG);
>         switch (e->type) {
>         case GDK_ENTER_NOTIFY:
>                 c->overtitle = c->targeturi;
> # --- End patch
>
> Thanks for awesome software.
>
> /cjw
>

You know, if no place in the code ever calls wait* except this line,
might be simpler to just set SIGCHLD to SIG_IGN during initialization.

Ciao,
Markus
Received on Tue Sep 17 2019 - 17:08:09 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 17 2019 - 18:00:09 CEST