[nhc-bugs] hi Problems

Brent Fulgham brent.fulgham@xpsystems.com
Thu, 31 May 2001 15:11:34 -0700


> Hmmm.  Segfaults are really difficult to track down - I can't 
> reproduce this problem on my Linux machine.  Here's what I get:
> 
> > Prelude> ord 'a'
> > [Compiling...
> > ====================================
> > 	Error when renaming::
> > Identifier ord used at 10:21 is not defined. (in overlap resolution)
> > ...failed]
> > Prelude>
>

I'm pleased to report that rebuilding (using the nhc98 I had previously
built with gcc) created a working executable.

You might need to modify the build rules such that hi does not function
unless built with a true Haskell compiler.  This is probably due to some
kind of interaction between the version of gcc, libc, etc., on the
system.

I'll verify on Linux, but I suspect the result will be the same.
 
> And this highlights a side issue - you should note that Hugs is
> naughty to accept the expression at all - ord is not in the Prelude.
> For true Haskell'98 behaviour, you should :load Char first.
> 
> > Prelude> :load Char
> > [Std   module...  /usr/local/include/nhc98/Prelude.hi]
> > [Std   module...  /usr/local/include/nhc98/Char.hi]
> > Char> ord 'a'
> > 97           
> > Char>
> 

And this works as well.

> But of course this doesn't help you.  You said that you get the
> segfault under both Cygwin and Linux right?  That suggests a fault
> in the code, rather than an environment issue.  Can you tell me what
> compiler you used to build nhc98 etc with, under both Cygwin 
> and Linux?
>

I built both copies using the included 'C' code from the tarball
(the gcc target) under gcc 2.95.3

Successful build was achieved by building nhc98 with the C sources,
then rebuilding with nhc98 to bootstrap itself.

Not sure why this was required, but that works.

Thanks,

-Brent