Skip to content

Commit 202a401

Browse files
committed
Do not GC stress in preemptive mode
1 parent a510216 commit 202a401

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/coreclr/vm/gccover.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,16 +1417,9 @@ BOOL OnGcCoverageInterrupt(PCONTEXT regs)
14171417
RemoveGcCoverageInterrupt(instrPtr, savedInstrPtr, gcCover, offset);
14181418
return TRUE;
14191419
}
1420-
1421-
// If the thread is in preemptive mode then we must be in a
1422-
// PInvoke stub, a method that has an inline PInvoke frame,
1423-
// or be in a reverse PInvoke stub that's about to return.
1424-
//
1425-
// The PInvoke cases should should properly report GC refs if we
1426-
// trigger GC here. But a reverse PInvoke stub may over-report
1427-
// leading to spurious failures, as we would not normally report
1428-
// anything for this method at this point.
1429-
if (!pThread->PreemptiveGCDisabled() && pMD->HasUnmanagedCallersOnlyAttribute())
1420+
1421+
// The thread is in preemptive mode. Normally, it should not be able to trigger GC.
1422+
if (!pThread->PreemptiveGCDisabled())
14301423
{
14311424
RemoveGcCoverageInterrupt(instrPtr, savedInstrPtr, gcCover, offset);
14321425
return TRUE;

0 commit comments

Comments
 (0)