Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503)#130556

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedFeb 25, 2025
edited by bedevere-appbot
Loading

The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit0ef4ffe)

…honGH-130503)The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowedreference, has been replaced by using one of the following functions, whichreturn a strong reference and distinguish a missing attribute from an error:_PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(),_PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().(cherry picked from commit0ef4ffe)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchakaserhiy-storchaka merged commit7c1b76f intopython:3.13Feb 25, 2025
37 checks passed
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@serhiy-storchaka, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 7c1b76fce8c8df00da38830f72dbdde6881a33be 3.12

@vstinner
Copy link
Member

This change introduced reference leaks in the 3.13 branch. Example:

$ ./python -m test test_genericalias -R 3:3(...)test_genericalias leaked [108, 108, 108] references, sum=324(...)

cc@encukou

@vstinner
Copy link
Member

Example of buildbot failure, Fedora Stable (x86):https://buildbot.python.org/#/builders/1471/builds/551

Failed tests:

  • test_genericalias
  • test_ast
  • test_pickletools
  • test_typing

@serhiy-storchakaserhiy-storchaka deleted the backport-0ef4ffe-3.13 branchFebruary 26, 2025 10:09
@serhiy-storchaka
Copy link
MemberAuthor

Indeed, there is a leak in_pickle.c caused by mistake in backporting. Should be fixed by#130568. Thank you@vstinner for noticing.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull requestFeb 26, 2025
…honGH-130503) (pythonGH-130556)The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowedreference, has been replaced by using one of the following functions, whichreturn a strong reference and distinguish a missing attribute from an error:_PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(),_PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().(cherry picked from commit0ef4ffe)(cherry picked from commit7c1b76f)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-130576 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelFeb 26, 2025
serhiy-storchaka added a commit that referenced this pull requestFeb 26, 2025
GH-130556) (GH-130576)The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowedreference, has been replaced by using one of the following functions, whichreturn a strong reference and distinguish a missing attribute from an error:_PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(),_PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().(cherry picked from commit0ef4ffe)(cherry picked from commit7c1b76f)(cherry picked from commit2ab7e11)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303kumaraditya303 is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Labels
topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@serhiy-storchaka@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp