Fix GC of other thread during native frames unwinding
authorJan Vorlicek <janvorli@microsoft.com>
Mon, 27 Apr 2015 00:28:22 +0000 (17:28 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Mon, 27 Apr 2015 00:42:00 +0000 (17:42 -0700)
commitec2354ec577b1fbe591018aa9fff6a769e3d2df4
tree0a60dc3099e270e4d7a69565dce9fe25c8bc32d0
parentd0714eefee86d8bafc5b5388bd4acf89f1f2d2ad
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.
src/vm/exceptionhandling.cpp
src/vm/exceptionhandling.h