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/arm | |
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/arm')
-rw-r--r-- | src/Native/Runtime/arm/ExceptionHandling.asm | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/Native/Runtime/arm/ExceptionHandling.asm b/src/Native/Runtime/arm/ExceptionHandling.asm index 8dea2646c..1cfc89f5b 100644 --- a/src/Native/Runtime/arm/ExceptionHandling.asm +++ b/src/Native/Runtime/arm/ExceptionHandling.asm @@ -26,15 +26,7 @@ PROLOG_NOP mov r2, r0 ;; save exception code into r2 PROLOG_NOP mov r0, sp ;; get SP of fault site - PROLOG_NOP add lr, r1, #2 ;; 'faulting IP' += 2, we do this because everywhere else we treat the - ;; faulting IP as a return-address and optionally subtract one when doing - ;; EH-related things (but not subtracting 2 when doing GC-related things). - ;; The fault IP here will be the start of the faulting instruction, so +2 - ;; will point to either the next instruction or the middle of this - ;; instruction. Either way, when the dispatch / stackwalk code deals with - ;; this address it'll apply a -2 for EH range checks and the GC-related - ;; operations don't need to be precise here because the fault location - ;; isn't a GC safe point + PROLOG_NOP mov lr, r1 ;; set IP of fault site ;; Setup a PAL_LIMITED_CONTEXT on the stack { PROLOG_NOP vpush {d8-d15} |