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

[Linux] boost::process:: child ::wait_until is not thread-safe #824

Closed
AlexeyZaharov opened this issue Oct 29, 2023 · 1 comment
Closed

Comments

@AlexeyZaharov
Copy link

AlexeyZaharov commented Oct 29, 2023

Hi! I faced with the problem that my process hangs up while it uses wait_until() of child::process. So I watched boost code and find that boost::process::child::wait_until is not thread-safe

  1. struct signal_interceptor_t is used for setting custom reaction on signal with using system ::signal. So handler_func is a new handler and sigchld_handler is setting for previous handler
  2. The problem is that signal handler - atribut of the process, not thread, so if the next thread call ::signal then sigchld_handler is setting for handler_func
  3. Which thread will be used for handle signal is undefined. So thread with sigchld_handler == handler_func can be used! And this cause infinite loop
  4. You can face with the problem in this code, which uses problem part of wait_until. (On my system signals are handled by main thread). Also attach out of the programm
    bug_wait_until.cpp.txt
    out.txt

So can you update your documentation with this note please?

@AlexeyZaharov AlexeyZaharov changed the title [Linux] boost::process::child::wait_until is not thread-safe [Linux] boost::process:: child ::wait_until is not thread-safe Oct 29, 2023
@AlexeyZaharov
Copy link
Author

Close this issue and open in right place

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

1 participant