This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients methane
Date 2018-05-20.07:42:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526802151.18.0.682650639539.issue33583@psf.upfronthosting.co.za>
In-reply-to
Content
https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1750-L1763

PyObject_GC_Resize() calls PyObject_REALLOC(), which can change object's address.
But it doesn't relinking:

 g->gc.gc_prev->gc.gc_next = g
 g->gc.gc_next->gc.gc_prev = g

So this API can't be used for tracked object.
In CPython code, all callers use this API for non tracked objects.

But if some extension module author used this API for tracked objects, it will cause hard to debug behavior.

Which should we do?

1. Add relinking to PyObject_GC_Resize()
2. Add note in the document

If 1, should we backport it to 3.7 and 3.6?
History
Date User Action Args
2018-05-20 07:42:31methanesetrecipients: + methane
2018-05-20 07:42:31methanesetmessageid: <1526802151.18.0.682650639539.issue33583@psf.upfronthosting.co.za>
2018-05-20 07:42:31methanelinkissue33583 messages
2018-05-20 07:42:30methanecreate