-
Notifications
You must be signed in to change notification settings - Fork 27
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 processes #8
Comments
Is this different from how things work in other libraries? I'm used to this problem with all similar Unix-based facilities... |
Yes, people often get bitten by this posix particularity. In that case, it's Open4's responsibility to not leave zombies alive when the process dies. |
openface: shouldn't you be doing a detach or wait or something to harvest the child process? |
Yes I could wait on the pid but I don't have access to it. It's not returned by the API and $? is empty because of Open4's double-fork. |
I've noticed this as well and agree with zimbatm's comments. It looks like the popen4 method should call 'Process.waitpid2(cid)' if the exec call raises an exception. It appears that a zombie process could also be left hanging around if the block, if used in block form, raises an exception. Perhaps move the existing Process.waitpid2 call to the ensure block? Shouldn't it also ensure that all pipe endpoints are closed in this path? It looks like pw.last, pr.first and pe.first won't get closed in the original post's example. |
Just found that issue, I don't have the time to investigate yet:
If you don't wait for the pid, a zombie process is going to hang around
The text was updated successfully, but these errors were encountered: