[GHC] #14758: Retainer profiler can overflow the C stack

GHC ghc-devs at haskell.org
Wed Dec 5 16:48:10 UTC 2018


#14758: Retainer profiler can overflow the C stack
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  qnikst
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.3
       Component:  Profiling         |              Version:  8.6.1
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15287            |  Differential Rev(s):  Phab:D5351
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ömer Sinan Ağacan <omeragacan@…>):

 In [changeset:"5f1d949ab9e09b8d95319633854b7959df06eb58/ghc" 5f1d949/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="5f1d949ab9e09b8d95319633854b7959df06eb58"
 Remove explicit recursion in retainer profiling (fixes #14758)

 Retainer profiling contained a recursion that under
 certain circumstances could lead to the stack overflow
 in C code.

 The idea of the improvement is to keep an explicit stack for the
 object, more precise to reuse existing stack, but allow new type of
 objects to be stored there.

 There is no reliable reproducer that is not a big program
 but in some cases foldr (+) 0 [1..10000000] can work.

 Reviewers: bgamari, simonmar, erikd, osa1

 Reviewed By: bgamari, osa1

 Subscribers: osa1, rwbarton, carter

 GHC Trac Issues: #14758

 Differential Revision: https://phabricator.haskell.org/D5351
 }}}

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


More information about the ghc-tickets mailing list