#debugpy becomes unresponsive after rapid breakpoint suspend/resume cycles in multithreaded Python programs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với bản tái hiện đa luồng tối thiểu và lần theo việc xử lý breakpoint qua pydevd_sys_monitoring._stop_on_breakpoint và _do_wait_suspend. So sánh Suspend, các yêu cầu Continue nhanh, việc dọn dẹp trạng thái luồng và thứ tự sự kiện DAP qua các chu kỳ lặp lại. Hoàn thành khi phiên vẫn phản hồi và các breakpoint tiếp tục hoạt động bình thường mà không cần khởi động lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
debugpy becomes unresponsive after rapid breakpoint suspend/resume cycles in multithreaded Python programs
Description
I found an issue where the debug session becomes unresponsive after repeatedly hitting a breakpoint and rapidly pressing F5 (Continue/Resume) in a multithreaded Python application.
The issue can be reproduced with a minimal example.
It does not appear to be specific to Python 3.14 free-threading, because the same behavior can also be reproduced on CPython 3.11.9.
The problem appears to be related to repeated breakpoint suspend/resume cycles and thread state handling inside debugpy/pydevd.
Environment
OS:
Windows 11
Debugger:
VS Code Python Debugger extension
debugpy: latest version
Python versions tested:
- CPython 3.11.9
- CPython 3.14.6
- CPython 3.14.6 free-threaded build (python3.14t)
Minimal Reproduction
import threading
import time
def worker():
while True:
x = 1
time.sleep(1) # Put breakpoint here
for i in range(2):
threading.Thread(target=worker).start()
while True:
time.sleep(1)
Steps to Reproduce
- Open the script in VS Code.
- Set a breakpoint on time.sleep(1) inside worker().
- Start debugging with F5.
- When the breakpoint is hit, press F5 (Continue).
- Repeat rapid F5 Continue operations.
- After several suspend/resume cycles, the debugger becomes unresponsive.
Expected Behavior
Breakpoint suspend/resume cycles should continue normally.
Actual Behavior
After several rapid F5 Continue operations:
- VS Code stops updating the current debug location.
- Breakpoints no longer behave normally.
- The debugger UI becomes stuck.
- Restarting the debug session is required.
Technical Observation
Breakpoint handling reaches:
_pydevd_sys_monitoring._stop_on_breakpoint
and:
_do_wait_suspend()
The suspend path is entered successfully.
Possible affected areas:
- pydevd suspend/resume state management
- debugpy adapter DAP event ordering
- handling of rapid continue requests
- multithreaded breakpoint synchronization
Questions
Could this be related to a race condition in debugpy regarding:
- Rapid suspend/resume cycles?
- Multiple threads hitting the same breakpoint?
- Thread state cleanup after continue?
- DAP event ordering?
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 202
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/debugpy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Document "rules"-option Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của microsoft/debugpy
Issue tương tự
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100