Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-10-15 03:14:48 +0300
committerJan Vorlicek <janvorli@microsoft.com>2016-10-15 03:14:48 +0300
commitac86af644210e430abfa081b1540b2f95d66c70b (patch)
tree484eced1fbed6ac20ca1988eeea1c58e6bf4e7dc /src/Native/Runtime/arm
parentdb1ee9611ddb179f88c3f4c5bd47f419c7eabe5f (diff)
This change ensures that the m_pHackInvokeTunnel is not modified on ARM when RhpLoopHijack is called in a call chain of RhpGcStressProbe. This can happen during GC stress when GC calls GCToEEInterface::GcStartWork, which calls RestrictedCallouts::InvokeGcCallouts and that calls managed System::Runtime::InteropServices::RCWWalker.OnGCStarted, where there is a loop with with injected RhpLoopHijack down the call chain.
[tfs-changeset: 1633416]
Diffstat (limited to 'src/Native/Runtime/arm')
-rw-r--r--src/Native/Runtime/arm/GcProbe.asm9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Native/Runtime/arm/GcProbe.asm b/src/Native/Runtime/arm/GcProbe.asm
index 1e7557f04..4bb8bee8f 100644
--- a/src/Native/Runtime/arm/GcProbe.asm
+++ b/src/Native/Runtime/arm/GcProbe.asm
@@ -97,9 +97,6 @@ PROBE_FRAME_SIZE field 0
str $trashReg, [sp, #m_dwFlags]
add $trashReg, sp, #$frameSize
str $trashReg, [sp, #m_CallersSP]
-
- ; Link the frame into the Thread.
- str sp, [$threadReg, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
MEND
;; Simple macro to use when setting up the probe frame can comprise the entire prolog. Call this macro
@@ -132,6 +129,7 @@ __PPF_ThreadReg SETS "r2"
; Perform the rest of the PInvokeTransitionFrame initialization.
INIT_PROBE_FRAME $__PPF_ThreadReg, $trashReg, $BITMASK, PROBE_FRAME_SIZE
+ str sp, [$__PPF_ThreadReg, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
MEND
; Simple macro to use when PROLOG_PROBE_FRAME was used to set up and initialize the prolog and
@@ -506,6 +504,7 @@ DREG_SZ equ (SIZEOF__PAL_LIMITED_CONTEXT - (OFFSETOF__PAL_LIMITED_CONTEXT__L
; TRASHES r1
INIT_PROBE_FRAME r2, r1, #PROBE_SAVE_FLAGS_R0_IS_GCREF, (PROBE_FRAME_SIZE + 8)
+ str sp, [r2, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
MEND
;;
@@ -669,7 +668,7 @@ VFP_EXTRA_SAVE_SIZE equ ((12*8) + (16*8))
bne DoneWaitingForGc
; link the frame into the Thread
- str sp,[r4, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
+ str sp, [r4, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
;;
;; Unhijack this thread, if necessary.
@@ -694,7 +693,7 @@ VFP_EXTRA_SAVE_SIZE equ ((12*8) + (16*8))
NoGcStress
#endif ;; FEATURE_GC_STRESS
- ldr r2, [r4, #OFFSETOF__Thread__m_pHackPInvokeTunnel]
+ mov r2, sp ; sp is address of PInvokeTransitionFrame
bl RhpWaitForGC
DoneWaitingForGc