Skip to content

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

@Sene4kass

Description

@Sene4kass

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:

Creating process...
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
terminate called recursively
Aborted (core dumped)

Code:

#include <boost/process/v2/process.hpp>
#include <boost/process/v2/stdio.hpp>
#include <boost/program_options/errors.hpp>

#include <iostream>

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions