You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Eager task factory segfaults when hosting and calling an API from the same event loop #122332
Love eager task factory, but it's crashing one of my tests. I'm using uvicorn and fastapi to host an API, and testing it with httpx running in the same event loop. This reliably produces a segfault.
Ah, I think this is just a missing NULL check. Based on the docs, this should be able to return None. This needs to be reflected in typeshed as well. I'll submit a PR for this.
Activity
ZeroIntensity commentedon Jul 27, 2024
I was able to reproduce this. The segfault comes from
_asyncio_Task_get_coro_impl: see here,self->task_coroisNULL.ZeroIntensity commentedon Jul 27, 2024
Ah, I think this is just a missing
NULLcheck. Based on the docs, this should be able to returnNone. This needs to be reflected in typeshed as well. I'll submit a PR for this.ZeroIntensity commentedon Jul 27, 2024
FWIW, here's a reproducer that does not need third party packages:
gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (#122338)
pythongh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (p…
pythongh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (p…
[3.12] gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (…
[3.13] gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (…
irgolic commentedon Jul 27, 2024
Nice, thanks for the fix