Author vstinner
Recipients nascheme, pablogsal, serhiy.storchaka, tim.peters, twouters, vstinner
Date 2019-10-07.12:06:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570449967.12.0.263946945781.issue38392@roundup.psfhosted.org>
In-reply-to
Content
> It could be possible to do this in backward compatible way. PyObject_GC_Track() could add the object to the list of new objects (all objects are already linked in bi-linked list, so it would need to just move the object to the specified list), and PyObject_GC_NewVar() could check all new objects and clear the list of new objects (just move the head).

That's different than what I'm proposing here. Checking "later" is more on the bpo-36389 side: my bpo-36389 PR modified PyObject_GC_NewVar() to check that young object are valid.

Moreover, my bpo-36389 PR required threshold: checking all young objects at each PyObject_GC_NewVar() simply killed performance which made the whole approach unusable in practice. Because of the threshold, my implementation failed to detect the hamt.c bug bpo-33803: the partially initialized was already fully initialized when my "object debugger" ran. PR 16615 detects immediately the hamt.c bug bpo-33803.

I designed bpo-36389 to attempt to detect when an object is corrupted after its creation, corrupted by code running "later".

We had a customer with a bug in OpenStack Nova. Nova crashed in visit_decref() but I failed to debug the issue. It motivated me to modify the debug ABI in Python 3.8, so later it will become possible to switch from release to debug mode to attempt to debug a program using additional checks added by the debug build.

Here my intent is to ensure that objects entering the GC are valid to help to keep the GC list consistent and valid. But it doesn't prevent an object from being corrupted after its creation. We should try to find a different approach for that (maybe revisit bpo-36389).
History
Date User Action Args
2019-10-07 12:06:07vstinnersetrecipients: + vstinner, tim.peters, twouters, nascheme, serhiy.storchaka, pablogsal
2019-10-07 12:06:07vstinnersetmessageid: <1570449967.12.0.263946945781.issue38392@roundup.psfhosted.org>
2019-10-07 12:06:07vstinnerlinkissue38392 messages
2019-10-07 12:06:06vstinnercreate