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-40696: Fix a hang that can arise after gen.throw() #20287

Merged
merged 5 commits into from May 22, 2020

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented May 21, 2020

@cjerdonek cjerdonek changed the title [WIP] bpo-40696: Fix a hang that can arise after gen.throw() bpo-40696: Fix a hang that can arise after gen.throw() May 21, 2020
@cjerdonek cjerdonek added the needs backport to 3.9 only security fixes label May 21, 2020
Modules/_asynciomodule.c Outdated Show resolved Hide resolved
Objects/genobject.c Outdated Show resolved Hide resolved
Copy link
Member

@1st1 1st1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few comments, Chris.

@cjerdonek
Copy link
Member Author

@1st1 I made some changes. Let me know what you think. Happy to iterate further.

@cjerdonek cjerdonek merged commit 7c30d12 into python:master May 22, 2020
@miss-islington
Copy link
Contributor

Thanks @cjerdonek for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@cjerdonek cjerdonek deleted the issue-40696-await-hang branch May 22, 2020 20:33
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2020
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
@bedevere-bot
Copy link

GH-20321 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 22, 2020
@cjerdonek cjerdonek added the needs backport to 3.9 only security fixes label May 22, 2020
@miss-islington
Copy link
Contributor

Thanks @cjerdonek for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2020
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 22, 2020
@bedevere-bot
Copy link

GH-20322 is a backport of this pull request to the 3.9 branch.

cjerdonek added a commit that referenced this pull request May 22, 2020
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
arturoescaip pushed a commit to arturoescaip/cpython that referenced this pull request May 24, 2020
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
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.

None yet

5 participants