[Haskell-cafe] OS X ghci problem

Jason Dagit dagitj at gmail.com
Sun Jul 14 02:04:42 CEST 2013

On Sat, Jul 13, 2013 at 4:39 PM, Mark Lentczner
<mark.lentczner at gmail.com> wrote:
> Bizarre - this just happened to me today, too. Anyone? Did you figure out a
> work around? For the record, I'm trying to bring Euterpea up.

After some digging, experimenting, asking around, and head scratching
my best guesses are:

  * GHCi's custom linker isn't doing the right thing (some versions of
llvm/clang gave crashes like this and it was a linker bug for them,
you can find reports on sites like StackOverflow).
  * We need to feed .m files to clang instead of ghc/gcc
  * GHCi needs to be built with Cocoa in mind (is it already?)
  * Some rts component of objective-c is not properly initialized (ARC
vs. -fobjc-gc vs. -fnext-step, etc)

> My system is OS X 10.8.4, and I'm running HP 2013.2, so 7.6.3. And

What version of the xcode command line tools do you have? Anything
older than 4.6.2 might have had the linker bugs I mention. On the
other hand, I've tried with the latest version installed and it didn't
help (probably because ghci doesn't use it).

In terms of experimentation, you can hand desugar the objective-c code
in the GLFW init and when I do that I get segfaults. Also, the address
mentioned in the objective-c exception has a suspicious value, which
would further implicate the linker. Add to that, it works for a
compile program (which uses the system linker, IIRC).

Basically, I'm pretty sure it's GHCi's linker to blame here but I
don't have a smoking gun.


More information about the Haskell-Cafe mailing list