Skip to content

gh-130519: Fix crash in QSBR when destructor reenters QSBR #130553

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
Feb 26, 2025

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Feb 25, 2025

The free_work_item() function in QSBR may call arbitrary code via Python object destructors, which may reenter the QSBR code. Reorder the processing of work items to be robust to reentrancy.

Also fix the TODO for the out of memory situation.

The `free_work_item()` function in QSBR may call arbitrary code via
Python object destructors, which may reenter the QSBR code. Reorder
the processing of work items to be robust to reentrancy.

Also fix the TODO for the out of memory situation.
@colesbury
Copy link
Contributor Author

!buildbot Refleaks

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 478e076 🤖

Results will be shown at:

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

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

The builders matched are:

  • aarch64 RHEL8 Refleaks PR
  • s390x RHEL8 Refleaks PR
  • AMD64 RHEL8 Refleaks PR
  • AMD64 FreeBSD Refleaks PR
  • PPC64LE Fedora Stable Refleaks PR
  • PPC64LE CentOS9 Refleaks PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • AMD64 Fedora Stable Refleaks PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • aarch64 Fedora Stable Refleaks PR
  • PPC64LE Fedora Rawhide Refleaks PR
  • AMD64 CentOS9 Refleaks PR
  • PPC64LE RHEL8 Refleaks PR
  • s390x RHEL9 Refleaks PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • AMD64 Windows11 Refleaks PR
  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • AMD64 Fedora Rawhide Refleaks PR
  • aarch64 Fedora Rawhide Refleaks PR
  • aarch64 CentOS9 Refleaks PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR

@colesbury colesbury removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 25, 2025
@colesbury colesbury marked this pull request as ready for review February 25, 2025 18:28
@colesbury colesbury requested a review from DinoV February 25, 2025 18:28
@colesbury colesbury changed the title gh-130519: Fix crash in QSBR when destructor reenter QSBR gh-130519: Fix crash in QSBR when destructor reenters QSBR Feb 26, 2025
Copy link
Contributor

@DinoV DinoV left a comment

Choose a reason for hiding this comment

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

LGTM!

@colesbury colesbury merged commit 45bc120 into python:main Feb 26, 2025
74 of 76 checks passed
@colesbury colesbury deleted the gh-130519-decref branch February 26, 2025 19:55
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…hongh-130553)

The `free_work_item()` function in QSBR may call arbitrary code via
Python object destructors, which may reenter the QSBR code. Reorder
the processing of work items to be robust to reentrancy.

Also fix the TODO for the out of memory situation.
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.

3 participants