-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
std.process: Do not kill process group 2 in unittest #10586
Conversation
When passing a Pid object to tryWait(), its processId will be changed to Pid.terminated, which happens to be -2. Passing this value to kill() will kill the process group 2 on Posix systems. If you run the build and test suite using this process group, the test case will kill the entire build. Co-authored-by: Emanuele Rocca <[email protected]> Co-authored-by: Jochen Sprickerhof <[email protected]> Bug-Debian: https://bugs.debian.org/1089007
Thanks for your pull request and interest in making D better, @helmutg! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10586" |
Thanks, but wouldn't it make more sense to have |
That is a very reasonable question. Thank you for the review. Is the What I am proposing here is a minimum viable solution that makes gcc build rather than fail its build. If changing |
No, I think it is designed to only kill child processes, created using other
Seems highly unlikely. The unittest in question seems to assume that
True. We can go forward with this change as well, though I would add a Let's see what other Phobos maintainers say as well. @schveiguy ? |
My understanding is that the proposed MR obsoletes this MR if merged, but I am not convinced that it is eligible for backporting into older gcc releases. |
Why is that? What would make it eligible? |
Your change is changing semantics. Effectively, you'd have to provide a good argument for why it cannot break existing code that relies on the unintended behavior. You cannot provide such a proof. Hence, I do not expect your change to be backportable. Keep in mind that there are two partially distinct bugs here:
The first of these is something we want to resolve in older releases, because they fail to build. It is not as clear that we also need to fix the latter in old releases. |
I think the fact that it is not possible to create I can't think of a way to write a program that would be affected by this, without resorting to raw pointer manipulation, or abusing the invalid |
That sounds like a strong reason. I appreciate if you can try getting this ported to gcc versions 15, 14, 13, 12, 11 and 10. |
@ibuclaw Is that something we can do? |
I think that is correct. |
When passing a Pid object to tryWait(), its processId will be changed to Pid.terminated, which happens to be -2. Passing this value to kill() will kill the process group 2 on Posix systems. If you run the build and test suite using this process group, the test case will kill the entire build.
Bug-Debian: https://bugs.debian.org/1089007