X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSchedule.c;h=f3d956a99038dbaebd1c00269e0e4e8a220b779a;hb=daa640e41e5bb964adc385509d97220b96d4ac5e;hp=6063fcdc41ebe119edfbf2b3bb7e91b4e9a75489;hpb=cbeb99efd4a117de5b028341dc41bc8f50717383;p=ghc-hetmet.git diff --git a/rts/Schedule.c b/rts/Schedule.c index 6063fcd..f3d956a 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2761,7 +2761,12 @@ threadStackOverflow(Capability *cap, StgTSO *tso) // while we are moving the TSO: lockClosure((StgClosure *)tso); - if (tso->stack_size >= tso->max_stack_size) { + if (tso->stack_size >= tso->max_stack_size && !(tso->flags & TSO_BLOCKEX)) { + // NB. never raise a StackOverflow exception if the thread is + // inside Control.Exceptino.block. It is impractical to protect + // against stack overflow exceptions, since virtually anything + // can raise one (even 'catch'), so this is the only sensible + // thing to do here. See bug #767. debugTrace(DEBUG_gc, "threadStackOverflow of TSO %ld (%p): stack too large (now %ld; max is %ld)",