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 vstinner
Recipients vstinner
Date 2012-03-05.12:33:26
SpamBayes Score 1.3416846e-07
Marked as misclassified No
Message-id <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za>
In-reply-to
Content
Lib/test/crashers/losing_mro_ref.py does crash Python: _PyType_Lookup() borrows a reference to the type MRO, but the type MRO is replaced during the lookup. Python crashs because it reads an item from a tuple that was destroyed (in the specific test, it reads an item from a newly created tuple which is not the type MRO).

Attached patch keeps a strong reference to the type MRO during the lookup to workaround this crasher. It fixes Lib/test/crashers/losing_mro_ref.py.

If changing temporary has an impact on performances, a guard can be used to check that the type MRO has not been changed during the lookup.
History
Date User Action Args
2012-03-05 12:33:28vstinnersetrecipients: + vstinner
2012-03-05 12:33:28vstinnersetmessageid: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za>
2012-03-05 12:33:27vstinnerlinkissue14199 messages
2012-03-05 12:33:27vstinnercreate