Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zombie child processes are not reaped on pane/tab exit #518

Closed
myrrlyn opened this issue May 18, 2021 · 3 comments
Closed

Zombie child processes are not reaped on pane/tab exit #518

myrrlyn opened this issue May 18, 2021 · 3 comments
Labels
help wanted Extra attention is needed suspected bug

Comments

@myrrlyn
Copy link

myrrlyn commented May 18, 2021

Observed: On macOS 11 and ArchLinux, exiting panes or tabs within a zellij session produces zombie child processes that the parent does not reap until the entire session exits. Zombies do not persist after the session exits. I have produced this on v0.8 and v0.11.

Expected: The process managing the Zellij session should reap child processes when their pane or tab is closed.

I haven't seen any adverse behavior with this other than having the process entry linger. This is extremely low priority; modern Linux has no PID limit and macOS has 100,000, so even under heavy load a few zombie processes doesn't have a negative system effect. The only real cost (at least to me) is that active tab creation/destruction in a long session leads to a lot of visual clutter in htop.

@imsnif
Copy link
Member

imsnif commented May 18, 2021

Thanks for opening the issue. I personally only manage to reproduce this when the pane has opened child processes of its own (eg. when I start bash from my default fish shell, inside that start another process and then close the zellij pane). But I can definitely imagine that there are a lot of particularities to this issue that would make it behave slightly differently depending on the environment.

My guess is that this happens here: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/pty.rs#L285
And more specifically because of this: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/os_input_output.rs#L184-L189

I'm mentioning this because I'm now placing a Help Wanted on this. So if you or anyone else wants to pick it up, that would be grand. Otherwise me or someone from the team will likely get to it sometime in the not-too-distant future.

@imsnif imsnif added the help wanted Extra attention is needed label May 18, 2021
@imsnif
Copy link
Member

imsnif commented Jul 6, 2021

@myrrlyn - I think this is solved. At least I can no longer reproduce it. It should either be solved by 0.14.0 (if not an earlier version) or if not then by the latest fix in main. If you could confirm that would be great.

EDIT:
If 0.14.0 fixes it, it was probably solved by 0.12.0 as the linked PR suggests

@imsnif imsnif closed this as completed Aug 13, 2021
@dt665m
Copy link

dt665m commented Mar 31, 2022

I'm seeing this behavior on an M1 MacOS using zellij 0.26.1. Found out about it through vim open buffers on reopening a previously closed tab that had the same file open.

Tabs and Panes exhibit the same issue.

Steps:

  • start zellij
  • create new pane or tab
  • open vim
  • close pane or tab
  • ps aux | grep vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed suspected bug
Projects
None yet
Development

No branches or pull requests

3 participants