Boost logo

Boost Users :

Subject: Re: [Boost-users] [Process (Vault)] child::wait error on OS X 10.6
From: Boris Schaeling (boris_at_[hidden])
Date: 2009-10-03 09:56:28


On Thu, 01 Oct 2009 22:13:30 +0200, Rush Manbert <rush_at_[hidden]> wrote:

Hi Rush,

> [...]I used the link in the introduction to get the zip file, so I think
> I
> have the correct version.

I applied a few patches to the version in the sandbox at
https://svn.boost.org/svn/boost/sandbox/process/. One of the patches I had
received from someone using Boost.Process on Mac OS X 10.4.11 which makes
me believe that Boost.Process basically works on OS X. While you can
update your version of the library, too, I don't think that the changes in
the sandbox will fix your problem.

> I am running the following test function:
>
> namespace bp = boost::process;
> namespace bios = boost::iostreams;
>
> int BoostProcessTest (void)
> {
> std::cout << "\nTesting launch of child process using Boost.Process\n";
>
> std::string exec = bp::find_executable_in_path("svn");
> std::vector<std::string> args;
> args.push_back("svn");
> args.push_back("info");
>
> // context
> bp::context ctx;
>
> // child launch
> bp::child c = bp::launch(exec, args, ctx);
> // sleep(1);
>
> //wait
> const bp::status s = c.wait();
>
> // parse status
> if (s.exited() && s.exit_status() == EXIT_SUCCESS)
> std::cout << "Directory is a working copy." << std::endl;
> else
> std::cout << "Directory is not a working copy." << std::endl;
> std::cout << std::endl;
>
> return 0;
> }
>
> I call this function in a loop for as long as it returns 0, which
> should be forever.
>
> The test is run in a directory that is NOT a svn working copy, so all
> that the child process does is to write a line to stderr and exit.
>
> What I'm seeing, however is this message:
> Error: Caught an exception! boost::process::child::wait: waitpid(2)
> failed: Interrupted system call
>
> The only way I have found to make that go away is by adding the sleep
> (1) call (commented out above). Then it runs forever.

Can you copy and paste your code in BoostProcessTest() to main() in a new
test program (just to make sure that there is nothing else in your program
which interrupts waitpid())?

Is there any change if you run your program in a svn directory? Do you
still get the exception if you try to launch another program?

Boris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net