Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions src/vm/eventpipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,17 @@ bool EventPipe::WalkManagedStackForThread(Thread *pThread, StackContents &stackC

stackContents.Reset();

// Before we call into StackWalkFrames we need to mark GC_ON_TRANSITIONS as FALSE
// because under GCStress runs (GCStress=0x3), a GC will be triggered for every transition,
// which will cause the GC to try to walk the stack while we are in the middle of walking the stack.
bool gcOnTransitions = GC_ON_TRANSITIONS(FALSE);

StackWalkAction swaRet = pThread->StackWalkFrames(
(PSTACKWALKFRAMESCALLBACK)&StackWalkCallback,
&stackContents,
ALLOW_ASYNC_STACK_WALK | FUNCTIONSONLY | HANDLESKIPPEDFRAMES | ALLOW_INVALID_OBJECTS);

GC_ON_TRANSITIONS(gcOnTransitions);
return ((swaRet == SWA_DONE) || (swaRet == SWA_CONTINUE));
}

Expand Down