Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compiler bug?] Infinite loop #1

Closed
OlivierSohn opened this issue Nov 24, 2017 · 1 comment
Closed

[Compiler bug?] Infinite loop #1

OlivierSohn opened this issue Nov 24, 2017 · 1 comment

Comments

@OlivierSohn
Copy link
Owner

OlivierSohn commented Nov 24, 2017

When compiling on OSX with optimizations (stack clean && stack build with resolver lts-9.12 (ghc 8.0.2)), the program loops infinitely (400% CPU, and execution is blocked) when an animation is triggered.

The bug is visible at this commit : 9f25223 (to reproduce, shoot at a number in the game)

This branch reproduces the problem with a minimal amount of code:
https://github.com/OlivierSohn/hamazed/tree/repro-ghc-14521-A

stack version:

$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0

A ticket was opened concerning this potential ghc bug : https://ghc.haskell.org/trac/ghc/ticket/14521

@OlivierSohn OlivierSohn changed the title [Compiler bug?] Infinite loop when a specific function is not inlined [Compiler bug?] Infinite loop Nov 28, 2017
@OlivierSohn
Copy link
Owner Author

OlivierSohn commented Nov 29, 2017

It was not a ghc bug, it was my code that was too strict! making it more lazy fixed the issue, and compiling with -fpedantic-bottoms makes the error be deterministic.
Related commit: 5bce4fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant