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 serhiy.storchaka
Recipients eric.snow, rhettinger, serhiy.storchaka, vstinner
Date 2015-09-03.13:57:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441288648.74.0.306711060334.issue24992@psf.upfronthosting.co.za>
In-reply-to
Content
If don't initialize fields, then they will be not initialized in odict_dealloc, odict_tp_clear and odict_traverse. But _odict_FIRST(od) and od->od_weakreflist are used in these functions.

I would allocate a dict for od_inst_dict before calling PyDict_Type.tp_new. An allocator can release GIL and call Python code, and at that moment the OrderedDict object is in inconsistent state. I already were fell in similar trap with lru_cache (issue14373, msg246573).
History
Date User Action Args
2015-09-03 13:57:28serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, eric.snow
2015-09-03 13:57:28serhiy.storchakasetmessageid: <1441288648.74.0.306711060334.issue24992@psf.upfronthosting.co.za>
2015-09-03 13:57:28serhiy.storchakalinkissue24992 messages
2015-09-03 13:57:28serhiy.storchakacreate