Use holding thread id in AwareLock to avoid orphaned lock crash#107168
Merged
eduardo-vp merged 8 commits intodotnet:mainfrom Dec 10, 2024
Merged
Use holding thread id in AwareLock to avoid orphaned lock crash#107168eduardo-vp merged 8 commits intodotnet:mainfrom
eduardo-vp merged 8 commits intodotnet:mainfrom
Conversation
jkotas
reviewed
Aug 30, 2024
d832f90 to
76fc67d
Compare
kouvel
reviewed
Sep 26, 2024
|
|
||
| ULONG m_Recursion; | ||
| PTR_Thread m_HoldingThread; | ||
| DWORD m_HoldingThreadId; |
Contributor
There was a problem hiding this comment.
It would be nice to remove m_HoldingThread altogether. It would probably need a change to get the Thread pointer from the thread ID in the DAC. Maybe this could be cleaned up in a separate PR, for now at least the field shouldn't be dereferenced.
76fc67d to
9de4e06
Compare
This was referenced Nov 29, 2024
jkotas
reviewed
Nov 30, 2024
This was referenced Dec 2, 2024
kouvel
approved these changes
Dec 10, 2024
Contributor
kouvel
left a comment
There was a problem hiding this comment.
Just a minor comment, otherwise LGTM, thanks!
hez2010
pushed a commit
to hez2010/runtime
that referenced
this pull request
Dec 14, 2024
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In GetThreadOwningMonitorLock, in case there's a sync block, the method only checks for pThread to be equal to NULL to return false, otherwise it assumes pThread actually points to a thread. However, it can be the case that pThread is -1 for orphaned locks and should return false as well (the calling thread doesn't own the lock).
Fixes #44071.