Skip to content

tmux leaves zombies around #311

Closed
Closed

Description

Reproducer
$ tmux new-window true&;exec true; sleep 1; ps x | grep -c [d]efunct; pkill -CHLD tmux; ps x | grep -c [d]efunct
1
0

Activity

  1. nicm commented on Feb 17, 2016

    @nicm
    Member

    This is a side effect of using libutempter which puts in its own SIGCHLD handler; if the tmux child exits while utempter has its handler in, tmux will never get the SIGCHLD.

  2. nicm commented on Feb 17, 2016

    @nicm
    Member

    You can try this

    diff --git a/window.c b/window.c
    index a89b108..7a74afb 100644
    --- a/window.c
    +++ b/window.c
    @@ -915,6 +915,7 @@ window_pane_spawn(struct window_pane _wp, int argc, char *_argv,
    #ifdef HAVE_UTEMPTER
    xsnprintf(s, sizeof s, "tmux(%lu).%%%u", (long) getpid(), wp->id);
    utempter_add_record(wp->fd, s);

    • kill(getpid(), SIGCHLD);
      #endif

      setblocking(wp->fd, 0);

    On Wed, Feb 17, 2016 at 06:41:04AM -0800, moosotc wrote:

    Nicholas Marriott [email protected] writes:

    This is a side effect of using libutempter which puts in its own
    SIGCHLD handler; if the tmux child exits while utempter has its
    handler in, tmux will never get the SIGCHLD.

    I do the above (more or less) in a script, my best bet, it seems it to
    do a:
    trap 'pkill -CHLD tmux' 0
    or is there a better way?

    --
    mailto:[email protected]

    --
    Reply to this email directly or [1]view it on GitHub.

    Reverse link: [2]unknown

    References

    Visible links

    1. tmux leaves zombies around #311 (comment)
    2. tmux leaves zombies around #311 (comment)
  3. nicm commented on Feb 17, 2016

    @nicm
    Member

    Applied this anyway.

  4. lock commented on Feb 16, 2020

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  5. locked and limited conversation to collaborators on Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions