Skip to content
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
Fix stack overflow handling issue in GC stress
This change fixes a problem when in GC stress mode 3, GC started to run
on the thread that hit stack overflow due to the GCX_PREEMP in
DebuggerRCThread::DoFavor that is called from the
EEPolicy::HandleFatalStackOverflow. It was causing failures in the CI.
The issue is GC stress specific, the GCX_PREEMP would not start running
GC on the current thread in regular cases.

The fix is to inhibit GC stress in the HandleFatalStackOverflow.
  • Loading branch information
janvorli committed Aug 2, 2021
commit 071688f28a62c541ab0e3e41fb90585ca687ca04
4 changes: 4 additions & 0 deletions src/coreclr/vm/eepolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE

WRAPPER_NO_CONTRACT;

// Disable GC stress triggering GC at this point, we don't want the GC to start running
// on this thread when we have only a very limited space left on the stack
GCStressPolicy::InhibitHolder iholder;

STRESS_LOG0(LF_EH, LL_INFO100, "In EEPolicy::HandleFatalStackOverflow\n");

FrameWithCookie<FaultingExceptionFrame> fef;
Expand Down