RE: [nhc-bugs] hi Problems

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

I'm pleased to report that rebuilding (using the nhc98 I had previously built with gcc) created a working executable.
Glad to hear it.
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.
My guess is that it might be due to old C files in the distribution - perhaps we failed to completely re-generate them from scratch, as we should have done.
I'll verify on Linux, but I suspect the result will be the same.
I have just checked the .tar.gz package from the web on my Linux machine, and it does indeed display this problem. (Sorry that I didn't spot this earlier - I had checked the current CVS rather than the released version.) This means we will need to produce a new, corrected, distribution package quite soon. We will probably bump the version number again at the same time, since there are other bugfixes that can be usefully incorporated. Regards, Malcolm
participants (2)
-
Brent Fulgham
-
Malcolm Wallace