Bostjan Slivnik's example crashes ghci

Bostjan Slivnik bostjan.slivnik@fri.uni-lj.si
Sun, 28 Oct 2001 18:55:11 +0100


> > --------------------------------------------------------------
> > ----------
> > module Test where
> >=20
> > data Foo =3D Foo Int [Foo]
> > instance Show Foo where showsPrec _ (Foo f _) =3D shows f
> >=20
> > lstOfFoos =3D [Foo f lstOfFoos | f <- [2..5]]
> > foo =3D head lstOfFoos
> > --------------------------------------------------------------
> > ----------
> >=20
> > Entering foo at the ghci prompt causes segmentation fault. It works
> > when compiled as a standalone program (and supplied with Main.main).

It probably works when compiled with ghc because the example is small
enough.  The example is taken from a bigger program which uses several
data types similar to Foo extensively.  The bigger program crashes
(with segmentation fault or illegal instruction) even when compiled
with ghc-5.02 as a standalone program.  However, the program works
fine if something like `+RTS -H100M' is used.
(I can send sources if needed.)

> Is this on the HEAD?  GHCi on the HEAD has some quite severe problems at
> the moment, apparently it needs to catch up with some of the recent
> changes to the CorePrep area.  We're looking into it.

I checked the Glasgow-haskell-bugs list.  On September 27th,
S.D.Mechveliani reported very similar behaviour of a program compiled
with ghc-5.02.  On October 4th, Julian Seward replied that the fix
have been made and that it will be in ghc-5.02.1.  Is it already
available in the CVS repository?  If so, under what tag (`ghc-5.02')?

Bo"stjan Slivnik