[issue15108] Incomplete tuple created by PyTuple_New() and accessed via the GC can trigged a crash

STINNER Victor report at bugs.python.org
Mon Feb 15 17:40:58 EST 2021


STINNER Victor <vstinner at python.org> added the comment:

> That's a lot slower unfortunately

Ah sorry, I forgot PyTuple_Pack(3, item1, item2, item3) which should be very efficient. This function is also safe: only track the tuple when it is fully initialized.

> This problem also is not unique to tuples, although is mainly prominent in them.

PyList_New() is also affected. Do you think about other types?

PyDict_New() and PySet_New() create empty containers and so are ok.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15108>
_______________________________________


More information about the Python-bugs-list mailing list