From 48c3d271fe14380000f81f21e03bf7d77b9af16f Mon Sep 17 00:00:00 2001 From: Simon Marlow <marlowsd@gmail.com> Date: Thu, 12 Apr 2012 11:41:17 +0100 Subject: [PATCH] Fix crash with tiny initial stack size (#5993) MERGED from commit 5eabdc1675b8b5bc9fcdfb96ab63d14d42ca2d5b --- rts/Threads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rts/Threads.c b/rts/Threads.c index fc520c6a93fb..3aed45b1a1f2 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -66,8 +66,8 @@ createThread(Capability *cap, nat size) /* sched_mutex is *not* required */ /* catch ridiculously small stack sizes */ - if (size < MIN_STACK_WORDS + sizeofW(StgStack)) { - size = MIN_STACK_WORDS + sizeofW(StgStack); + if (size < MIN_STACK_WORDS + sizeofW(StgStack) + sizeofW(StgTSO)) { + size = MIN_STACK_WORDS + sizeofW(StgStack) + sizeofW(StgTSO); } /* The size argument we are given includes all the per-thread -- GitLab