summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-05-18 12:25:05 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-05-18 12:25:05 +0000
commitdaa640e41e5bb964adc385509d97220b96d4ac5e (patch)
tree5e468e802220d6a8a7d6227d49148abcadbce175 /rts
parent1fb4c716c901f08b185439521f91f8cf552797c3 (diff)
downloadhaskell-daa640e41e5bb964adc385509d97220b96d4ac5e.tar.gz
FIX #767 (withMVar family have a bug)
We never want to raise a StackOverflow exception inside Control.Exception.block, because the user has no reasonable way of handling it, and it invalidates some useful guarantees.
Diffstat (limited to 'rts')
-rw-r--r--rts/Schedule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 6063fcdc41..f3d956a990 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)",