GC bug

"John Hughes" <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <00e301c28789$708ddd90$4711d7d9@DellPC>
The attached program (needs the Hugs Graphics Library) reveals what I
presume is a GC bug in the Dec 2001 hugs.

John

----- Original Message -----
From: "John Hughes" <[email protected]>
To: "Alastair Reid" <[email protected]>
Sent: Friday, November 08, 2002 2:58 PM
Subject: Re: HGL


>
> >
> > > Alastair, Just for a bit of fun, I solved the first programming lab
> > > on our Java course using HGL instead. You might like to run the
> > > attached program to see the result!
> >
> > That's pretty cool.  Thanks.
> >
> > > Give it a BIG heap, or you'll hit the same GC bug in Hugs that I did.
> >
> > I do indeed need a big heap.
> >
> > How do you know it's a GC bug and not just a space leak?
> > If we can, I'd like to fix it if it's a bug (or even if it's not a 'bug'
> > but can be fixed.)
> >
>
> Well, I get different behaviour depending on the heap size. For example,
> with a heap size of 250000,
>
> Main> main
>
> Thread raised exception: {{Cell ...}}
> Uncaught Error: {{Cell ...}}
>
> or, in a fresh winhugs,
>
> Main> foldr1 (.+) (take 10000 (points ()))
>
> Program error: {primIntegerToInt (-2147483648)}
>
> Repeating that, by the way, gives
>
> Main> foldr1 (.+) (take 10000 (points ()))
>
> ERROR - Garbage collection fails to reclaim sufficient space
>
> With a heap size of 249999, I get¨
>
> Main> main
>
> ERROR - Garbage collection fails to reclaim sufficient space
>
> Main> foldr1 (.+) (take 10000 (points ()))
>
> Program error: {primIntegerToInt 352126429244364}
>
> Behaviour that depends on the heap size looks like a GC bug to me.
>
> I would have liked to pare the program down to a small one exhibiting the
> same problem, but that proved difficult. What I did discover is that the
> type signature on transform is crucial: removing it changes the behaviour,
> for reasons which are not at all clear to me.
>
> Good luck with bug-hunting!
>
> John
>
>
Lab1.hs (application/octet-stream, 3.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.