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, martin.panter, nagisa, rhettinger, serhiy.storchaka, vstinner
Date 2015-10-20.17:42:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445362938.63.0.277727194707.issue25395@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-10-20 17:42:18serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, eric.snow, martin.panter, nagisa
2015-10-20 17:42:18serhiy.storchakasetmessageid: <1445362938.63.0.277727194707.issue25395@psf.upfronthosting.co.za>
2015-10-20 17:42:18serhiy.storchakalinkissue25395 messages
2015-10-20 17:42:18serhiy.storchakacreate