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.

classification
Title: gc.get_referents can be used to crash Python
Type: crash Stage:
Components: Interpreter Core Versions: Python 3.3, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: abacabadabacaba, amaury.forgeotdarc, georg.brandl, jcea
Priority: normal Keywords:

Created on 2011-07-01 12:43 by abacabadabacaba, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg139572 - (view) Author: Evgeny Kapun (abacabadabacaba) Date: 2011-07-01 12:43
This code crashes Python:

import gc
gc.get_referents(object.__dict__)[0].clear()
gc.get_referents(type.__dict__)[0].clear()
type("A", (), {})()
msg139629 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-07-02 10:10
This looks a lot like the crasher described in Lib/test/crashers/underlying_dict.py

For the record, the similar issue1517663 was closed even though there was a patch, with a comment of the "if it hurts, don't do it" kind.
msg139674 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-07-03 07:51
Yep. It's no surprise that you can crash Python by abusing the gc module, or the ctypes module, or ...
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56674
2011-07-03 07:51:02georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg139674

resolution: wont fix
2011-07-02 11:46:14jceasetnosy: + jcea
2011-07-02 10:10:53amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg139629
2011-07-01 12:43:55abacabadabacabacreate