-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
[3.12] gh-122695: Fix double-free when using gc.get_referents
with a freed _asyncio.FutureIter
#122834
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is wrong. A freelist is not storing objects but just raw memory.
module_traverse() should be modified to not visit the free list.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
(Hit the wrong button when copy-pasting the |
Do you want this in 3.13 as well? |
Nope, this issue only occurs on 3.12. |
3.13 has the same underlying bug: |
It's now just a removal of the traversal, as @vstinner suggested. |
It does? I thought we tried this on 3.13 already. I guess this does go in 3.13 then. |
I think someone confused 3.13 with the main branch (future 3.14 release) |
Will make a PR for 3.13 |
The issue should be fixed in the 3.13 branch and then backported automatically to 3.12. I close this PR in favor of #122837 |
… with a freed `_asyncio.FutureIter` (python#122837) * Backport python#122834 for 3.13 (cherry picked from commit e8fb088)
CC @vstinner, @douglas-raillard-arm
This is a (somewhat hacky) way to do it while keeping items in the freelist returned by
gc.get_referents
. The ideal solution would be to remove the traversal of the freelist all together, but that might be a breaking change (depending on howlisa
relied on it).