Skip to content

gh-148208: Fix recursion depth leak in PyObject_Print#148209

Merged
gpshead merged 2 commits intopython:mainfrom
Wulian233:object
Apr 12, 2026
Merged

gh-148208: Fix recursion depth leak in PyObject_Print#148209
gpshead merged 2 commits intopython:mainfrom
Wulian233:object

Conversation

@Wulian233
Copy link
Copy Markdown
Contributor

@Wulian233 Wulian233 commented Apr 7, 2026

Copy link
Copy Markdown
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Do you think you could come up with a simple test case to stress this?

@Wulian233
Copy link
Copy Markdown
Contributor Author

Sorry, I'm not quite sure how to create tests for capi
sad

@StanFromIreland
Copy link
Copy Markdown
Member

StanFromIreland commented Apr 7, 2026

Is _Py_LeaveRecursiveCall not a no-op since 0142236?

@Wulian233
Copy link
Copy Markdown
Contributor Author

Oh, that's true. Is it still necessary for me to add this?

Copy link
Copy Markdown
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

while having a test would be neat, I don't think we need one for this. it's a pretty clear oversight in the code and not likely to regress.

@gpshead gpshead added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Apr 12, 2026
@gpshead gpshead merged commit e2fa10e into python:main Apr 12, 2026
62 checks passed
@miss-islington-app
Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 12, 2026
…GH-148209)

(cherry picked from commit e2fa10e04d3fed4c248881d69411fc208d05ad6b)

Co-authored-by: Wulian233 <1055917385@qq.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 12, 2026
…GH-148209)

(cherry picked from commit e2fa10e04d3fed4c248881d69411fc208d05ad6b)

Co-authored-by: Wulian233 <1055917385@qq.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 12, 2026

GH-148412 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 12, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 12, 2026

GH-148413 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 Apr 12, 2026
gpshead pushed a commit that referenced this pull request Apr 12, 2026
…8209) (#148412)

gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209)
(cherry picked from commit e2fa10e)

Co-authored-by: Wulian233 <1055917385@qq.com>
@Wulian233 Wulian233 deleted the object branch April 12, 2026 02:24
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.

4 participants