Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defunct process #445

Open
jean-christophe81 opened this issue Dec 30, 2024 · 2 comments
Open

defunct process #445

jean-christophe81 opened this issue Dec 30, 2024 · 2 comments

Comments

@jean-christophe81
Copy link

jean-christophe81 commented Dec 30, 2024

Hello

I'm using your library in both linux and windows versions. Thanks for your work.

I had to disable notify_fork and I see you have added a flag to this. I have another issue under linux. If you try to exec an non existing executable, child process still exist in defunct state. I had to to do this fix in posix launcher:

 template <typename Executor, typename Args, typename... Inits>
  auto operator()(
........
.......
      if (ec) {
        **if (pid > 0) {
          ::kill(pid, SIGKILL);
          ::waitpid(pid, nullptr, 0);
        }**
        detail::on_error(*this, executable, argv, ec, inits...);
        return basic_process<Executor>{exec};
      }
    }
    basic_process<Executor> proc(exec, pid);
    detail::on_success(*this, executable, argv, ec, inits...);
    return proc;
  }
@klemens-morgenstern
Copy link
Collaborator

klemens-morgenstern commented Dec 31, 2024

So, zombie process on execve failure?

@jean-christophe81
Copy link
Author

yes, I had a zombie child process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants