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 Anthony Sottile, ammar2, christian.heimes, erlendaasland, miss-islington, pablogsal, paul.moore, shreyanavigyan, stestagg, steve.dower, tim.golden, vstinner, zach.ware
Date 2021-05-21.17:25:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621617906.8.0.114936051034.issue44184@roundup.psfhosted.org>
In-reply-to
Content
Anthony Sottile: I'm surprised that AST nodes survive until the last GC collection. It seems like somehow a reference cycle prevent to delete these nodes, and this reference cycle is kept alive somehow until the last GC collection at Python exit.

It would be interesting to follow references. You may start from PyInterpreterState which keeps objects alive until the last GC collection:

* os.register_at_fork() callbacks
* codecs.register() callback
* Python audit hooks
* sys.modules objects
* sys.__dict__

Callbacks keep global variables of a module alive through its __globals__ attribute (namespace of the module where it's defined).
History
Date User Action Args
2021-05-21 17:25:06vstinnersetrecipients: + vstinner, paul.moore, christian.heimes, tim.golden, zach.ware, steve.dower, Anthony Sottile, ammar2, pablogsal, miss-islington, erlendaasland, stestagg, shreyanavigyan
2021-05-21 17:25:06vstinnersetmessageid: <1621617906.8.0.114936051034.issue44184@roundup.psfhosted.org>
2021-05-21 17:25:06vstinnerlinkissue44184 messages
2021-05-21 17:25:06vstinnercreate