[Haskell-cafe] GHC 6.8.2 as a library on Windows and GHCi

Austin Seipp mad.one at gmail.com
Wed Jan 9 16:13:48 EST 2008

Excerpts from Peter Verswyvelen's message of Wed Jan 09 10:07:46 -0600 2008:
> Is my code incorrect, or is this a (known?) bug in GHC 6.8.2 on Windows? 
> I haven't tried the Linux version yet.

The same thing happens on my Windows XP box as it does with yours. On
both windows and my linux box, ghc --make works fine, and on linux with
ghci,  it works fine but not on windows (and fails with the exact same

Just from a general idea I would say that the reason would be related
to the linker loading base twice: once when ghci itself is started, and
the second time when you actually call into the ghc api;
setSessionDynFlags will give your session knowledge of all installed
packages, so when you're actually executing code using runStmt it may 
reload the object file into an address space where it already resides.
GHCi only has one symbol table in its address space, so loading twice
will naturally cause clashes.

This seems slightly related to the fact that, you can't do similar with
hs-plugins as it directly interfaces with the runtime linker and
therefore you must always compile your apps that use hs-plugins rather
than loading them into ghci.

Why this would only occur on Windows and not linux though, I have no 
idea. It seems a bug report is well in order.

I'm probably just talking nonsense though; I guess you'll just have to
make due with ghc --make! Sorry I couldn't further help, you may get
more info by asking a ghc guru.

- Austin

"It was in the days of the rains that their prayers went up, 
not from the fingering of knotted prayer cords or the spinning 
of prayer wheels, but from the great pray-machine in the
monastery of Ratri, goddess of the Night."
 Roger Zelazny

More information about the Haskell-Cafe mailing list