Re: Segmentation Fault with first example in Yesod book

91 views
Skip to first unread message

Steffen

unread,
Aug 30, 2012, 3:10:03 AM8/30/12
to yeso...@googlegroups.com
Yes, there are other reports about segmentation faults with ghc/yesod on Mac. 

In my current yesod-project I can circumvent the problem by using "ghc -O2" and my segmentation fault goes away (-O2 turns on all compiler optimisations, something you want  anyway once you finished developing). However, I am on Linux(64bit)/ghc7.4.2 and the "hello world" example runs fine for me, even in ghci (note that the interpreter ignores -O2, so you have to use ghc instead of ghci), but since it is very easy to try, it might be worth a shot. Make sure to delete any *.o files before compiling, otherwise they are not recreated.

Otherwise, I also had some problems with the examples in the printed book, since it is already outdated in some places (for example the way the timeout for the sesssions is set, but there are more changes). The same is true for the online version on the yesod homepage, but for any one specific program example, either of the two versions has always worked for me (sometimes the printed, sometimes the online version).

Prx

unread,
Aug 30, 2012, 11:07:52 AM8/30/12
to yeso...@googlegroups.com
Steffen, thanks.

I'm hoping to to do this on a Mac, not having to VM into Linux. Also, I'm starting out, so I'd like to use ghci and not compiled with optimizations. 

I guess I'm stuck.

taz...@gmail.com

unread,
Aug 30, 2012, 11:29:06 AM8/30/12
to yeso...@googlegroups.com
Hej,

this is a known issue that only happens with the 64Bit version of GHC 7.4.* on OS X.

You can fix this either by installing the 32-Bit version of GHC (the recommended way of doing this is by installing the Haskell platform instead of using Homebrew) or the preview of GHC 7.6.1 (not recommended).

Cheers,
Vincent
Reply all
Reply to author
Forward
0 new messages