[Haskell-cafe] ghc 6.8.1 bug?

Simon Peyton-Jones simonpj at microsoft.com
Fri Nov 16 05:13:42 EST 2007

Alberto, SevenThunders, Joel,

Glark. This is not good. Thank you for being so polite about it.  And thanks for working on a reproducible test case -- without that we are 100% stuck.

We did fix one just-possibly-related bug in 6.8 recently, which concerned the use of {-# UNPACK #-} on strict Double-sized fields in fixed, top-level data structures. I think it was only wrong on a 64-bit machine.
What is the word size on your machine?

But that may well be a complete red herring.  We'll stand by.


| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Alberto Ruiz
| Sent: 15 November 2007 08:44
| To: haskell-cafe at haskell.org
| Subject: Re: [Haskell-cafe] ghc 6.8.1 bug?
| Hello,
| I have had exactly the same problem with my bindings to GSL, BLAS and LAPACK.
| The foreign functions (!) randomly (but very frequently) produced NaN with
| ghc-6.8.1 -O. As usual, I first thought that I had a subtle bug related to
| the foreign pointers, but after a lot of refactoring, experiments, and
| tracing everything, I'm reasonably sure that memory is safely used. What I
| have found is that the same errors can be reproduced on ghc-6.6.1
| with -O -fasm. So I tried -O -fvia-C on ghc-6.8.1 (which now it is not the
| default) and apparently everything works well. So it seems that now the ffi
| requires and additional and explicit -fvia-C. In any case I don't know
| why -fasm produces those strange NaN in precompiled foreign functions...
| Alberto
| On Thursday 15 November 2007 09:05, SevenThunders wrote:
| > The good news is that my code compiles without error and much faster under
| > ghc 6.8.1.
| > The bad news is that there appear to be subtle bugs that did not occur when
| > I compiled things under
| > 6.6.1.  One issue is that my code is somewhat complex and links into a  C
| > library as well.

More information about the Haskell-Cafe mailing list