[Haskell-cafe] ghc 6.8.1 bug?

SevenThunders mattcbro at earthlink.net
Thu Nov 15 03:05:34 EST 2007

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.

The new behavior is that under certain conditions a certain matrix inner
product produces undefined floats, that should not be there.  If the code is
executed inside any function it fails but if the same code is reexecuted at
the ghci prompt it works.  Here is the gist of the code that I'm running

main = do
    ... lots of computations and let clauses
    -- get a submatrix
      viewMatbotk wstart nsua su 1 suw
    -- get another submatrix
      viewMatbotk 0 nsua arrstart npaths sua
     -- complex non conjugated inner product (multiply the two submatrices)

If this is executed either in ghci as main or from a Dos prompt I get
a matrix filled with bad values including a few that look like

If I recompile everything in ghc-6.6.1 it works like  charm.  I make sure
that I have deleted all the .o and .hi files.  There is a dll that contains
a C library I link to via running dlltool.exe.   If I print out all the
function inputs to the function viewMatbotk and then call them interactively
in ghc 6.8.1 and call mulCFtF interactively it works correctly.  both
viewMatbotk  and mulCFtF are C routines pulled in from the external library.  

I am at a complete loss how to debug this or how to pin down what exactly
has changed between 6.6.1 and 6.8.1 that breaks this code so badly.  This
type of error stinks of some kind of memory issue, e.g. corrupted pointers. 
Any suggestions would be appreciated.  Unfortunately the code base is rather
involved and potentially proprietary so I can't publish all of the details.
View this message in context: http://www.nabble.com/ghc-6.8.1-bug--tf4810375.html#a13763341
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list