-
Notifications
You must be signed in to change notification settings - Fork 118
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
limit_handles breaks exec() error reporting on POSIX #202
Comments
Got the same error, is there any update on this? Or at least small patch on how to fix this? |
Testing with boost-process 1.84.0, this issue still seems to exist. Commit 1a1d677 added #include <boost/process/handles.hpp>
#include <boost/process/system.hpp>
int main() {
// with limit_handles: no exception thrown, but should be
// without limit_handles: throws exception as expected
boost::process::system("/does/not/exist", boost::process::limit_handles);
return 0;
} |
dkl
added a commit
to dkl/boost-process
that referenced
this issue
Apr 17, 2024
_pipe_sink was assigned after call_on_setup(), after limit_fd_::on_setup(), but this was too late. It must be assigned earlier so that executor::get_used_handles() can see it and prevent limit_handles from closing the internal pipe for passing exec() errors from child to parent. Fixes: 1a1d677 Closes: boostorg#202 Signed-off-by: Daniel Klauer <[email protected]>
klemens-morgenstern
pushed a commit
that referenced
this issue
Jun 4, 2024
_pipe_sink was assigned after call_on_setup(), after limit_fd_::on_setup(), but this was too late. It must be assigned earlier so that executor::get_used_handles() can see it and prevent limit_handles from closing the internal pipe for passing exec() errors from child to parent. Fixes: 1a1d677 Closes: #202 Signed-off-by: Daniel Klauer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using limit_handles on POSIX platforms causes internal logic for
exec()
error reporting to break.The root cause is that foreach_used_handle on POSIX does not account for executor::_pipe_sink, which is needed for error reporting from child to parent.
A minimal reproducer:
The text was updated successfully, but these errors were encountered: