Skip to content
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

Regression: multiprocessing "fork" method debugging on macOS #1795

Closed
puremourning opened this issue Jan 4, 2025 · 4 comments
Closed

Regression: multiprocessing "fork" method debugging on macOS #1795

puremourning opened this issue Jan 4, 2025 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet

Comments

@puremourning
Copy link

I just upgraded Vimspector from debugpy 1.8.1 to 1.8.11 and had a regression test failure on macOS.

The test verifies the behaviour of "multiple sessions" support, by launching 2 python processes using the 'fork' method of multiprocessing.

In 1.8.1, I am able to break both processes and independently step through them. In 1.8.11, breakpoints are hit, but stepping in the child process does not work correctly (it appears that it effectively "continues" rather than stops on the next line).

Environment data

  • debugpy version: 1.8.11
  • OS and version: macOS Sonoma 14.6.1 ARM64 (also macOS in Github Actions)
  • Python version (& distribution if applicable, e.g. Anaconda):

ben@BenMBP2021 vimspector % python3 --version
Python 3.13.1

  • Using VS Code or Visual Studio: VSCode (repro above), and Vimspector

Reproduction steps

  1. Open this test file in VSCode: https://github.com/puremourning/vimspector/blob/d18da85844b6e70299fc29d729cd6d26e692c7ec/support/test/python/multiprocessing/multiprocessing_test.py
  2. Set a breakpoint on line 6 (in the Priant function
  3. Launch using the default Python File debug configuration
  4. Switch the "focus" to the 2nd process, the child process which should be paused at line 6
  5. Step over the print statement.

Actual behavior

Stepping from the subprocess does not work correctly, Pressing "step over" moves the execution forward, but to the next iteration (i.e. again to the same file/line at the breakpoint)

Expected behavior

Step over should step to Line 12 (The line after the call to Priant in the subprocess's main thread First).

Please excuse the confusing naming in this test file, I'm not sure what I was thinking, but any trivial multiprocessing test on macOS using the 'fork' or 'forkserver' methods will fail similarly I believe.

Workaround

Use the 'spawn' method. The problem with this is that you get another subprocess and it's not defined what order they will be spawned in.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 4, 2025
@puremourning
Copy link
Author

Repro

Image

@rchiodo
Copy link
Contributor

rchiodo commented Jan 13, 2025

Does this problem occur only in 3.12 and higher? It might be this issue:
#1765

@puremourning
Copy link
Author

I only know it happens on the version above

@rchiodo rchiodo added the duplicate This issue or pull request already exists label Jan 15, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Jan 15, 2025

I'm marking this as a dupe of #1765. the fix for that should ship shortly.

@rchiodo rchiodo closed this as completed Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants