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

macOS: login processes not reaped from closed surfaces #2273

Closed
qwerasd205 opened this issue Sep 20, 2024 · 4 comments · Fixed by #2277
Closed

macOS: login processes not reaped from closed surfaces #2273

qwerasd205 opened this issue Sep 20, 2024 · 4 comments · Fixed by #2277
Labels

Comments

@qwerasd205
Copy link
Collaborator

Full disclosure: I don't know as much about Unix process life cycles as I ought to, but:

When a surface is closed, the processes inside are properly killed and reaped and gone, but the login process (owned by root? no clue if that's relevant) remains as a sleeping "<defunct>" process. This isn't a really terrible bug, but definitely isn't correct and should probably be tracked down and fixed.

@mitchellh
Copy link
Contributor

This appears to only affect macOS. I've got a fix working... needs more testing stand by.

mitchellh added a commit that referenced this issue Sep 20, 2024
Fixes #2273

On macOS, killpg is expected to fail with EPERM because of the way we
launch a login process around it. Before this commit, this caused us to
never call waitpid and reap the child process, which caused the child
process to stick around as a zombie.

This commit allows killpg to fail with EPERM on macOS and fall through
to waitpid.
@creechy
Copy link

creechy commented Dec 27, 2024

I appear to be seeing this issue. Not sure if there has been a regression with this fix or something else.

My environment is macOS Sequoia 15.2, I have build my own bash shell with

./configure --prefix=/opt/local

Capturing some logging, I don't see much, when I exit a shell, not sure what I should expect though

2024-12-27 10:08:21.734914-0800 0x41f8ae   Info        0x0                  83542  0    ghostty: [com.mitchellh.ghostty:io_exec] read thread got quit signal
2024-12-27 10:08:21.738014-0800 0x41f477   Info        0x0                  83542  0    ghostty: [com.mitchellh.ghostty:surface] surface closed addr=138028000

@nklmilojevic
Copy link

I'm also seeing a lot of defunct processes.

@creechy
Copy link

creechy commented Dec 29, 2024

I have started a discussion since this current defunct process list seems different - #3596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants