summaryrefslogtreecommitdiff
path: root/src/vm/stackwalk.cpp
diff options
context:
space:
mode:
authorSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2016-01-27 18:49:14 -0800
committerSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2016-01-28 12:44:55 -0800
commite782a1421a11862251470ad5e497d709fd4eebe0 (patch)
tree9160d74846e2857eeffd7835f045ad65924766c9 /src/vm/stackwalk.cpp
parent2d93d77eaa87db87afbd93ed99e79095d6783020 (diff)
downloadcoreclr-e782a1421a11862251470ad5e497d709fd4eebe0.tar.gz
coreclr-e782a1421a11862251470ad5e497d709fd4eebe0.tar.bz2
coreclr-e782a1421a11862251470ad5e497d709fd4eebe0.zip
Fix an assert failure in GCStress testing
When GCStress uses redirection, it pushes a RedirectedThreadFrame (Windows) or ResumableFrame(Unix) on the stack. The stack walker, when checking for consistency of frame chain makes a special case for this redirection when running under GCStress -- but compares only against `RedirectedThreadFrame'. This caused the StackWalker to think that certain invoke-s were not redirected, resulting in the failures in some GCStress tests on Linux. This change fixes the problem. Fixes #2848
Diffstat (limited to 'src/vm/stackwalk.cpp')
-rw-r--r--src/vm/stackwalk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vm/stackwalk.cpp b/src/vm/stackwalk.cpp
index 446fd84e50..331464186a 100644
--- a/src/vm/stackwalk.cpp
+++ b/src/vm/stackwalk.cpp
@@ -1564,8 +1564,8 @@ BOOL StackFrameIterator::IsValid(void)
// we started?
//DevDiv 168789: In GCStress >= 4 two threads could race on triggering GC;
// if the one that just made p/invoke call is second and hits the trap instruction
- // before call to syncronize with GC, it will push RedirectedThreadFrame concurrently
- // with GC stackwalking.
+ // before call to syncronize with GC, it will push a frame [ResumableFrame on Unix
+ // and RedirectedThreadFrame on Windows] concurrently with GC stackwalking.
// In normal case (no GCStress), after p/invoke, IL_STUB will check if GC is in progress and syncronize.
BOOL bRedirectedPinvoke = FALSE;
@@ -1576,7 +1576,8 @@ BOOL StackFrameIterator::IsValid(void)
(m_pRealStartFrame->GetVTablePtr() == InlinedCallFrame::GetMethodFrameVPtr()) &&
(m_pThread->GetFrame() != NULL) &&
(m_pThread->GetFrame() != FRAME_TOP) &&
- (m_pThread->GetFrame()->GetVTablePtr() == RedirectedThreadFrame::GetMethodFrameVPtr()));
+ ((m_pThread->GetFrame()->GetVTablePtr() == ResumableFrame::GetMethodFrameVPtr()) ||
+ (m_pThread->GetFrame()->GetVTablePtr() == RedirectedThreadFrame::GetMethodFrameVPtr())));
#endif // FEATURE_HIJACK
_ASSERTE( (m_pStartFrame != NULL) ||