Skip to content

Commit 17c9f05

Browse files
committed
Fix thread hijack starvation issue
1 parent f5c4ef0 commit 17c9f05

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/coreclr/vm/threadsuspend.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4783,7 +4783,16 @@ StackWalkAction SWCB_GetExecutionState(CrawlFrame *pCF, VOID *pData)
47834783
#endif
47844784
}
47854785
#elif defined(TARGET_X86)
4786-
pES->m_ppvRetAddrPtr = (void **) pRDT->PCTAddr;
4786+
if (pRDT->PCTAddr == 0)
4787+
{
4788+
// Initial context doesn't have PCTAddr so we have to compute it
4789+
EECodeInfo codeInfo(pRDT->ControlPC);
4790+
pES->m_ppvRetAddrPtr = (void **) (EECodeManager::GetCallerSp(pRDT) - codeInfo.GetCodeManager()->GetStackParameterSize(&codeInfo) - sizeof(void*));
4791+
}
4792+
else
4793+
{
4794+
pES->m_ppvRetAddrPtr = (void **) pRDT->PCTAddr;
4795+
}
47874796
#elif defined(TARGET_AMD64)
47884797
pES->m_ppvRetAddrPtr = (void **) (EECodeManager::GetCallerSp(pRDT) - sizeof(void*));
47894798
#else // TARGET_X86 || TARGET_AMD64

0 commit comments

Comments
 (0)