Skip to content

Fix zombie processes generation#599

Open
KarenBarsegyan wants to merge 1 commit intolandley:masterfrom
KarenBarsegyan:bug/waitpid_dhcp
Open

Fix zombie processes generation#599
KarenBarsegyan wants to merge 1 commit intolandley:masterfrom
KarenBarsegyan:bug/waitpid_dhcp

Conversation

@KarenBarsegyan
Copy link

run_script function logic: forked process goes into if(!pid) and starts external script. After executing the script, process ends right after execvp and parent process continues working. It has to go to if(error) by origin logic, but it doesn't. Therefore waitpid isn't called and forked process lives in Z state until dhcp client stops.

This bug leads to infinite spawning of Z processes. Therefore, just call waitpid in any case, not only error. And only after waitpid is done, check error code.

run_script function logic: forked process goes into if(!pid) and
starts external script. After executing the script, process ends right
after execvp and parent process continues working. It has to go to
if(error) by origin logic, but it doesn't. Therefore waitpid isn't
called and forked process lives in Z state until dhcp client stops.

This bug leads to infinite spawning of Z processes. Therefore, just
call waitpid in any case, not only error. And only after waitpid is
done, check error code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant