yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.63k stars 371 forks source link

`ghc: panic! (the 'impossible' happened)` when starting new project #1833

Open mateuszjarzyna opened 7 months ago

mateuszjarzyna commented 7 months ago

I'm new to Haskell, I wanted to learn by creating a web app in Yesod. I installed the Haskell and all the stuff - here are more details about my setup https://gist.github.com/mateuszjarzyna/4779abf413593a1b7298f14f865c516d

So I created the new app by stack new api yesodweb/mongo, then run the project by stack exec -- yesod devel, some stuff was downloaded and an error happen

~/workspace/git/TravelTale/api on  main! ⌚ 19:59:57
$ stack exec -- yesod devel

\Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:

http://localhost:3000
https://localhost:3443
If you wish to test https capabilities, you should set the following variable:
  export APPROOT=https://localhost:3443

ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-apple-darwin):
    Prelude.chr: bad argument: 3179719811

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Error: [S-6374]
       While building simple Setup.hs (scroll up to its section to see the error) using:
       /Users/mateusz.jarzyna/.stack/programs/x86_64-osx/ghc-8.2.2/bin/ghc-8.2.2 -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.0.1.0 /Users/mateusz.jarzyna/.stack/setup-exe-src/setup-6HauvNHV.hs /Users/mateusz.jarzyna/.stack/setup-exe-src/setup-shim-6HauvNHV.hs -o /Users/mateusz.jarzyna/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_6HauvNHV_2.0.1.0_ghc-8.2.2
       Process exited with code: ExitFailure 1 
Type help for the available commands. Press enter to force a rebuild.

and here is what I see in the browser:

Zrzut ekranu 2024-03-6 o 20 00 30

It is my first touch of Haskell, so I have no idea how to debug that error

schoettl commented 7 months ago

I previously also had problems with GHC compiling yesod projects.

For me it was probably due to insufficient memory. GHC can sometime take many giga bytes.

Also, you could upgrade to a newer version of GHC. With stack resolver lts-22.0 I have GHC version 9.4.8. See stackage.org for what LTS versions exist.

mateuszjarzyna commented 6 months ago

I've updated the GHC to the newest version, from 9.8.1 to 9.8.2, but still got the same error :( I have 8gb free RAM, is that not enough?

schoettl commented 6 months ago

Your log above suggests you're using: GHC version 8.2.2 for x86_64-apple-darwin

Check the stack.yaml file, look for resolver and try a newer LTS (see stackage.org). stack doesn't use the system GHC but the GHC specified here.

What LTS do you currently have set?

8GB are not much but with swap and if it's not a large web app it should work, I think.