Skip to content

Commit a5d6473

Browse files
authored
Fix the amd64 cross-DAC stack unwinding (#114836)
* Move m_Context to the end of SoftwareExceptionFrame to fix cross-DAC * Add comments and fix FaultingExceptionFrame on amd64 * Fix debug assert in DBI * Back out FaultingExceptionFrame changes
1 parent 8628d39 commit a5d6473

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/coreclr/debug/ee/debugger.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -2774,6 +2774,13 @@ DebuggerMethodInfo *Debugger::GetOrCreateMethodInfo(Module *pModule, mdMethodDef
27742774
}
27752775
CONTRACTL_END;
27762776

2777+
#ifdef DACCESS_COMPILE
2778+
if (!HasLazyData())
2779+
{
2780+
return NULL;
2781+
}
2782+
#endif // #ifdef DACCESS_COMPILE
2783+
27772784
DebuggerMethodInfo *info = NULL;
27782785

27792786
// When dump debugging, we don't expect to have a lock,

src/coreclr/vm/frames.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,10 @@ typedef DPTR(class SoftwareExceptionFrame) PTR_SoftwareExceptionFrame;
10411041
class SoftwareExceptionFrame : public Frame
10421042
{
10431043
TADDR m_ReturnAddress;
1044-
T_CONTEXT m_Context;
10451044
T_KNONVOLATILE_CONTEXT_POINTERS m_ContextPointers;
1045+
// This T_CONTEXT field needs to be the last field in the class because it is a
1046+
// different size between Linux (pal.h) and the Windows cross-DAC (winnt.h).
1047+
T_CONTEXT m_Context;
10461048

10471049
public:
10481050
#ifndef DACCESS_COMPILE

0 commit comments

Comments
 (0)