opscode/mixlib-shellout — pull request #24 by danielsdeleo (2013-09-09 23:57:45+00:00)
Title: Zombie reap bug

Ported the regression test from OHAI-455 to mixlib-shellout, which
revealed a race condition in the way shellout reaps the child after a
failed exec (most commonly caused by attempting to run a command that
doesn't exist). The call to waitpid2 used WNOHANG to avoid hanging
indefinitely if an error was caused but the child process was still
alive, but this results in the child process not getting reaped if it
exits after the call to waitpid2. In a single run of the stress test,
this occurred 94/100 times, so it is very likely that mixlib-shellout
will leak zombies for the ENOENT case without this change.