[GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC ghc-devs at haskell.org
Sat Oct 21 00:02:53 UTC 2017


#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      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):

 jbetz, which code are you referring to? This is the code snippet at the
 top of https://github.com/tomjaguarpaw/haskell-opaleye/issues/338 at the
 time of writing:

 {{{#!hs
 module Main where

 import           Data.Int
 import           Data.Profunctor.Product    (p1)
 import           Database.PostgreSQL.Simple (Connection, connect,
                                              connectDatabase,
 connectPassword,
                                              defaultConnectInfo)
 import           Opaleye                    (Column, PGText, Query,
                                              Table (Table), queryTable,
                                              required, runInsertMany,
 runQuery)
 import qualified Opaleye.PGTypes            as P

 main :: IO ()
 main = do
   connection <- connect $ defaultConnectInfo { connectDatabase =
 "postgres", connectPassword = "changeme"}
   r1 <- doTestInsertQuery connection
   print r1
   r2 <- doTestSelectQuery connection
   print r2

 doTestInsertQuery :: Connection -> IO Int64
 doTestInsertQuery connection =
   runInsertMany connection testTable [P.pgString "ok"]

 doTestSelectQuery :: Connection -> IO [String]
 doTestSelectQuery connection =
   runQuery connection testQuery

 testQuery :: Query (Column PGText)
 testQuery =
   queryTable testTable

 testTable :: Table (Column PGText) (Column PGText)
 testTable =
   Table "test" (p1 (required "message"))
 }}}

 But compiling this with GHC 8.2.1 on my 64-bit Windows machine seems to
 work!

 {{{
 $ ghc -fforce-recomp Bug.hs
 [1 of 1] Compiling Main             ( Bug.hs, Bug.o )
 Linking Bug.exe ...

 $ ./Bug.exe
 Bug.exe: SqlError {sqlState = "", sqlExecStatus = FatalError, sqlErrorMsg
 = "could not connect to server: Connection refused
 (0x0000274D/10061)\n\tIs the server running on host \"127.0.0.1\" and
 accepting\n\tTCP/IP connections on port 5432?\n", sqlErrorDetail = "",
 sqlErrorHint = ""}
 }}}

 The same thing happens if I compile with `-O2`.

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


More information about the ghc-tickets mailing list