Skip to content

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

Merged
gpshead merged 1 commit into
python:masterfrom
alpire:subprocess
Jan 22, 2020
Merged

bpo-35182: fix communicate() crash after child closes its pipes#18117
gpshead merged 1 commit into
python:masterfrom
alpire:subprocess

Conversation

@alpire
Copy link
Copy Markdown
Contributor

@alpire 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 January 22, 2020 15:23
@the-knights-who-say-ni
Copy link
Copy Markdown

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
@miss-islington
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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

@miss-islington
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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

@miss-islington
Copy link
Copy Markdown
Contributor

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

@bedevere-bot
Copy link
Copy Markdown

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

@bedevere-bot
Copy link
Copy Markdown

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

miss-islington pushed 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 pushed 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
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…onGH-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>
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.

6 participants