
#14089: Segmentation fault/access violation using Yesod and Postgresql ---------------------------------+-------------------------------------- Reporter: Burtannia | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Comment (by RyanGlScott): Thanks Burtannia. I tried building each of these examples with both GHC 8.0.2 and 8.2.1. Neither example segfaulted on GHC 8.2.1. On GHC 8.0.2, the `postgres` example didn't segfault, but the `sqlite` example did: {{{ $ cabal build Preprocessing library for sqliteExample-0.0.0.. Building library for sqliteExample-0.0.0.. [ 1 of 11] Compiling Settings ( src\Settings.hs, dist\build\Settings.o ) [ 2 of 11] Compiling Settings.StaticFiles ( src\Settings\StaticFiles.hs, dist\build\Settings\StaticFiles.o ) [ 3 of 11] Compiling Model ( src\Model.hs, dist\build\Model.o ) [ 4 of 11] Compiling Import.NoFoundation ( src\Import\NoFoundation.hs, dist\build\Import\NoFoundation.o ) [ 5 of 11] Compiling Foundation ( src\Foundation.hs, dist\build\Foundation.o ) Segmentation fault/access violation in generated code }}} Running `cabal build` after this causes the build to succeed. However, `cabal clean`-ing and re-running `cabal build` causes the segfault to resurface: {{{ $ cabal build Preprocessing library for sqliteExample-0.0.0.. Building library for sqliteExample-0.0.0.. [ 1 of 11] Compiling Settings ( src\Settings.hs, dist\build\Settings.o ) [ 2 of 11] Compiling Settings.StaticFiles ( src\Settings\StaticFiles.hs, dist\build\Settings\StaticFiles.o ) Segmentation fault/access violation in generated code }}} Notice that it appeared to segfault in a different location that time! Moreover, you appear to need to build these modules in parallel (`cabal build`'s default behavior) to trigger the segfault (at least, on my 64-bit Windows 10 machine), since I can't get it to segfault with `cabal build -j1`. My initial hunch is that this is an occurrence of #13112, since both `Foundation` and `Settings.StaticFiles` use quite a bit of Template Haskell. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14089#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler