diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-01-25 04:45:59 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-01-25 04:45:59 +0300 |
commit | 9271b7edd05f4f10dd25d8ab7a8402cd1e4a89cd (patch) | |
tree | 477972b5437e60dd5979a9a22cf02ddefd0f1ed1 /src/Native/Runtime/StackFrameIterator.h | |
parent | 30fc995b02807f7863cd6dde5d4944dc7ce7d0f2 (diff) |
Change stackwalking to always use unadjusted IP
Handling of hardware exceptions had a hack to add +1 to the actual instruction IP. Windows x64 unwinder
is disassembling instructions at the IP passed in to detect method epilogs. If the bytes at IP + 1
happened to match the epilog pattern, the unwind is done as if we were in the middle of the epilog that
lead to spectacular crash.
This change is moving this adjustment to be done later for EH related things only, and not interfere
with stackwalking.
Fixes #2535
[tfs-changeset: 1645602]
Diffstat (limited to 'src/Native/Runtime/StackFrameIterator.h')
-rw-r--r-- | src/Native/Runtime/StackFrameIterator.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Native/Runtime/StackFrameIterator.h b/src/Native/Runtime/StackFrameIterator.h index 5eaf04858..214a7aed6 100644 --- a/src/Native/Runtime/StackFrameIterator.h +++ b/src/Native/Runtime/StackFrameIterator.h @@ -8,7 +8,7 @@ typedef DPTR(ExInfo) PTR_ExInfo; enum ExKind : UInt8 { EK_HardwareFault = 2, - EK_SuperscededFlag = 8, + EK_SupersededFlag = 8, }; struct EHEnum @@ -17,7 +17,7 @@ struct EHEnum EHEnumState m_state; }; -EXTERN_C Boolean FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx); +EXTERN_C Boolean FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx, Boolean instructionFault); EXTERN_C Boolean FASTCALL RhpSfiNext(StackFrameIterator* pThis, UInt32* puExCollideClauseIdx, Boolean* pfUnwoundReversePInvoke); struct PInvokeTransitionFrame; @@ -27,7 +27,7 @@ typedef DPTR(PAL_LIMITED_CONTEXT) PTR_PAL_LIMITED_CONTEXT; class StackFrameIterator { friend class AsmOffsets; - friend Boolean FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx); + friend Boolean FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx, Boolean instructionFault); friend Boolean FASTCALL RhpSfiNext(StackFrameIterator* pThis, UInt32* puExCollideClauseIdx, Boolean* pfUnwoundReversePInvoke); public: @@ -76,7 +76,7 @@ private: void InternalInit(Thread * pThreadToWalk, PTR_PInvokeTransitionFrame pFrame, UInt32 dwFlags); // GC stackwalk void InternalInit(Thread * pThreadToWalk, PTR_PAL_LIMITED_CONTEXT pCtx, UInt32 dwFlags); // EH and hijack stackwalk, and collided unwind - void InternalInitForEH(Thread * pThreadToWalk, PAL_LIMITED_CONTEXT * pCtx); // EH stackwalk + void InternalInitForEH(Thread * pThreadToWalk, PAL_LIMITED_CONTEXT * pCtx, bool instructionFault); // EH stackwalk void InternalInitForStackTrace(); // Environment.StackTrace PTR_VOID HandleExCollide(PTR_ExInfo pExInfo); |