[GHC] #10445: Wrong stack space size when using -Ksize

GHC ghc-devs at haskell.org
Wed Jun 3 05:52:16 UTC 2015


#10445: Wrong stack space size when using -Ksize
-------------------------------------+-------------------------------------
        Reporter:  asr               |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.10.2
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by archblob):

 * cc: simonmar (added)


Comment:

 I think you are right about GHC 7.6.3 I can't see from the code how this
 worked then.

 I have a patch that validates but I'm not sure if it's the best approach,
 here it goes:
 In https://github.com/ghc/ghc/blob/master/rts/Threads.c#L589, it seems
 that when we allocate a new chunk, the `chunk_size` is always
 `RtsFlags.GcFlags.stkChunkSize` at a minimum even though alone or together
 with the old stack size this will be above the limit set by -K, so the fix
 is that if that limit is set we don't, because we know the max that we are
 allowed to allocate.
 Now what I don't know is if we should always allocate a minimum of
 `stkChunkSize` and why?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10445#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list