[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-24 Thread kryheb
kryheb added the comment: Thanks vstinner for your help and for taking care of this case! -- ___ Python tracker ___ ___

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: Thanks kryheb for your bug report, reproducer and your fix! The bug should now be fixed in 3.9, 3.10 and main branches. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 5ed7827b1620f5b3729bc9767158d24a33863fa9 by Victor Stinner in branch '3.9': bpo-1: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26878) https://github.com/python/cpython/commit/5ed7827b1620f5b3729bc9767158d24a33863fa9

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset ece3841d3ddf38875b997eb919488cbb911a66e2 by Victor Stinner in branch '3.10': bpo-1: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877) https://github.com/python/cpython/commit/ece3841d3ddf38875b997eb919488cbb911a66e2

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +25454 pull_request: https://github.com/python/cpython/pull/26878 ___ Python tracker ___

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +25453 pull_request: https://github.com/python/cpython/pull/26877 ___ Python tracker ___

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 489699ca05bed5cfd10e847d8580840812b476cd by Victor Stinner in branch 'main': bpo-1: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) https://github.com/python/cpython/commit/489699ca05bed5cfd10e847d8580840812b476cd --

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: Oh, I didn't notice your PR 26767 fix! Thanks. I wrote PR 26874 which includes the same fix, but adds also a regression test. -- ___ Python tracker

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
STINNER Victor added the comment: Thanks for inittab-bug_no-threads.c reproducer. I managed to reproduce the issue and I wrote PR 26767 to fix with a regression test. -- ___ Python tracker

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +25449 pull_request: https://github.com/python/cpython/pull/26874 ___ Python tracker ___

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-23 Thread kryheb
kryheb added the comment: Hi vstinner, I apologize for the inaccurate code sample. Please find a simplified example without threads `inittab-bug_no-threads.c` in attachments. Please notice that __main__.py has changed, there is no infinite loop anymore. Steps to reproduce: 1. Append

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-21 Thread STINNER Victor
STINNER Victor added the comment: inittab-bug.c uses the Python C API in 3 threads: * Thread A (init_proc) calls Py_InitializeFromConfig() * Thread B (run_proc) calls Py_RunMain() * The main thread (main) calls Py_FinalizeEx() Problem: the thread B (run_proc) doesn't hold the GIL and so I

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread kryheb
Change by kryheb : -- keywords: +patch pull_requests: +25353 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26767 ___ Python tracker ___

[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread kryheb
New submission from kryheb : Hi all, I observed misbehavior trying to embed the Python interpreter into a C app. It seems that after re-initialization, PyImport_Inittab is malformed and points to the memory freed _PyImport_Fini2. Steps to reproduce: 1. Append embedded module 2. Initialize