[issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid

2021-06-28 Thread STINNER Victor
STINNER Victor added the comment: Attached gc_track.patch: my latest attempt to implement this idea. -- Added file: https://bugs.python.org/file50130/gc_track.patch ___ Python tracker ___

[issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid

2021-06-28 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-44531 "Add _PyType_AllocNoTrack() function: allocate without tracking in the GC". -- ___ Python tracker ___ __

[issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid

2021-06-28 Thread STINNER Victor
STINNER Victor added the comment: PyType_GenericAlloc() cannot traverse the object since the object members are not initialized yet. For example, dict_traverse() can only be called when PyDict_New() completes. A different approach would be to: * (1) Add PyType_AllocNoTrack(), use it in buil

[issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid

2020-05-14 Thread STINNER Victor
STINNER Victor added the comment: While it might be doable, I don't have the bandwidth to investigate this issue and so I prefer to close it as out of date. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracke

[issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid

2020-04-01 Thread STINNER Victor
New submission from STINNER Victor : In bpo-38392, I modified PyObject_GC_Track() to ensure that the object newly tracked is valid: call its traverse function. => commit 1b1845569539db5c1a6948a5d32daea381f1e35f I propose to now also attempt to implement the same check in _PyObject_GC_TRACK()