diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2016-03-02 21:27:00 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2016-03-04 14:28:35 +0900 |
commit | b15c9d4f8a2bdad6dc7ecc03df037783e31d7d0c (patch) | |
tree | 74ca902157851a30265e137c55ec72a9a71ddade /src/pal/src/exception/seh-unwind.cpp | |
parent | 3c0d5e85c59107a4710317f445bec0528cbe232b (diff) | |
download | coreclr-b15c9d4f8a2bdad6dc7ecc03df037783e31d7d0c.tar.gz coreclr-b15c9d4f8a2bdad6dc7ecc03df037783e31d7d0c.tar.bz2 coreclr-b15c9d4f8a2bdad6dc7ecc03df037783e31d7d0c.zip |
Fix PAL_VirtualUnwind Behavior with Clutters in PC
Libunwind-ARM recommends to read LR to get value of PC
while unwinding stack, which often causes the caller
(PAL_VirtualUnwind) to have LSB of PC set.
Such behavior incurs errornous behavior of PAL_VirtualUnwind
if the output is fed back to PAL_VirtualUnwind as the input,
which is observed with VirtualUnwindToFirstManagedCallFrame().
This commit clears LSB of PC in WinContext to prevent it.
Note that this is a partial fix for the issue #3462.
(this does not fix assembly stacks)
Fix #3462
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'src/pal/src/exception/seh-unwind.cpp')
-rw-r--r-- | src/pal/src/exception/seh-unwind.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp index ea17cce29e..333544379a 100644 --- a/src/pal/src/exception/seh-unwind.cpp +++ b/src/pal/src/exception/seh-unwind.cpp @@ -138,6 +138,7 @@ static void UnwindContextToWinContext(unw_cursor_t *cursor, CONTEXT *winContext) #elif defined(_ARM_) unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Sp); unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Pc); + winContext->Pc &= ~0x1; unw_get_reg(cursor, UNW_ARM_R14, (unw_word_t *) &winContext->Lr); unw_get_reg(cursor, UNW_ARM_R4, (unw_word_t *) &winContext->R4); unw_get_reg(cursor, UNW_ARM_R5, (unw_word_t *) &winContext->R5); |