Skip to content

gh-102304: Fix 2 New Stable ABI Functions - #104762

Merged
ericsnowcurrently merged 7 commits into
python:mainfrom
ericsnowcurrently:fix-stable-abi
May 30, 2023
Merged

ericsnowcurrently merged 7 commits into
python:mainfrom
ericsnowcurrently:fix-stable-abi

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented May 22, 2023 •

Copy link
Copy Markdown
Member
@Yhg1s

Yhg1s commented May 22, 2023

Copy link
Copy Markdown
Member

I expect you'll want to backport this to 3.12?

@ericsnowcurrently ericsnowcurrently added the needs backport to 3.12 only security fixes label May 22, 2023
@ericsnowcurrently
ericsnowcurrently enabled auto-merge (squash) May 22, 2023 22:19
@vstinner

Copy link
Copy Markdown
Member

A different fix is to always implement Py_INCREF() and Py_DECREF() as opaque function calls when Py_DEBUG macro is defined. It may be safer in terms of stable ABI, no?

Comment thread Misc/stable_abi.toml Resolved
Comment thread Misc/stable_abi.toml Resolved
ericsnowcurrently and others added 3 commits May 22, 2023 16:27
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: T. Wouters <thomas@python.org>
@vstinner

Copy link
Copy Markdown
Member

A different fix is to always implement Py_INCREF() and Py_DECREF() as opaque function calls when Py_DEBUG macro is defined. It may be safer in terms of stable ABI, no?

I created PR #104763 to implement this idea.

@ericsnowcurrently
ericsnowcurrently requested a review from a team as a code owner May 30, 2023 22:15
@ericsnowcurrently
ericsnowcurrently merged commit 26e7bbf into python:main May 30, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

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

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @ericsnowcurrently, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 26e7bbf66e93ee7c94b6e007ec7b2d769c2ced92 3.12

@ericsnowcurrently

Copy link
Copy Markdown
Member Author

Hmm, I had not meant to merge this before checking with @vstinner about gh-104763. I'm not sure how that happened accidentally. 😟

That said, I was already leaning toward merging this and then letting gh-104763 roll it back if applicable. The most important thing for me is that we get the per-interpreter reftotal working for 3.12+. So I'll go ahead with the backport at this point.

@bedevere-bot

Copy link
Copy Markdown

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

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label May 30, 2023
@ericsnowcurrently
ericsnowcurrently deleted the fix-stable-abi branch May 30, 2023 23:53
@vstinner

Copy link
Copy Markdown
Member

I'm not convinced that _DO_NOT_USE_THIS suffix is really needed. We have tons of private functions with _Py prefix that must not be called. If people use them, they are already on their own. For me, this long _DO_NOT_USE_THIS suffix is just a burden, for example if you have to manually type the full name in a debugger or a profiler to look for them.

@ericsnowcurrently

Copy link
Copy Markdown
Member Author

I'm fine with changing the name, but I'd rather gh-104763 make it irrelevant. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants