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 eric.snow, gvanrossum, vstinner
Date 2022-01-21.08:13:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642752816.28.0.292360512111.issue46449@roundup.psfhosted.org>
In-reply-to
Content
> Hm, the deep-frozen objects are statically initialized with a very large refcount that isn't accounted for (they are intended to be immortal). It seems that Py_Finalize() somehow decrefs those objects. I guess this means we need some kind of flag indicating certain objects are immortal (Eric has proposed several schemes), then we could just mark these objects as immortal.

The problem is only _Py_RefTotal. Maybe frozen_only_do_patchups() should increment _Py_RefTotal when Python it build with Py_DEBUG macro defined, so it can be safely decremented in Py_Finalize()?

Adding a flag in PyObject/PyTypeObject and modifying Py_DECREF() sounds more controversial. I suggest to do that later ;-) (I am not convinced that it's the best approach.) I would suggest to write a PEP for immortal objects.
History
Date User Action Args
2022-01-21 08:13:36vstinnersetrecipients: + vstinner, gvanrossum, eric.snow
2022-01-21 08:13:36vstinnersetmessageid: <1642752816.28.0.292360512111.issue46449@roundup.psfhosted.org>
2022-01-21 08:13:36vstinnerlinkissue46449 messages
2022-01-21 08:13:36vstinnercreate