Skip to content

Conversation

@jborean93
Copy link
Contributor

Fix the debugger stepping state when debugging a process that has been forked from the main process. The new sys.monitoring mechanism didn't fully clear the thread local storage after a fork leading to a state where the forked child process tracked the wrong thread information and was never updated on the latest continue action.

Fixes: #1876

I'm not sure what the common practice is for updating the Cython/c files. The diff is pretty large but that's mostly due to line and auto formatting changes that my Cython seems to do. Happy to take them out and let you update those files if you prefer.

Fix the debugger stepping state when debugging a process that has been
forked from the main process. The new sys.monitoring mechanism didn't
fully clear the thread local storage after a fork leading to a state
where the forked child process tracked the wrong thread information and
was never updated on the latest continue action.
@jborean93 jborean93 requested a review from a team as a code owner July 8, 2025 00:11
@rchiodo
Copy link
Contributor

rchiodo commented Jul 8, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jborean93
Copy link
Contributor Author

Not sure why that test failed, I'm assuming it's just a bit flaky. I've pushed a commit that adds a test for this scenario as well.

@jborean93
Copy link
Contributor Author

I'll push one more commit to hopefully reduce the diff, looks like Cython's auto generated .c files have trailing spaces so I'll temporarily stop my editor from removing them to avoid troubles in the future.

@jborean93
Copy link
Contributor Author

PR also opened to fix upstream fabioz/PyDev.Debugger#310.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 8, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rchiodo rchiodo merged commit ea1dd9a into microsoft:main Jul 8, 2025
24 checks passed
@rchiodo
Copy link
Contributor

rchiodo commented Jul 8, 2025

Thanks for the fix @jborean93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step Over, Step Into, not working when debugging Subprocesses

2 participants