[Haskell-cafe] GHCI segfault for program that works fine when compiled

Matthew Pickering matthewtpickering at gmail.com
Wed Sep 14 08:29:23 UTC 2016


Hi Erik,

Yes, you should definitely open a ticket for a segfault! Someone will
close it if it is a duplicate or not a bug in GHC and you are far more
likely to get
good help than reporting the bug on reddit.

The absolute best thing you can do is reduce the case sufficiently so
that ideally the bug can be reproduced with one invocation of ghc.
(Something like "ghc --interactive -fexternal-interpreter") or at
least a cabalised project with as few dependencies as possible. Stack
reproduction instructions are not very useful as it is hard to use
stack with a custom build of GHC.

Matt



On Wed, Sep 14, 2016 at 4:31 AM, erik <eraker at gmail.com> wrote:
> Hello,
>
> I posted a question on Stackoverflow and reddit's /r/haskell today (see
> below), the gist of which was that GHCI segfaults when I attempt to create a
> connection to a Postgresql instance using a function from the
> postgresql-simple library; however, when I compile and run my code it works
> fine.
>
> I thought it was perhaps odd that GHCI would segfault when the compiled code
> worked fine (this is on GHC 8.0.1 and GHC 7.10.3), and then I discovered
> that if I start GHCI in the following way, I can create a connection to my
> database without any issues:
>
> $ stack ghci --library-profiling --ghci-options="-fexternal-interpreter"
>
> It seems likely that I have a weird install of Postgresql + postgresql-libpq
> (albeit probably not too weird for anyone on OSX who uses the EnterpriseDB
> installer, like I did). As a result, I was unsure if exploring this issue
> further would be of interest to anyone.
>
> Anyway, I am posting here because I was encouraged to do so by a commenter
> on my Stackoverflow question. In addition, in both places, I received the
> suggestion to open a GHC ticket, but owing to my limited experience in
> Haskell, I am hesitant to do so. I do not know how to get a real stack trace
> for my segfault. Moreover, I would likely require a fair bit of hand-holding
> to produce any useful data, and I wasn't sure if pursuing this any further
> would be of value to anyone.
>
> More information can be seen here:
>
> Stackoverflow question:
> http://stackoverflow.com/questions/39440416/ghci-segfault-when-creating-a-database-connection-with-postgresql-simple
>
> Reddit Thread:
> https://www.reddit.com/r/haskell/comments/52ht7h/i_have_a_ghci_segfault_for_an_application_that
>
> Should I open a GHC ticket? If so, what are some good strategies for
> producing useful information for that ticket?
>
> Thanks,
>
> Erik
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list