Skip to content

gh-106905: avoid incorrect SystemError about recursion depth mismatch #106906

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

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

mmohrhard
Copy link
Contributor

@mmohrhard mmohrhard commented Jul 20, 2023

I don't know if this fixes my original problem but it will at least remove one source of incorrect recursion depth mismatch errors.

@mmohrhard
Copy link
Contributor Author

Note that in theory this should not be necessary as there is a if (result && state->recursion_depth != starting_recursion_depth) { check but I think there must be an early exit that does not consider a NULL value a problem.

I can only reproduce this issue rarely in a threaded application but let like matching the recursion depth changes is an easy way to make sure that the underlying issue can bubble up instead of hiding behind the recursion depth mismatch error.

@sk1p sk1p mentioned this pull request Aug 10, 2023
7 tasks
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 13, 2023
@pablogsal pablogsal enabled auto-merge (squash) November 13, 2023 12:44
@pablogsal pablogsal merged commit 1447af7 into python:main Nov 13, 2023
@miss-islington-app
Copy link

Thanks @mmohrhard for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @mmohrhard and @pablogsal, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1447af797048e62049d00bbd96d8daee3929f527 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2023
…smatch (pythonGH-106906)

* pythongh-106905: avoid incorrect SystemError about recursion depth mismatch

* Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst

---------

(cherry picked from commit 1447af7)

Co-authored-by: Markus Mohrhard <[email protected]>
Co-authored-by: Shantanu <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 13, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 13, 2023
gpshead pushed a commit to gpshead/cpython that referenced this pull request Dec 7, 2023
…epth mismatch (python#106906)

Backport of 1447af7 from python#106906.

* pythongh-106905: avoid incorrect SystemError about recursion depth mismatch
* Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst

---------

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

bedevere-app bot commented Dec 7, 2023

GH-112849 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 7, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…smatch (python#106906)

* pythongh-106905: avoid incorrect SystemError about recursion depth mismatch

* Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst

---------

Co-authored-by: Shantanu <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…smatch (python#106906)

* pythongh-106905: avoid incorrect SystemError about recursion depth mismatch

* Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst

---------

Co-authored-by: Shantanu <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
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.

5 participants