[GHC] #14521: Infinite loop at runtime when either : a given function is not marked INLINE, or functions are stored in strict field

GHC ghc-devs at haskell.org
Sat Nov 25 02:11:33 UTC 2017


#14521: Infinite loop at runtime when either : a given function is not marked
INLINE, or functions are stored in strict field
-------------------------------------+-------------------------------------
        Reporter:  OlivierSohn       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.3
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  MacOS X           |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by OlivierSohn):

 Replying to [comment:5 bgamari]:
 > For what it's worth the repo build for me with 8.2.1,
 > {{{
 > $ git clone ​https://github.com/OlivierSohn/hamazed
 > $ cd hamazed
 > $ git checkout 9f25223ef0502f91cd9633654bdb172f714c3920
 > $ git clone https://github.com/OlivierSohn/ansi-terminal.git
 > $ git -C ansi-terminal checkout e6a2b1ff2e1aebd902c1791583b80ef481f370c5
 > $ echo "packages: ., ansi-terminal" >> cabal.project
 > $ cabal new-build all --allow-newer
 > }}}
 > Unfortunately I'm quite lost regarding the game itself. I found that
 pressing "Enter" makes numbers start flying about; however the `s`, `e`,
 `d`, `f` keys don't appear to do anything. This appears to be the case
 with both 8.2.2 and 8.0.2.

 @bgamari, I suppose you are on windows? On windows there is a bug which
 makes it impossible to set stdin buffering mode to "unbuffered" (I explain
 a bit more in BACKLOG.md file, in "Windows" chapter), this explains the
 behaviour you see: when pressing Enter, stdin is flushed. I tried to
 circumvent this problem but didn't finish the fix.

 In the meantime I made a program that allows to reproduce the behaviour
 with minimal code : it is branch
 https://github.com/OlivierSohn/hamazed/tree/repro-ghc-14521-A

 When running the program, the expected output is:

 `
 Before rendering animations
 animation is rendered
 After rendering animations
 `

 What I see with 8.0.2 when compiled with optimizations is:

 `
 Before rendering animations
 `

 I also documented in the code what changes make the problem disappear

 I'd be interested if someone can build with optimizations with 8.2.2 and
 run the program and report on the output ?

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


More information about the ghc-tickets mailing list