gh-156204: Guard recursion in PyErr_GivenExceptionMatches - #156205
ZeroIntensity merged 9 commits into
Conversation
Documentation build overview
|
|
Looks like some test is failing. |
hi, the failing checks were unrelated to this PR, as the PR was stale form some days, so I updated the branch and synced it to the current main. |
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM. I'll give Irit some time to take another look before merging, and I'll also run the buildbots in the meantime to make sure that the recursive test doesn't fail on some weird platforms.
|
🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit 141b181 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F156205%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Thanks @BHUVANSH855 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-158622 is a backport of this pull request to the 3.15 branch. |
|
GH-158623 is a backport of this pull request to the 3.14 branch. |
|
Fixes issue gh-156204.
PyErr_GivenExceptionMatchesinPython/errors.crecursively unpacks tuple targets without recursion checks, causing native C stack exhaustion and aSIGSEGVwhen given deeply nested exception tuples.This change:
PyErr_GivenExceptionMatchesviaPy_EnterRecursiveCall()andPy_LeaveRecursiveCall()._testcapi.err_givenexceptionmatches()helper and a regression test inLib/test/test_exceptions.py.blurbNEWS entry.Verified: with
Python/errors.creverted to the pre-fix version the new test segfaults; with the fix it passes.