diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 60bb20118e2b25..31e6061d6d4685 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -6188,7 +6188,12 @@ bool IsGcMarker(CONTEXT* pContext, EXCEPTION_RECORD *pExceptionRecord) if (exceptionCode == STATUS_CLR_GCCOVER_CODE) { - if (OnGcCoverageInterrupt(pContext)) + // GCStress processing can disturb last error, so preserve it. + BOOL res; + BEGIN_PRESERVE_LAST_ERROR; + res = OnGcCoverageInterrupt(pContext); + END_PRESERVE_LAST_ERROR; + if (res) { return true; }