boostorg / boostorg/process

Problem with process creating (boost process v2) in limited linux systems

Open
#529 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Hello!
I'm using boost::process::v2 (boost version 1.89 - latest stable) in my project with cross-compiling the final binary. If I use the amd64 standard debian 12, all is ok and process creating ended successfully without errors. But if I using it in limited linux (system with busybox, specific process architecture (for example, armv7l)) I getting an unknown exception. Try/catch can't process that exception. Google breakpad also can't give me details.
I checked the system - clone(), execve(), fork() works there. But bp::v2::process give me an unknown exception.
Also I testing on aarch64 (arm64) limited system and on standard linux version system. In standard linux that works great, but on limited system I've got the same error.
**Warning**: the "limited" version I mean Linux core + standard utilities such as busybox, libc, sh and other configurated extremely necessary utils.
I tested work directory access - all is ok on my side. I running the "/bin/echo" manually from shell, and that works good.

System info:
armv7l, linux version 4.19.91,
GNU C Library (Buildroot) stable release version 2.29.
BusyBox v1.24.1 (2024-03-14 16:36:28 CST) multi-call binary

Binary compiled with GCC 8.3.0

Error log:

```shell
Creating process...
terminate called after throwing an instance of 'boost::wrapexcept'
terminate called recursively
Aborted (core dumped)
```

Code:

```c++
#include
#include
#include

#include

int main()
{
try {
boost::asio::io_context context;
std::cout << "Creating process..." << std::endl;
boost::process::v2::process proc(context, "/bin/echo", {"hello", "world!"}, boost::process::v2::process_stdio {});
std::cout << "Process was created." << std::endl;
context.run();

return EXIT_SUCCESS;

} catch (const boost::program_options::error& ex) {
std::cout << "Bad CLI: " << ex.what() << std::endl;
} catch (const boost::system::system_error& error) {
std::cout << "Exception: " << error.what() << ". Error code: " << error.code() << std::endl;
} catch (...) {
std::cout << "Unknown exception has occured." << std::endl;
}

return EXIT_FAILURE;
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.