Message154943
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. |
|
Date |
User |
Action |
Args |
2012-03-05 12:33:28 | vstinner | set | recipients:
+ vstinner |
2012-03-05 12:33:28 | vstinner | set | messageid: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za> |
2012-03-05 12:33:27 | vstinner | link | issue14199 messages |
2012-03-05 12:33:27 | vstinner | create | |
|