Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 13f6e4c

Browse files
authored
GCStress eventing fix (#28148)
1 parent 882c13b commit 13f6e4c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vm/eventpipe.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,17 @@ bool EventPipe::WalkManagedStackForThread(Thread *pThread, StackContents &stackC
699699

700700
stackContents.Reset();
701701

702+
// Before we call into StackWalkFrames we need to mark GC_ON_TRANSITIONS as FALSE
703+
// because under GCStress runs (GCStress=0x3), a GC will be triggered for every transition,
704+
// which will cause the GC to try to walk the stack while we are in the middle of walking the stack.
705+
bool gcOnTransitions = GC_ON_TRANSITIONS(FALSE);
706+
702707
StackWalkAction swaRet = pThread->StackWalkFrames(
703708
(PSTACKWALKFRAMESCALLBACK)&StackWalkCallback,
704709
&stackContents,
705710
ALLOW_ASYNC_STACK_WALK | FUNCTIONSONLY | HANDLESKIPPEDFRAMES | ALLOW_INVALID_OBJECTS);
706711

712+
GC_ON_TRANSITIONS(gcOnTransitions);
707713
return ((swaRet == SWA_DONE) || (swaRet == SWA_CONTINUE));
708714
}
709715

0 commit comments

Comments
 (0)