Bug in GHC 6.4.1 and 6.4.2

Simon Marlow simonmarhaskell at gmail.com
Fri Jul 21 06:14:32 EDT 2006


Fritz Henglein wrote:
> According to a message from GHCi, version 6.4.1 (see below; bug also
> reproduceable with 6.4.2, though not shown here since it consistently
> resulted in a core dump without prior message) under Windows XP (fully
> updated per 2006-07-15), I am herewith reporting what appears to be a
> bug in GHC.  Please see transcript below; the source file in question
> is included as an attachment.  (Lacking both efficient Haskell
> programming skills and an understanding of the internals of GHC I have
> refrained from attempting to isolate the bug by reducing the code.)
> Should there be a simple work-around or something unsafe in my code
> (though I wouldn't know what: no "unsafe" operations are used; no
> polymorphism is present), I would greatly appreciate hearing about it.

Thanks, good bug.  The problem was:

 > index (minBound::Int16,maxBound) maxBound
-1

ie. index for Int16 should have converted to Int *before* doing the subtraction.

This is related to another problem (that I think we have a ticket for), namely 
that the type of index precludes having really large arrays:

   index :: Ix i => (i,i) -> i -> Int

if the index must fit in an Int, then GHC can't cope with arrays with more than 
2^31 elements (on a 32-bit machine), and in general Haskell doesn't allow arrays 
with more than 2^29 elements.

Cheers,
	Simon



More information about the Glasgow-haskell-bugs mailing list