You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug in PyObject_CopyData leads to incorrect data copying order #143737
Guessing this is an off by one error given _Py_add_one_to_index_C is called before the first memcpy. Would love to see a repro, which should be straightforward to produce @buxingtan.
Please show us a reproducible issue with clear expectations.
Sorry, after further debugging and analysis, I've realized that the _Py_add_one_to_index_C function eventually cycles the index back to the start position, ensuring that all data is copied completely. So this is not actually a bug - it's just an unconventional copy order.
Guessing this is an off by one error given _Py_add_one_to_index_C is called before the first memcpy. Would love to see a repro, which should be straightforward to produce @buxingtan.
copy order is 1->2->...->N->0, so it can ensure copy completely.
Closing as not a bug then. One reason why we cycle back is perhaps because of overlapped or other intricate stuff. Or because of some internal pointer arithmetic.
Activity
picnixz commentedon Jan 12, 2026
Please show us a reproducible issue with clear expectations.
a12k commentedon Jan 12, 2026
Guessing this is an off by one error given
_Py_add_one_to_index_Cis called before the firstmemcpy. Would love to see a repro, which should be straightforward to produce @buxingtan.buxingtan commentedon Jan 13, 2026
Sorry, after further debugging and analysis, I've realized that the _Py_add_one_to_index_C function eventually cycles the index back to the start position, ensuring that all data is copied completely. So this is not actually a bug - it's just an unconventional copy order.
buxingtan commentedon Jan 13, 2026
copy order is 1->2->...->N->0, so it can ensure copy completely.
picnixz commentedon Jan 13, 2026
Closing as
not a bugthen. One reason why we cycle back is perhaps because of overlapped or other intricate stuff. Or because of some internal pointer arithmetic.