Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upchild process stuck in defunct state if uv_close is called before child exited #1911
Comments
bnoordhuis
added
help-wanted
doc
good-first-contribution
labels
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
That's a documentation issue. Pull request welcome. |
This comment has been minimized.
This comment has been minimized.
nimit95
commented
Aug 20, 2018
|
I would like to work on this issue |
This comment has been minimized.
This comment has been minimized.
|
@nimit95 please open a PR if you're still interested in tackling this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mchandler-blizzard commentedJul 5, 2018
After libuv spawned a process using uv_spawn but before the process has exited you call uv_close, libuv will unregister the SIGCHLD handler for that child process and thus never call waitpid when the child exits and cause the child to forever be stuck in the defunct state.
Ether libuv should be updated to internally keep track of this after uv_close has been called or the documentation should be updated to state not to call uv_close until the exit callback has been called.
Spawn logic:
Then clean up logic before child has exited that causes it to get stuck: