Commit 8adb84fe authored by Simon Marlow's avatar Simon Marlow
Browse files

Fix calculation in threadStackOverflow

Summary:
The calculation was too conservative, and could result in copying zero
frames into the new stack chunk, which caused a knock-on failure in
the interpreter.

Test Plan: Tested on an in-house repro (not shareable, unfortunately)

Reviewers: niteria, bgamari, austin, erikd

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4052
parent 4a677f76
......@@ -640,8 +640,8 @@ threadStackOverflow (Capability *cap, StgTSO *tso)
// if including this frame would exceed the size of the
// new stack (taking into account the underflow frame),
// then stop at the previous frame.
if (sp + size > old_stack->stack + (new_stack->stack_size -
sizeofW(StgUnderflowFrame))) {
if (sp + size > old_stack->sp + (new_stack->stack_size -
sizeofW(StgUnderflowFrame))) {
break;
}
sp += size;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment