Fix debugger stepping actions in forked process#1921
Merged
rchiodo merged 4 commits intomicrosoft:mainfrom Jul 8, 2025
Merged
Conversation
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.
rchiodo
approved these changes
Jul 8, 2025
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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. |
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. |
Contributor
Author
|
PR also opened to fix upstream fabioz/PyDev.Debugger#310. |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
rchiodo
approved these changes
Jul 8, 2025
Contributor
|
Thanks for the fix @jborean93 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.