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 Mark.Shannon
Recipients Mark.Shannon, eric.snow, vstinner
Date 2021-11-02.16:04:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635869089.92.0.280577291297.issue45691@roundup.psfhosted.org>
In-reply-to
Content
We currently have an unstable state in the VM where some core objects are static and some are per-interpreter.

For example, smalls ints are allocated per-interpreter, but many classes are allocated statically.
This means that if any int is reachable from a class, then references to per-interpreter objects can be left dangling, or be out of date.

E.g. consider this sequence:
1. Create an interpreter
2. Destroy it.
3. Create a new interpreter

`sys.float_info.n_unnamed_fields` causes a memory violation if the per-interpreter allocated 0 held by sys.float_info.n_unnamed_fields is freed.
If it is not freed, then `sys.float_info.n_unnamed_fields is 0` is False, meaning that there are two zeros present.

The above is just an example. Classes have many references to ints, floats, code  objects, etc. Any of those could have the same issue.

All objects that form the core object graph must either be entirely static, or entirely per-interpreter.

We cannot change from static to per-interpreter in a piecemeal fashion. It must be done all at once.
History
Date User Action Args
2021-11-02 16:04:49Mark.Shannonsetrecipients: + Mark.Shannon, vstinner, eric.snow
2021-11-02 16:04:49Mark.Shannonsetmessageid: <1635869089.92.0.280577291297.issue45691@roundup.psfhosted.org>
2021-11-02 16:04:49Mark.Shannonlinkissue45691 messages
2021-11-02 16:04:49Mark.Shannoncreate