Uh oh!
There was an error while loading. Please reload this page.
gh-135125: Fix Py_STACKREF_DEBUG build - #139475
Conversation
efimov-mikhail
commented
Oct 1, 2025
CC @markshannon |
This PR is just minimal fix for I suggest to make changes for this build: provide exactly those flags for indexes as for standard GIL build: And use indexes without flags as real indexes in hash table. For example, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
efimov-mikhail
commented
Oct 3, 2025
I provide those changes.
|
efimov-mikhail
commented
Oct 3, 2025
CC @mpage |
There was a problem hiding this comment.
This looks good to me. In the future I'd recommend splitting this into two PRs (and associated issues): one that is the minimal fix for the build and another that unifies the refcounting behavior. I'd like to give Mark a chance to review this as I'm not sure if he wants to preserve the refcounting behavior in the debug build. I've added him as a reviewer.
efimov-mikhail
commented
Oct 3, 2025
Thanks! I thought about two separate PRs but I wasn't sure about that. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sergey-miryanov
commented
Oct 22, 2025
Since #139384 has been merged, we should add |
I've already added this function to |
sergey-miryanov
commented
Oct 23, 2025
Sorry, it is my oversight. |
efimov-mikhail
commented
Oct 23, 2025
@markshannon |
markshannon
commented
Oct 23, 2025
This looks good, and passes all the test on my machine with When I last run all the tests with @efimov-mikhail any idea why all the tests now pass? Have the leaks been fixed, or are we not now detecting them for some reason? |
Thanks for the review! On my machine I have the following failures in this mode: |
markshannon
commented
Oct 23, 2025
Those failures look very much like the ones I was seeing before. |
markshannon
commented
Oct 23, 2025
Yeah, I had All looks good now. |
markshannon
commented
Oct 23, 2025
Thanks for doing this, btw. |
Thanks for merge! Do we want to backport this on 3.14 or it seems redundant? |
* Use the same pattern of refcounting for stackrefs as in production build
There are two problems with PyStackRef debug builds:
_PyStackRef_FromPyObjectBorrowfunction.We should provide
Py_INCREFhere, because eachPyStackRef_CLOSEwill usePy_DECREFin this mode.PyStackRef_WrapandPyStackRef_Unwrapfunctions.Py_STACKREF_DEBUGset. #135125