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

gh-122334: Fix crash when importing ssl after re-initialization #122481

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

neonene
Copy link
Contributor

@neonene neonene commented Jul 30, 2024

The current METH_FASTCALL|METH_KEYWORDS functions in a non-builtin module can cause segfaults after restarting the main interpreter, invoking _PyArg_UnpackKeywords() with an insufficiently cleared _PyArg_Parser struct.

This patch fixes the invalidation of the static argument parsers.

The current METH_FASTCALL|METH_KEYWORDS functions in a non-builtin module can cause segfaults after restarting the main interpreter, invoking _PyArg_UnpackKeywords() with an insufficiently cleared _PyArg_Parser struct.

This patch fixes the invalidation of the static argument parsers.
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122495 is a backport of this pull request to the 3.12 branch.

@neonene
Copy link
Contributor Author

neonene commented Jul 31, 2024

This can be backported to 3.13. #122495 is a manual backport to 3.12.

cc @kumaraditya303

@kumaraditya303 kumaraditya303 merged commit 9fc1c99 into python:main Aug 2, 2024
39 checks passed
@kumaraditya303 kumaraditya303 added the needs backport to 3.13 bugs and security fixes label Aug 2, 2024
@miss-islington-app
Copy link

Thanks @neonene for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 2, 2024
…pythonGH-122481)

* Fix crash when importing ssl after re-initialization
(cherry picked from commit 9fc1c99)

Co-authored-by: neonene <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Aug 2, 2024

GH-122614 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 2, 2024
kumaraditya303 pushed a commit that referenced this pull request Aug 2, 2024
GH-122481) (#122495)

Fix crash when importing ssl after re-initialization

The current METH_FASTCALL|METH_KEYWORDS functions in a non-builtin module can cause segfaults after restarting the main interpreter, invoking _PyArg_UnpackKeywords() with an insufficiently cleared _PyArg_Parser struct.

This patch fixes the invalidation of the static argument parsers.
kumaraditya303 pushed a commit that referenced this pull request Aug 2, 2024
GH-122481) (#122614)

gh-122334: Fix crash when importing ssl after re-initialization (GH-122481)

* Fix crash when importing ssl after re-initialization
(cherry picked from commit 9fc1c99)

Co-authored-by: neonene <[email protected]>
@neonene
Copy link
Contributor Author

neonene commented Aug 2, 2024

Thanks.

@neonene neonene deleted the fix-122334 branch August 2, 2024 15:41
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
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.

3 participants