Skip to content

GH-133261: Make sure trashcan pointers look mortal -- 32 bit #133450

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 1 commit into from
May 5, 2025

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented May 5, 2025

@markshannon
Copy link
Member Author

!buildbot "x86 Debian"

@bedevere-bot
Copy link

The regex '"x86 Debian"' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@markshannon
Copy link
Member Author

!buildbot x86 Debian

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 2ef7ee5 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133450%2Fmerge

The command will test the builders whose names match following regular expression: x86 Debian

The builders matched are:

  • x86 Debian Non-Debug with X PR
  • x86 Debian Installed with X PR

@markshannon markshannon changed the title GH-133261: Make sure trashcan pointer look mortal -- 32 bit GH-133261: Make sure trashcan pointers look mortal -- 32 bit May 5, 2025
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

if (refcnt & 1) {
refcnt += _Py_IMMORTAL_MINIMUM_REFCNT - 1;
}
return (void *)(refcnt - 2);
#else
return (void *)((refcnt -1) << 2);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return (void *)((refcnt -1) << 2);
return (void *)((refcnt - 1) << 2);

@vstinner
Copy link
Member

vstinner commented May 5, 2025

buildbot/x86 Debian Installed with X PR — Build done.
buildbot/x86 Debian Non-Debug with X PR — Build done.

Nice, the fix works as expected, tests passed on two buildbot workers.

@vstinner
Copy link
Member

vstinner commented May 5, 2025

I built Python using CFLAGS=-m32 (on Linux x86-64) but I failed to reproduce the issue.

I built Python in a x86 (32-bit) container, but I failed to reproduce the issue.

But this change looks correct, it should fix the issue, and the buildbots confirmed that the fix works.

@ambv ambv merged commit d48616e into python:main May 5, 2025
48 checks passed
@markshannon markshannon deleted the fix-133261-32bit branch May 6, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants