#3677: Optimizer creates stack overflow on filtered CAF
----------------------------+-----------------------------------------------
  Reporter:  jpet           |          Owner:  simonpj
      Type:  bug            |         Status:  new    
  Priority:  normal         |      Milestone:  6.12.2 
 Component:  Compiler       |        Version:  6.10.4 
Resolution:                 |       Keywords:         
Difficulty:                 |             Os:  Windows
  Testcase:                 |   Architecture:  x86    
   Failure:  Runtime crash  |  
----------------------------+-----------------------------------------------
Changes (by simonmar):

  * owner:  => simonpj
  * milestone:  6.12 branch => 6.12.2

Comment:

 Fixed the RTS bit:

 {{{
 Wed Nov 25 04:59:17 PST 2009  Simon Marlow <[email protected]>
   * threadStackOverflow: check whether stack squeezing released some stack
 (#3677)

   In a stack overflow situation, stack squeezing may reduce the stack
   size, but we don't know whether it has been reduced enough for the
   stack check to succeed if we try again.  Fortunately stack squeezing
   is idempotent, so all we need to do is record whether *any* squeezing
   happened.  If we are at the stack's absolute -K limit, and stack
   squeezing happened, then we try running the thread again.

   We also want to avoid enlarging the stack if squeezing has already
   released some of it.  However, we don't want to get into a
   pathalogical situation where a thread has a nearly full stack (near
   its current limit, but not near the absolute -K limit), keeps
   allocating a little bit, squeezing removes a little bit, and then it
   runs again.  So to avoid this, if we squeezed *and* there is still
   less than BLOCK_SIZE_W words free, then we enlarge the stack anyway.

     M ./includes/rts/Constants.h +7
     M ./rts/Schedule.c -1 +31
     M ./rts/ThreadPaused.c +5
 }}}

 Ian: please merge.

 Simon PJ will investigate whether any simplifier changes are needed here.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3677#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to