Skip to content

EE - Fix deadlock on thread suspension by GC collection (#115794) #115892

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/vm/syncblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ inline WaitEventLink *ThreadQueue::DequeueThread(SyncBlock *psb)

if (pLink)
{
// Sometimes the SList is corrupted causing the EE to deadlock as referenced in /dotnet/runtime/issues/115794
// When that happens managed threads will remain in a suspended state causing the application to hang
// indefinitely.
// To mitigate this issue, when the next link points to itself, de-reference the next link
// TODO : find which code is responsible for allowing the situation to happen
if ( psb->m_Link.m_pNext == pLink->m_pNext)
pLink->m_pNext = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to investigate the root cause instead of taking this fix as-is since there could be other issues/AVs related to the mangling of the list.


psb->m_Link.m_pNext = pLink->m_pNext;
#ifdef _DEBUG
pLink->m_pNext = (SLink *)POISONC;
Expand Down
Loading