Message249639
| 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: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 |
|