boostorg / boostorg/process

Zombie process created

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

Description

In https://github.com/boostorg/process/commit/bbabea30dd0940ab604e332a50b38013138dd038 the handling of execve() errors was supposedly fixed.
But if I run
```
#include
#include

int main() {
try {
boost::process::child("doesnt-exist");
}catch(...){}

sleep(100);
}
```
via strace, I can't see any wait() call
```
$ strace -f -e process ./test
execve("./test", ["./test"], 0x7ffe241129e8 /* 11 vars */) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff79b6ca6d0) = 84374
strace: Process 84374 attached
[pid 84374] execve("doesnt-exist", ["doesnt-exist"], 0x7ffd4520dd58 /* 11 vars */) = -1 ENOENT (No such file or directory)
[pid 84374] exit_group(1) = ?
[pid 84374] +++ exited with 1 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=84374, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
```
And running top (and pressing `V` to get a process tree) while the program is in the `sleep(100);` confirms there is a zombie process.

I'm using Boost 1.81.0.

By the way, in https://github.com/boostorg/process/blob/a9f083f45c6da4273885d5869c1a55c1c7d19c7a/test/error.cpp#L113 and https://github.com/boostorg/process/blob/a9f083f45c6da4273885d5869c1a55c1c7d19c7a/test/error.cpp#L122, "doesnt-exit" probably is supposed to be "doesnt-exist"?

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.