From 098d50176a2521d08efe6fdbab0ede2b7419786a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 17 Nov 2019 11:51:19 -0500 Subject: nonmoving: Drop redundant write barrier on stack underflow 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. --- rts/Threads.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'rts/Threads.c') 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_)); -- cgit v1.2.1