summaryrefslogtreecommitdiff
path: root/src/vm/exceptionhandling.h
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2015-04-26 17:28:22 -0700
committerJan Vorlicek <janvorli@microsoft.com>2015-04-26 17:42:00 -0700
commitec2354ec577b1fbe591018aa9fff6a769e3d2df4 (patch)
tree0a60dc3099e270e4d7a69565dce9fe25c8bc32d0 /src/vm/exceptionhandling.h
parentd0714eefee86d8bafc5b5388bd4acf89f1f2d2ad (diff)
downloadcoreclr-ec2354ec577b1fbe591018aa9fff6a769e3d2df4.tar.gz
coreclr-ec2354ec577b1fbe591018aa9fff6a769e3d2df4.tar.bz2
coreclr-ec2354ec577b1fbe591018aa9fff6a769e3d2df4.zip
Fix GC of other thread during native frames unwinding
This change fixes a problem when the GC is attempting to scan a stack of another thread that have just performed the native stack segment unwind, but didn't have a chance to update the exception tracker to reflect the fact that the stack range from m_pInitialExplicitFrame and m_pLimitFrame is in the reclaimed part of the stack and is waiting for the GC to complete (it uses the GCX_COOP). The GC then attempts to scan explicit frames in the already reclaimed part of the stack and crashes. Besides fixing the issue, I have noticed that we are missing GCX_COOP to enter the cooperative mode when unwinding frame chain in the UnwindManagedExceptionPass1. I have also found that we don't have the GCX_COOP in the HandleHardwareException properly scoped. So I have fixed those as well.
Diffstat (limited to 'src/vm/exceptionhandling.h')
-rw-r--r--src/vm/exceptionhandling.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vm/exceptionhandling.h b/src/vm/exceptionhandling.h
index c8581e3b95..72db3576a3 100644
--- a/src/vm/exceptionhandling.h
+++ b/src/vm/exceptionhandling.h
@@ -298,6 +298,13 @@ public:
return m_pInitialExplicitFrame;
}
+ // Reset the range of explicit frames that covers already unwound frames.
+ void ResetUnwoundExplicitFramesRange()
+ {
+ m_pInitialExplicitFrame = NULL;
+ m_pLimitFrame = NULL;
+ }
+
// Determines if we have unwound to the specified parent method frame.
// Currently this is only used for funclet skipping.
static bool IsUnwoundToTargetParentFrame(CrawlFrame * pCF, StackFrame sfParent);