Message253237
There is a problem with odict-trashcan.v3.patch. PyDict_Type.tp_dealloc() can put the object to the freelist if it's type is dict. Since odict_dealloc() fakes object's type, it alows deallocated OrderedDict to be later used as dict. But the size of OrderedDict object is larger than the size of plain dict, this creates a leak.
odict-trashcan.v2.patch is not good too. I found new test that crashes with it.
Here is a patch that solves all known issues with OrderedDict deallocation. Please correct my wording in the comment if needed. Similar bad scenario is described in the comment at the end of subtype_dealloc() in Objects/typeobject.c, but the patch uses different method to solve this. |
|
Date |
User |
Action |
Args |
2015-10-20 17:42:18 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, vstinner, eric.snow, martin.panter, nagisa |
2015-10-20 17:42:18 | serhiy.storchaka | set | messageid: <1445362938.63.0.277727194707.issue25395@psf.upfronthosting.co.za> |
2015-10-20 17:42:18 | serhiy.storchaka | link | issue25395 messages |
2015-10-20 17:42:18 | serhiy.storchaka | create | |
|