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

bpo-35182: fix communicate() crash after child closes its pipes #18117

Merged
merged 1 commit into from Jan 22, 2020

Conversation

@alpire
Copy link
Contributor

alpire commented Jan 22, 2020

When communicate() is called in a loop, it crashes when the child process has already closed any piped standard stream, but still continues to be running. The fix is trivial.

(Original PR is #17020. I had to create a new one to rebase on top of master & fix merge conflicts)

https://bugs.python.org/issue35182

…7020)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running
@alpire alpire requested a review from gpshead as a code owner Jan 22, 2020
@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Jan 22, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@alpire

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@gpshead gpshead self-assigned this Jan 22, 2020
@gpshead gpshead merged commit d3ae95e into python:master Jan 22, 2020
9 checks passed
9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200122.21 succeeded
Details
bedevere/issue-number Issue number 35182 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Thanks @alpire for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

I'm having trouble backporting to 3.8. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.8 label.

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Sorry, @alpire and @gpshead, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d3ae95e1e945ed20297e1c38ba43a18b7a868ab6 3.7

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Thanks @alpire for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Sorry @alpire and @gpshead, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker d3ae95e1e945ed20297e1c38ba43a18b7a868ab6 3.8

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Thanks @alpire for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 22, 2020

Sorry, @alpire and @gpshead, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d3ae95e1e945ed20297e1c38ba43a18b7a868ab6 3.7

alpire added a commit to alpire/cpython that referenced this pull request Jan 23, 2020
…pythonGH-17020) (pythonGH-18117)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e)

Co-authored-by: Alex Rebert <alex@forallsecure.com>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 23, 2020

GH-18148 is a backport of this pull request to the 3.8 branch.

alpire added a commit to alpire/cpython that referenced this pull request Jan 23, 2020
…pythonGH-17020) (pythonGH-18117)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e)

Co-authored-by: Alex Rebert <alex@forallsecure.com>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 23, 2020

GH-18151 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jan 23, 2020
…GH-18117) (GH-18148)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e)

Co-authored-by: Alex Rebert <alex@forallsecure.com>





https://bugs.python.org/issue35182
miss-islington added a commit that referenced this pull request Jan 23, 2020
…GH-18117) (GH-18151)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e)

Co-authored-by: Alex Rebert <alex@forallsecure.com>





https://bugs.python.org/issue35182



Automerge-Triggered-By: @gpshead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.