Skip to content

Commit 3f7acd3

Browse files
EE - Cut circularity of singly linked list to mitigate deadlock
Fix dotnet#115794
1 parent 7e7e195 commit 3f7acd3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/coreclr/vm/syncblk.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ inline WaitEventLink *ThreadQueue::DequeueThread(SyncBlock *psb)
237237

238238
if (pLink)
239239
{
240+
// Sometimes the SList is corrupted causing the EE to deadlock as referenced in /dotnet/runtime/issues/115794
241+
// When that happens managed threads will remain in a suspended state causing the application to hang
242+
// indefinitely.
243+
// To mitigate this issue, when the next link points to itself, de-reference the next link
244+
// TODO : find which code is responsible for allowing the situation to happen
245+
if ( psb->m_Link.m_pNext == pLink->m_pNext)
246+
pLink->m_pNext = NULL;
247+
240248
psb->m_Link.m_pNext = pLink->m_pNext;
241249
#ifdef _DEBUG
242250
pLink->m_pNext = (SLink *)POISONC;

0 commit comments

Comments
 (0)