summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-03-09 11:20:37 +0100
committerJan Vorlicek <janvorli@microsoft.com>2016-03-09 11:20:37 +0100
commitb219fbbe1fe72b4a44b5247c9a77f9447d34b028 (patch)
tree07f209ca5bebf5e79093abd90b3d841c54163f83
parentfb59dda088e11cdd8350cdadf467f5dc3b1f9abc (diff)
parent76c2dfc6321bff28c90ac48b0f2ca5abb02abe72 (diff)
downloadcoreclr-b219fbbe1fe72b4a44b5247c9a77f9447d34b028.tar.gz
coreclr-b219fbbe1fe72b4a44b5247c9a77f9447d34b028.tar.bz2
coreclr-b219fbbe1fe72b4a44b5247c9a77f9447d34b028.zip
Merge pull request #3595 from janvorli/fix-stack-walk-with-finally
Fix stack walking on Unix in case of finally
-rw-r--r--src/vm/exceptionhandling.h9
-rw-r--r--src/vm/stackwalk.cpp13
2 files changed, 16 insertions, 6 deletions
diff --git a/src/vm/exceptionhandling.h b/src/vm/exceptionhandling.h
index d5dd4807ce..2a8181b08b 100644
--- a/src/vm/exceptionhandling.h
+++ b/src/vm/exceptionhandling.h
@@ -558,7 +558,14 @@ public:
return m_sfCallerOfActualHandlerFrame;
}
- StackFrame GetCallerOfCollapsedActualHandlingFrame()
+ StackFrame GetCallerOfEnclosingClause()
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ return m_EnclosingClauseInfoForGCReporting.GetEnclosingClauseCallerSP();
+ }
+
+ StackFrame GetCallerOfCollapsedEnclosingClause()
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/vm/stackwalk.cpp b/src/vm/stackwalk.cpp
index 7237c4c37d..2250fd517a 100644
--- a/src/vm/stackwalk.cpp
+++ b/src/vm/stackwalk.cpp
@@ -1683,8 +1683,6 @@ StackWalkAction StackFrameIterator::Filter(void)
ProcessFuncletsForGCReporting:
do
{
- fRecheckCurrentFrame = false;
-
// When enumerating GC references for "liveness" reporting, depending upon the architecture,
// the responsibility of who reports what varies:
//
@@ -1745,7 +1743,7 @@ ProcessFuncletsForGCReporting:
// only source of evidence about it.
// This is different from Windows where the full stack is preserved until an exception is fully handled
// and so we can detect it just from walking the stack.
- if (!fSkippingFunclet && (pTracker != NULL))
+ if (!fRecheckCurrentFrame && !fSkippingFunclet && (pTracker != NULL))
{
// The stack walker is not skipping frames now, which means it didn't find a funclet frame that
// would require skipping the current frame. If we find a tracker with caller of actual handling
@@ -1758,14 +1756,14 @@ ProcessFuncletsForGCReporting:
{
if (hasFuncletStarted)
{
- sfFuncletParent = pCurrTracker->GetCallerOfActualHandlingFrame();
+ sfFuncletParent = pCurrTracker->GetCallerOfEnclosingClause();
if (!sfFuncletParent.IsNull() && ExceptionTracker::IsUnwoundToTargetParentFrame(&m_crawl, sfFuncletParent))
{
break;
}
}
- sfFuncletParent = pCurrTracker->GetCallerOfCollapsedActualHandlingFrame();
+ sfFuncletParent = pCurrTracker->GetCallerOfCollapsedEnclosingClause();
if (!sfFuncletParent.IsNull() && ExceptionTracker::IsUnwoundToTargetParentFrame(&m_crawl, sfFuncletParent))
{
break;
@@ -1787,9 +1785,12 @@ ProcessFuncletsForGCReporting:
m_sfFuncletParent = sfFuncletParent;
m_fProcessNonFilterFunclet = true;
m_fDidFuncletReportGCReferences = false;
+ fSkippingFunclet = true;
}
}
#endif // FEATURE_PAL
+
+ fRecheckCurrentFrame = false;
// Do we already have a reference to a funclet parent?
if (!m_sfFuncletParent.IsNull())
{
@@ -1994,6 +1995,7 @@ ProcessFuncletsForGCReporting:
// Since we are in GC reference reporting mode,
// then avoid code duplication and go to
// funclet processing.
+ fRecheckCurrentFrame = true;
goto ProcessFuncletsForGCReporting;
}
}
@@ -2099,6 +2101,7 @@ ProcessFuncletsForGCReporting:
// If we are in GC reference reporting mode,
// then avoid code duplication and go to
// funclet processing.
+ fRecheckCurrentFrame = true;
goto ProcessFuncletsForGCReporting;
}
else