New submission from Gregory Szorc <gregory.sz...@gmail.com>:

Most of CPython's extensions can be initialized and freed multiple times in the 
same process. However, _asyncio crashes on at least CPython 3.8.2 when this is 
done.

STR:

1. Create a new Python interpreter
2. Have it import _asyncio
3. Finalize that interpreter.
4. Create a new Python interpreter
5. Have it import _asyncio

There are probably STR in pure Python by forcing _imp.create_dynamic() to run 
multiple times after the module is unloaded.

The crash occurs due to unchecked NULL access in `Py_INCREF(all_tasks);` in 
`PyInit__asyncio()`.

I think the underlying problem is module_init() is short-circuiting because 
`module_initialized` is set. And `module_initialized` is set on subsequent 
module loads because `module_free()` isn't clearing it.

----------
components: asyncio
messages: 367483
nosy: asvetlov, indygreg, yselivanov
priority: normal
severity: normal
status: open
title: _asyncio extensions crashes if initialized multiple times in same process
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to