Skip to content

Multiprocessing child processes stall during VSCode debugpy breakpoints #1891

@mraesener-aubex

Description

@mraesener-aubex

Environment data

  • debugpy version: 1.8.13
  • OS and version: Windows 11
  • Python version: 3.12+ (python standalone by uv)
  • Using VS Code or Visual Studio: VS Code 1.100.1 (Universal) on macOS tunneled to Windows with same version VS Code

Actual behavior

I have a running child process which draws some rectangles on screen. If I hit a breakpoint in my main process now I can't manually trigger rectangles drawing from the REPL. This isn't working with debugpy and python 3.12+ - it is working though with Python 3.11.12. Outside of VS Code with f.e. pdb.set_trace() it's working in all versions of Python I've tested.

Expected behavior

The child process keeps working and I can manually trigger things.

Steps to reproduce:

minimal example, tested with Python 3.13.3 on Windows and issue persists.

import multiprocessing
import time


def child_process(q):
    while True:
        msg = q.get()
        if msg == "STOP":
            print("Child received STOP command.")
            break
        print(f"Child received: {msg}")
        time.sleep(0.5)


if __name__ == "__main__":
    multiprocessing.freeze_support()

    queue = multiprocessing.Queue()

    child = multiprocessing.Process(target=child_process, args=(queue,))
    child.start()

    for i in range(3):
        queue.put(f"Message {i}")
        time.sleep(1)

    # Set a breakpoint on the next line in VSCode
    queue.put("Message at breakpoint")  # BREAKPOINT HERE
    # execute in REPL at breakpoint queue.put(f"Hello from REPL")
    
    # Try to continue communication after breakpoint
    queue.put("Final message")
    queue.put("STOP")

    child.join()
    print("Parent process complete.")

no launch.json in use, I've just hit the "Debug Python File" icon in VS Code.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds reproIssue has not been reproduced yet

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions