Skip to content

Update retroactive comments from GH-117741 (segfault in FutureIter_dealloc) #121638

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
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Misc/NEWS.d/3.13.0b1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,6 @@ asend().throw()

..

.. date: 2024-04-13-18-59-25
.. gh-issue: 115874
.. nonce: c3xG-E
.. section: Core and Builtins

Fixed a possible segfault during garbage collection of
``_asyncio.FutureIter`` objects

..

.. date: 2024-04-13-16-55-53
.. gh-issue: 117536
.. nonce: xkVbfv
Expand Down Expand Up @@ -883,6 +873,16 @@ Alex Waygood.

..

.. date: 2024-04-13-18-59-25
.. gh-issue: 115874
.. nonce: c3xG-E
.. section: Library

Fixed a possible segfault during garbage collection of
``_asyncio.FutureIter`` objects. Patch by Savannah Ostrowski.

..

.. date: 2024-04-13-01-45-15
.. gh-issue: 115060
.. nonce: IxoM03
Expand Down
3 changes: 0 additions & 3 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,6 @@ FutureIter_dealloc(futureiterobject *it)
{
PyTypeObject *tp = Py_TYPE(it);

// FutureIter is a heap type so any subclass must also be a heap type.
assert(_PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE));
Copy link
Contributor

Choose a reason for hiding this comment

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

Assert is redundant.


PyObject *module = ((PyHeapTypeObject*)tp)->ht_module;
Expand All @@ -1661,8 +1660,6 @@ FutureIter_dealloc(futureiterobject *it)

// GH-115874: We can't use PyType_GetModuleByDef here as the type might have
// already been cleared, which is also why we must check if ht_module != NULL.
// Due to this restriction, subclasses that belong to a different module
// will not be able to use the free list.
if (module && _PyModule_GetDef(module) == &_asynciomodule) {
state = get_asyncio_state(module);
}
Expand Down
Loading