[issue46417] [subinterpreters] Clear static types in Py_Finalize()

STINNER Victor report at bugs.python.org
Tue Jan 18 08:58:57 EST 2022


STINNER Victor <vstinner at python.org> added the comment:

> If we have static types, that means there is a mechanism to share some objects across interpreters.

Sharing objects between interpreters is bad and is causing complex bugs. See a recent example of an object traveling from one interpreter to another and then causing a random crash on Windows related to the garbage collector:

* https://bugs.python.org/issue46070
* https://github.com/python/cpython/pull/30577#pullrequestreview-852106207


> And if that's the case, why can't small ints (like sys.float_info.n_unnamed_fields) be static & shared as well?

I would prefer to discuss that in other issues like bpo-40255 or bpo-39511, and focus this issue on fixing the static types implementation when Python is embedded in an application.

--

Hum, this issue is not really related to sub-interpreters. My proposed PR only  changes Py_Finalize(): the main interpreter.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46417>
_______________________________________


More information about the Python-bugs-list mailing list