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.
Created on 2012年03月05日 12:33 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| type_lookup_mro.patch | vstinner, 2012年03月05日 12:33 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg154943 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年03月05日 12:33 | |
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. |
|||
| msg154990 - (view) | Author: Mark Shannon (Mark.Shannon) * (Python committer) | Date: 2012年03月05日 23:39 | |
Looks good to me. The INCREF/DECREFs are outside of the loops so will have negligible performance impact. |
|||
| msg155186 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月08日 23:39 | |
New changeset 21e245ed3747 by Victor Stinner in branch 'default': Close #14199: _PyType_Lookup() and super_getattro() keep a strong reference to http://hg.python.org/cpython/rev/21e245ed3747 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58407 |
| 2012年03月08日 23:39:09 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg155186 resolution: fixed stage: resolved |
| 2012年03月05日 23:39:00 | Mark.Shannon | set | nosy:
+ Mark.Shannon messages: + msg154990 |
| 2012年03月05日 12:33:27 | vstinner | create | |