-
Notifications
You must be signed in to change notification settings - Fork 273
only selectively kill child, not entire process group #2918
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
Conversation
1bda6cd
to
6965b72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ... does it actually work as expected? One experiment is invoking CBMC from Java, then sending a TERM signal to the CBMC process -> the Java process should still terminate ok and not be killed.
src/util/run.cpp
Outdated
@@ -202,6 +207,8 @@ int run( | |||
return 1; | |||
} | |||
|
|||
unregister_child(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for an unrelated fix: could the while
loop above please get braces around its body? The jump in indentation looked pretty awkward at first sight.
|
||
#ifdef _WIN32 | ||
#else | ||
std::vector<pid_t> pids_of_children; | ||
pid_t child_pid = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <vector>
is probably redundant now. Actually more of the includes could be cleaned up (we don't need anything on Windows, csignal
is included by the header file already).
Note that this is only part of the story: we still use |
6965b72
to
c93180a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: c93180a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84146654
pid_t child_pid = 0; | ||
|
||
void register_child(pid_t pid) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to include an invariant ensuring that only one child is registered.
If multiple child processes are actually supported here, then some kind of warning would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added preconditions
c93180a
to
1c8fc56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: 1c8fc56).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84692107
This is a new approach to addressing the problem explained in PR #319.
It is enabled by the fact that SMT solvers are now executed with run(), as opposed to system().