[GHC] #14163: Stack Overflow with ApplicativeDo

GHC ghc-devs at haskell.org
Tue Aug 29 15:57:11 UTC 2017


#14163: Stack Overflow with ApplicativeDo
-------------------------------------+-------------------------------------
        Reporter:  lippling          |                Owner:  simonmar
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.2
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  ApplicativeDo
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * priority:  normal => high
 * milestone:   => 8.2.2


Old description:

> I tried to compile one of our server applications with 8.2.1 (which
> compiles fine with 8.0.2).
>
> The compilation runs smoothly, but when it reaches a specific file, the
> RAM usage goes up to > 20GB pretty fast on my 16GB machine and the GHC
> process gets terminated with a stack overflow error.
>
> I tried to find a minimal example that causes this behavior:
>
> {{{
> #!/usr/bin/env stack
> -- stack --resolver nightly-2017-08-25 script
>
> {-# LANGUAGE ApplicativeDo #-}
>
> x = do
>     (a, _) <- undefined
>     (b, _) <- undefined
>     (c, _) <- undefined
>     undefined
>
> main = undefined
> }}}
>
> It only happens with at least 3 of these pattern matches.

New description:

 I tried to compile one of our server applications with 8.2.1 (which
 compiles fine with 8.0.2).

 The compilation runs smoothly, but when it reaches a specific file, the
 RAM usage goes up to > 20GB pretty fast on my 16GB machine and the GHC
 process gets terminated with a stack overflow error.

 I tried to find a minimal example that causes this behavior:

 {{{#!hs
 #!/usr/bin/env stack
 -- stack --resolver nightly-2017-08-25 script

 {-# LANGUAGE ApplicativeDo #-}

 x = do
     (a, _) <- undefined
     (b, _) <- undefined
     (c, _) <- undefined
     undefined

 main = undefined
 }}}

 It only happens with at least 3 of these pattern matches.

--

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


More information about the ghc-tickets mailing list