-
Notifications
You must be signed in to change notification settings - Fork 118
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
V2 overwrites SIGCHLD handler without calling previous one #432
Comments
Such a plan can be made now, I guess. It could even land in 1.88. What exactly do you need? Just disable the use of the signal ad build tine? Would you still want async wait? |
The most important step would be if use of Then, use of However, at least polling the exit status should be possible, but I think it is with Keeping Thanks for considering! |
Maybe signalfd could also be an option on Linux? It's much older than pidfd... https://man7.org/linux/man-pages/man2/signalfd.2.html |
No, seems like signalfd is not a viable option: https://ldpreload.com/blog/signalfd-is-useless?reposted-on-request AFAIUI the fd only gets signal notifications if the signal is masked for the normal signal handling, which defeats the purpose for this use-case... |
I think a pipe trick is better. Open a pipe, close the write side om the parent and asynchronously wait for it. Would you be available for beta testing? |
OK, sounds also good.
Yes, but I'll be on vacation after this week until next year. |
Must've been a stressful year if you got 20 days for Weihnachtsurlaub left. I'll probably get to work in January or Februrary, it won't make the upcoming release (1.87). |
Indeed 😅 Allright, I'll keep an eye out for it and test it then! |
Merry early Christmas: https://github.com/boostorg/process/compare/no-signal-set?expand=1 Well, if it works that is. |
We're using boost::process in a library to spawn a process. We use RHEL 8, so no pidfd, unfortunately.
This library is used in an executable that spawns its own child processes and thus installs its own SIGCHLD handler.
It seems that in v2, the boost::process / boost::asio signal handler completely overwrites the application signal handler, which leads to havoc, since the main application does not notice its child processes exiting anymore...
Asio docs for
basic_signal_set
say (https://live.boost.org/doc/libs/1_86_0/doc/html/boost_asio/reference/basic_signal_set.html#boost_asio.reference.basic_signal_set.multiple_registration_of_signals):This makes the use of
basic_signal_set
unacceptable in a library IMO.In v1, there was some effort, to call the previous signal handler as well:
process/include/boost/process/v1/detail/posix/wait_for_exit.hpp
Lines 68 to 69 in 55e2460
However, there's also use of asio::signal_set in sigchld_service:
process/include/boost/process/v1/detail/posix/sigchld_service.hpp
Line 28 in 55e2460
In any case, we managed to use v1 for our use-case. But I think it's currently impossible to use boost process v2 for our use case...
Do you agree or am I missing something?
Are there any plans to make v2 usable in a library, where full control over signal handlers cannot be assumed?
The text was updated successfully, but these errors were encountered: