[Haskell-cafe] GHC Hangs

Josiah Manson josiahmanson at gmail.com
Mon May 7 09:28:01 EDT 2007


Hello Haskellers,

I have a problem where GHC will hang after compiling a file. The problem
seems to occur with my computer, but not with everyone else's. I hope that
someone my be able to diagnose my problem.

My computer is an Acer Aspire 5670, which runs on an Intel Core Duo T2300
and runs Windows XP Home Edition. My version of GHC is The Glorious Glasgow
Haskell Compilation System, version 6.6.

When supplied the file bisect.hs with the following contents:

sign a | a < 0 = -1
sign a | a >= 0 = 1

bisect f a b =
    if b - a < eps
        then c
        else if sign (f a) == sign (f c)
            then bisect f c b
            else bisect f a c
    where
        c = (a + b) / 2
        eps = 0.000000000000001

main = print $ bisect cos 0 2

Running produces this output at which point nothing further happens. The
same thing happens without -dcore-lint -debug, but I have included it
because someone suggested it would provide useful diagnostics.

C:\data\code\other\haskell\simple>ghc --make bisect.hs -dcore-lint -debug
[1 of 1] Compiling Main             ( bisect.hs, bisect.o )

The file bisect.o is generated, but GHC is stopped and not using any CPU
time. As well, there are two other processes that were spawned and must also
be killed separately named gcc.exe and as.exe. Interestingly, if I do
multiple iterations of running ghc then killing it. I eventually get a
working executable.

As far as I can tell, GHC is deadlocked, which makes me wonder if dual cores
are causing the problem. BTW, problems like this have occurred in other free
software like Open Office, but leaves most other programs unaffected.

Josiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070507/f8b6bbf6/attachment.htm


More information about the Haskell-Cafe mailing list