Message249639
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). |
|
Date |
User |
Action |
Args |
2015-09-03 13:57:28 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, vstinner, eric.snow |
2015-09-03 13:57:28 | serhiy.storchaka | set | messageid: <1441288648.74.0.306711060334.issue24992@psf.upfronthosting.co.za> |
2015-09-03 13:57:28 | serhiy.storchaka | link | issue24992 messages |
2015-09-03 13:57:28 | serhiy.storchaka | create | |
|