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-18.10:39:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <43796231.G6sVO9q5QZ@raxxla>
In-reply-to <1445159139.93.0.959224579677.issue25395@psf.upfronthosting.co.za>
Content
Using Py_CLEAR() fixes symptoms in this test, but the real issue is that 
deallocating code is executed twice for some objects (for every 25th 
OrderedDict).

PyDict_Type.tp_dealloc() can deposit an object in the _PyTrash_delete_later 
list if trash_delete_nesting exceeds PyTrash_UNWIND_LEVEL. Later Py_TYPE(op)-
>tp_dealloc is called for objects in the _PyTrash_delete_later list. But this 
is odict_dealloc that already was called.

One of ways to avoid repeated deallocation is to change the type of the object 
before calling PyDict_Type.tp_dealloc(). This looks as a hack, but correct 
hack. May be there is more straightforward solution.
Files
File name Uploaded
odict-trashcan.v3.patch serhiy.storchaka, 2015-10-18.10:39:34
History
Date User Action Args
2015-10-18 10:39:35serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, eric.snow, martin.panter, nagisa
2015-10-18 10:39:35serhiy.storchakalinkissue25395 messages
2015-10-18 10:39:34serhiy.storchakacreate