Mailing List Archive

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +20949
pull_request: https://github.com/python/cpython/pull/21818

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 1d541c25c8019f7a0b80b3e1b437abe171e40b65 by Mohamed Koubaa in branch 'master':
bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378)
https://github.com/python/cpython/commit/1d541c25c8019f7a0b80b3e1b437abe171e40b65


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
hai shi <shihai1991@126.com> added the comment:

There will have many unicode strs releaks when we calling `Py_Initialize()` again after `Py_Finalize()`: interned will be cleared in `Py_Finalize()`, but those unicodes str will still alive all the time.

Q: How to solve the probleam?
A: MAYBE we need share the interned of unicodeobject.c all the time and don't care how many times we will calling `Py_Initialize(); Py_Finalize();`

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> There will have many unicode strs releaks when we calling `Py_Initialize()` again after `Py_Finalize()`: interned will be cleared in `Py_Finalize()`, but those unicodes str will still alive all the time.

Py_Finalize() calls _PyUnicode_ClearInterned() which clears interned strings. Which strings are still alive after Py_Finalize()?

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 8ecc0c4d390d03de5cd2344aa44b69ed02ffe470 by Hai Shi in branch 'master':
bpo-1635741: Clean sysdict and builtins of interpreter at exit (GH-21605)
https://github.com/python/cpython/commit/8ecc0c4d390d03de5cd2344aa44b69ed02ffe470


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> Q: How to solve the problem?

Making sure that the "total reference count" is zero after Py_Finalize() is a long term project which requires to solve many subproblems:

* Convert static types to heap types: bpo-40077
* Somehow related, convert extension modules to multiphase initialization (PEP 489): this issue
* Identify remaining global variables and either clear them explicitly, or move them to a structure which is cleared at exit

To convert extension modules to multiphase init, one practical problem is that the PEP 573 doesn't cover slots and a few other corner cases. The PEP 573 should be extended:
https://mail.python.org/archives/list/capi-sig@python.org/thread/6CGIIZVMJRYHWZDJLNWCLPSYYAVRRVCC/

There are likely a bunch of other misc corner cases which should be fixed as well.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
hai shi <shihai1991@126.com> added the comment:

> Py_Finalize() calls _PyUnicode_ClearInterned() which clears interned strings. Which strings are still alive after Py_Finalize()?

Yes.especially those encodings, interpreter leaks much encodings refcount after Py_Finalize(). I am not sure they are corner cases or not.
Maybe we could check it again afer we have done all convert works.

No matter how many times `Py_Initialize(); Py_Finalize();` have called, Holding a same interned of unicodeobject.c all the time sound like a stupied idea.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +20982
pull_request: https://github.com/python/cpython/pull/21855

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +20983
pull_request: https://github.com/python/cpython/pull/21856

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset e087f7cd43dfa4223c55a8ecd71f4a7d685178e4 by Mohamed Koubaa in branch 'master':
bpo-1635741: Port _winapi ext to multi-stage init (GH-21371)
https://github.com/python/cpython/commit/e087f7cd43dfa4223c55a8ecd71f4a7d685178e4


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by hai shi <shihai1991@126.com>:


----------
pull_requests: +21015
pull_request: https://github.com/python/cpython/pull/21896

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by hai shi <shihai1991@126.com>:


----------
pull_requests: +21022
pull_request: https://github.com/python/cpython/pull/21902

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 8aa163eea6b0fb4693f6c0a314d4f2ccada51d70 by Hai Shi in branch 'master':
bpo-1635741: Explict GC collect after PyInterpreterState_Clear() (GH-21902)
https://github.com/python/cpython/commit/8aa163eea6b0fb4693f6c0a314d4f2ccada51d70


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21094
pull_request: https://github.com/python/cpython/pull/21985

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21095
pull_request: https://github.com/python/cpython/pull/21986

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21101
pull_request: https://github.com/python/cpython/pull/21995

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21109
pull_request: https://github.com/python/cpython/pull/22003

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21146
pull_request: https://github.com/python/cpython/pull/22049

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21147
pull_request: https://github.com/python/cpython/pull/22050

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +21148
pull_request: https://github.com/python/cpython/pull/22051

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset a7f026870d2dab7015a94e287bec6dd46cdbf604 by Mohamed Koubaa in branch 'master':
bpo-1635741: Port _blake2 module to multi-phase init (GH-21856)
https://github.com/python/cpython/commit/a7f026870d2dab7015a94e287bec6dd46cdbf604


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 93d50a6a8d0c5d332c11aef267e66573a09765ac by Mohamed Koubaa in branch 'master':
bpo-1635741: Port _sha3 module to multi-phase init (GH-21855)
https://github.com/python/cpython/commit/93d50a6a8d0c5d332c11aef267e66573a09765ac


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

I created bpo-41692: "Deprecate immortal interned strings: PyUnicode_InternImmortal()".

----------
versions: +Python 3.10 -Python 3.9

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 71d1bd9569c8a497e279f2fea6fe47cd70a87ea3 by Mohamed Koubaa in branch 'master':
bpo-1635741: Port _signal module to multi-phase init (PEP 489) (GH-22049)
https://github.com/python/cpython/commit/71d1bd9569c8a497e279f2fea6fe47cd70a87ea3


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> bpo-1635741: Port _signal module to multi-phase init (PEP 489) (GH-22049)

This change is causing new issues: bpo-41713 "_signal module leak: test_interpreters leaked [1424, 1422, 1424] references". So I partially reverted it: PR 22087.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

1 2 3 4 5 6  View All