Avoid setting @tc in thread_begin event#727
Merged
ko1 merged 1 commit intoruby:masterfrom Aug 10, 2022
Merged
Conversation
Collaborator
|
00ec229 |
Collaborator
|
Could you add a test program or repro- small code? |
Collaborator
|
I'm not sure the issue and why the patch solves yet.
In this case, there is no issue. Could you describe what's happens? |
Collaborator
|
ah, https://github.com/ruby/debug/blob/master/lib/debug/session.rb#L1537 this comparison requires |
Collaborator
|
Another threads can resume by some events so that current code is unstable for that even if the patch is merged. |
This event will be triggered before the new thread even has a ThreadClient. So in this case, the @tc will be overridden to just nil, which is wrong. However, we also don't want to just set @tc to the new thread's newly created ThreadClient. This is because a thread's creation can happen during a subsession, and promptly switching @tc to another thread's ThreadClient will misfire thread suspension.
Member
Author
|
I've added a test that'd hang and timeout on master. |
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.
This event will be triggered before the new thread even has a
ThreadClient. So in this case, the@tcwill be overridden to justnil,which is wrong.
However, we also don't want to just set
@tcto the new thread's newly createdThreadClient. This is because a thread's creation can happen during a subsession, and promptly switching@tcto another thread'sThreadClientwill misfire thread suspension.Fixes #725