-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Description
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:
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <boost/process.hpp>
#include <boost/process/extend.hpp>
namespace bp = boost::process;
TEST(BoostProcessTest, limit_handles_breaks_exec_error_handling) {
{
std::error_code ec;
bp::child{bp::exe = "some_nonexistent_path", ec}.wait();
EXPECT_EQ(std::errc::no_such_file_or_directory, ec);
}
{
std::error_code ec;
bp::child{bp::exe = "some_nonexistent_path", ec, bp::limit_handles}.wait();
// EXPECT_EQ(std::errc::no_such_file_or_directory, ec);
EXPECT_EQ(std::error_code{}, ec); // Boost.Process bug
}
}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Metadata
Metadata
Assignees
Labels
No labels