Python 3.13 Error Walking Stack w/ PYTHONASYNCIODEBUG=1
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- backend, networking
Research direction
Start by running the provided Docker reproduction from Dockerfile.latest with repro.py under Python 3.13 and PYTHONASYNCIODEBUG=1, then compare it with the environment where the variable is unset. Trace the stack-walking failure involving the async generator and C frames; done means the reproduction exits successfully with debug mode enabled.
Written by the indexing model from the issue text.
Description
There appears to be a bug in uvloop for python 3.13 walking the stack when PYTHONASYNCIODEBUG=1 and there are c frames in the stack.
I suspect this is tied to changes in 3.13 with how python handles frames
To Repro:
Python 3.13
uvloop 0.22.1 (also confirmed it happens
run: docker build -f Dockerfile.latest -t crash-test-latest . 2>&1 | tail -3 && echo "---" && docker run --rm crash-test-latest 2>&1; echo "exit: $?"
exits w/ 139
If you go into the dockerfile and set ENV PYTHONASYNCIODEBUG= (instead of 1), exits w/ 0
Dockerfile:
FROM python:3.13-slim
RUN pip install uvloop==0.22.1
ENV PYTHONASYNCIODEBUG=1
COPY repro.py /repro.py
CMD ["python3", "/repro.py"]
Repro.py
import asyncio
import sys
import os
print(f"Python: {sys.version}")
print(f"Platform: {sys.platform}")
print(f"PYTHONASYNCIODEBUG: {os.environ.get('PYTHONASYNCIODEBUG', '<not set>')}")
import uvloop
print(f"uvloop: {uvloop.__version__}")
async def gen():
yield 1
yield 2
async def main():
x = gen()
await x.__anext__()
# x goes out of scope on function exit
uvloop.install()
asyncio.run(main())
print("NO CRASH")
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 615
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicStack/uvloop
-
License not clear Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#759 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#741 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#702 · 8 comments · 9 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MagicStack/uvloop#766 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
MagicStack/uvloop#765 ·
All issues in MagicStack/uvloop
Similar issues
-
bug customer-eng Durable Agents Inngest status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
integration: elevenlabs
Difficulty 1/5 Under an hour Newbie friendliness 88/100
home-assistant/core#182944 · 1 comment ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·