Update Subprocess to throw if exec() fails
Summary:
Add a new SubprocessSpawnError, and change the Subprocess constructor to
throw this if the child process encounters an error before calling
execve(). Error information is passed back to the parent process over a
pipe.
Previosly in this case the Subprocess constructor would fail, and
clients would simply get a return code of 126 or 127 when waiting on the
process. There was no way to distinguish this from a successful
execve() followed by the child process exiting with status 127.
Test Plan:
Added tests to check the exception behavior, and also to check for file
descriptor leaks in the parent process.
Reviewed By: tudorb@fb.com
FB internal diff:
D776273