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

[3.11] gh-104372: Cleanup _posixsubprocess make_inheritable for async signal safety gh-104518 #104785

Merged
merged 7 commits into from
May 24, 2023

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented May 23, 2023

Move all of the Python C API calls into the parent process up front
instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from
the post-fork/vfork child process.

Much of this was long overdue. We shouldn't have been using PyTuple and
PyLong APIs within all of these low level functions anyways.

This is a backport of c649df6 for #104518 and the tiny adjustment in d1732fe #104697.

…c signal safety and no GIL requirement (python#104518)

Move all of the Python C API calls into the parent process up front
instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from
the post-fork/vfork child process.

Much of this was long overdue. We shouldn't have been using PyTuple and
PyLong APIs within all of these low level functions anyways.

(cherry picked from commit c649df6)
…or async signal safety and no GIL requirement (pythonGH-104518)

Move all of the Python C API calls into the parent process up front
instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from
the post-fork/vfork child process.

Much of this was long overdue. We shouldn't have been using PyTuple and
PyLong APIs within all of these low level functions anyways..
(cherry picked from commit c649df6)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
@gpshead gpshead marked this pull request as ready for review May 23, 2023 02:22
@gpshead gpshead marked this pull request as draft May 23, 2023 05:59
@gpshead
Copy link
Member Author

gpshead commented May 23, 2023

The AddressSanitizer failure is only reproducable under an Ubuntu 20.04 ci-like-toolchain setup in the default optimized build. Using a --with-pydebug build in that setup, it does not happen. Using more recent compiler (& ASAN?) toolchains such as ubuntu 22.04 and 23.04, it does not happen.

regardless, i won't merge until finding a workaround. for CI health purposes alone.

@gpshead gpshead marked this pull request as ready for review May 23, 2023 19:02
@gpshead gpshead merged commit 6d00ae3 into python:3.11 May 24, 2023
@gpshead gpshead deleted the backport-c649df6-3.11 branch May 24, 2023 03:42
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

Successfully merging this pull request may close these issues.

2 participants