New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use-after-free crash if multiple interpreters import asyncio module #84474
Comments
Starting with Python 3.8 (GH-16598), the This scenario is actually fairly easy to encounter in the presence of multiple interpreters whose lifetime is shorter than that of the whole program. Essentially, if any interpreter loads I ran into this in my project because I use multiple interpreters to isolate user scripts, and I started to encounter crashes when switching to Python 3.8. I've attached a simple reproduction program. I've personally tested that this runs without crashing in 3.6 and 3.7 (but I suspect it works down to 3.4 when |
_asyncio should be ported to multiphase initialization (PEP-489) and its types converted to PyType_FromSpec() rather than using statically allocated types. See bpo-1635741. |
Would the simple fix (clearing the flag in |
Sure. |
Is Python 3.7 affected as well? |
Nope, this was introduced in 3.8 |
Ok, the issue is now fixed: thanks Jeffrey Quesnelle!
I tested: attached main.c doesn't crash in 3.7. I guess that _asyncio leaks a few references, but it's not a big deal. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: