summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-17 11:51:19 -0500
committerBen Gamari <ben@smart-cactus.org>2019-11-17 11:51:19 -0500
commita1fa9bc14e1a9414f7042d98db5d6d5f7f88820a (patch)
treef84a4236dad9074100468a383ad1691be229d047
parentf838b01a34ce972d6d33b64cbaca47bbd189b1ae (diff)
downloadhaskell-wip/T17487.tar.gz
nonmoving: Drop redundant write barrier on stack underflowwip/T17487
Previously we would push stack-carried return values to the new stack on a stack overflow. While the precise reasoning for this barrier is unfortunately lost to history, in hindsight I suspect it was prompted by a missing barrier elsewhere (that has been since fixed). Moreover, there the redundant barrier is actively harmful: the stack may contain non-pointer values; blindly pushing these to the mark queue will result in a crash. This is precisely what happened in the `stack003` test. However, because of a (now fixed) deficiency in the test this crash did not trigger on amd64.
-rw-r--r--rts/Threads.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 8334c5a5ac..8b05dd7c50 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -723,16 +723,6 @@ threadStackUnderflow (Capability *cap, StgTSO *tso)
barf("threadStackUnderflow: not enough space for return values");
}
- IF_NONMOVING_WRITE_BARRIER_ENABLED {
- // ensure that values that we copy into the new stack are marked
- // for the nonmoving collector. Note that these values won't
- // necessarily form a full closure so we need to handle them
- // specially.
- for (unsigned int i = 0; i < retvals; i++) {
- updateRemembSetPushClosure(cap, (StgClosure *) old_stack->sp[i]);
- }
- }
-
memcpy(/* dest */ new_stack->sp - retvals,
/* src */ old_stack->sp,
/* size */ retvals * sizeof(W_));