[Haskell-cafe] hugs segmentation fault

Jon Fairbairn Jon.Fairbairn at cl.cam.ac.uk
Thu Oct 28 18:59:21 EDT 2004

On 2004-10-29 at 00:45+0200 Andrej Bauer wrote:
> Hi,
> I am new to haskell, but otherwise experienced in programming languages.
> My first attempt at Haskell was this (on a Linux Debian) session with hugs:
> Type :? for help
> Prelude> :version
> -- Hugs Version November 2003
> Prelude>  let p = 1 : [2 * x | x <- p, x < 1] in p
> [1Segmentation fault
> Is it the norm for hugs to dump core like this? Or was I
> just very lucky to discover a bug?

UNlucky. There's a bug in your programme in that it goes
into an infinite loop consuming something (stack probably),
and it happens that hugs doesn't correctly check for its
exhaustion. (I'd call that a bug too)

In ghci you get:

[1*** Exception: <<loop>>

which is better.
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk

More information about the Haskell-Cafe mailing list