-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Eager task factory segfaults when hosting and calling an API from the same event loop #122332
Labels
3.12
bugs and security fixes
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-asyncio
type-crash
A hard crash of the interpreter, possibly with a core dump
Comments
irgolic
added
the
type-crash
A hard crash of the interpreter, possibly with a core dump
label
Jul 26, 2024
I was able to reproduce this. The segfault comes from |
Ah, I think this is just a missing |
This was referenced Jul 27, 2024
FWIW, here's a reproducer that does not need third party packages: import asyncio
async def main():
loop = asyncio.get_running_loop()
loop.set_task_factory(asyncio.eager_task_factory)
async def foo(): ...
task = asyncio.create_task(foo())
await task
print(task.get_coro())
asyncio.run(main()) |
Eclips4
added
3.12
bugs and security fixes
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
labels
Jul 27, 2024
kumaraditya303
pushed a commit
that referenced
this issue
Jul 27, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 27, 2024
…ythonGH-122338) (cherry picked from commit c086962) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 27, 2024
…ythonGH-122338) (cherry picked from commit c086962) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This was referenced Jul 27, 2024
kumaraditya303
pushed a commit
that referenced
this issue
Jul 27, 2024
…GH-122338) (#122345) gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (GH-122338) (cherry picked from commit c086962) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
kumaraditya303
pushed a commit
that referenced
this issue
Jul 27, 2024
…GH-122338) (#122344) gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (GH-122338) (cherry picked from commit c086962) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Nice, thanks for the fix |
This was referenced Jul 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.12
bugs and security fixes
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-asyncio
type-crash
A hard crash of the interpreter, possibly with a core dump
Crash report
What happened?
Love eager task factory, but it's crashing one of my tests. I'm using
uvicorn
andfastapi
to host an API, and testing it withhttpx
running in the same event loop. This reliably produces a segfault.It seems to only happen with streaming responses.
Here's a minimal code example:
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6 ]
Linked PRs
NULL
check inasyncio.Task.get_coro
#122338NULL
check inasyncio.Task.get_coro
(GH-122338) #122344NULL
check inasyncio.Task.get_coro
(GH-122338) #122345The text was updated successfully, but these errors were encountered: