Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@ BOOL DacDbiInterfaceImpl::IsThreadAtGCSafePlace(VMPTR_Thread vmThread)
ULONG32 flags = (QUICKUNWIND | HANDLESKIPPEDFRAMES | DISABLE_MISSING_FRAME_DETECTION);

StackFrameIterator iter;
iter.Init(pThread, pThread->GetFrame(), &rd, flags);
iter.Init(pThread, NULL, &rd, flags);

CrawlFrame * pCF = &(iter.m_crawl);
if (pCF->IsFrameless() && pCF->IsActiveFunc())
Expand Down
26 changes: 21 additions & 5 deletions src/coreclr/vm/stackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,25 @@ BOOL StackFrameIterator::Init(Thread * pThread,
// process the REGDISPLAY and stop at the first frame
ProcessIp(GetControlPC(m_crawl.pRD));
#ifdef FEATURE_INTERPRETER
_ASSERTE(!m_crawl.codeInfo.IsInterpretedCode());
if (m_crawl.codeInfo.IsInterpretedCode())
{
// CONTEXT is in interpreted code where the first-arg register holds the owning InterpreterFrame.
// Skip past it so we don't re-enter its frame chain.
PTR_InterpreterFrame pOwning =
dac_cast<PTR_InterpreterFrame>((TADDR)GetFirstArgReg(m_crawl.pRD->pCurrentContext));
_ASSERTE(pOwning != NULL);
_ASSERTE(pOwning->GetFrameIdentifier() == FrameIdentifier::InterpreterFrame);

if (pFrame == NULL)
Comment thread
kotlarmilos marked this conversation as resolved.
{
m_crawl.pFrame = pOwning->PtrNextFrame();
}
else
{
// Explicit pFrame must already be past the owner (callee Frames have lower addresses than their callers).
_ASSERTE(dac_cast<TADDR>(m_crawl.pFrame) > dac_cast<TADDR>(pOwning));
}
}
#endif // FEATURE_INTERPRETER
if (m_crawl.isFrameless && !!(m_crawl.pRD->pCurrentContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE))
{
Expand Down Expand Up @@ -1166,10 +1184,8 @@ BOOL StackFrameIterator::ResetRegDisp(PREGDISPLAY pRegDisp,
#ifdef FEATURE_INTERPRETER
if (m_crawl.codeInfo.IsInterpretedCode())
{
// The CONTEXT carries the owning InterpreterFrame in the first-arg register
// (set by InterpreterFrame::SetContextToInterpMethodContextFrame). Advance
// m_crawl.pFrame past it so the iterator does not re-enter the same
// InterpMethodContextFrame chain via the explicit frame link.
// CONTEXT is in interpreted code where the first-arg register holds the owning InterpreterFrame.
// Skip past it so we don't re-enter its frame chain.
PTR_InterpreterFrame pOwningInterpFrame =
dac_cast<PTR_InterpreterFrame>((TADDR)GetFirstArgReg(m_crawl.pRD->pCurrentContext));
_ASSERTE(pOwningInterpFrame != NULL);
Expand Down
Loading