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
gh-94518: Port 23-argument _posixsubprocess.fork_exec
to Argument Clinic
#94519
base: main
Are you sure you want to change the base?
gh-94518: Port 23-argument _posixsubprocess.fork_exec
to Argument Clinic
#94519
Conversation
You are passing You can solve the problem and get rid of
|
Now it builds but crashes the interpreter while Ubuntu CI run:
|
From Ubuntu runner build logs:
@tiran Any ideas how it can be possible? A compiler points to a fused declaration and assignment complaining that an assignment may be missing. |
@tiran Thank you, addressed in gh-94687. Would you mind to take a look please (and add |
Please include a news entry. We typically only skip news if the change is a trivial internal change or change is already covered by a previous PR. Non-trivial commits get a news entry so other core devs, release manager, distributors, and users have an easier way to locate a problem when a change introduces a regression. |
Done (initially I've thought this change is invisible to users so skipped it). |
Modules/_posixsubprocess.c
Outdated
@@ -476,6 +498,10 @@ reset_signal_handlers(const sigset_t *child_sigmask) | |||
#endif /* VFORK_USABLE */ | |||
|
|||
|
|||
#define RESERVED_GID (gid_t)-1 | |||
#define RESERVED_PID (pid_t)-1 |
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.
Don't define RESERVED_PID. A pid is never passed in, the pid == -1 checks in the existing code are idiomatic ways to determine a pid_t returning call is reporting an error. Adopting this level of abstraction for pid_t
-1 will just confuse readers.
I'm fine with the constants for their GID and UID purposes.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @gpshead: please review the changes made to this pull request. |
7ad2a62
to
c822f10
Compare
Um... I didn't order to force-push it. When I clicked Update with rebase site button near This PR has conflicts with a base branch, I expected a usual conflict resolution editor prompt (at least it always happened before for |
Edit: in addition to what a title says, this PR also removes theoretical situation of
/call_set[ug]id==true/
with uninitialized/[ug]id/
. This is required to avoid undefined behavior (as Christian Heimes initially pointed out). A full removal ofcall_setgid
will be done in a separate PR.To break nothing, the porting was done in steps, a commit per each:
Also, it fixes minor bug traps:
(...id)-1
as an impossible default value togid
anduid
local variables (thanks to Christian for proposing this)_posixsubprocess.fork_exec
to Argument Clinic #94518