
For a change of pace, I thought I would whine about problems with Linux. I built nhc98 under Debian GNU/Linux (I have a package available if anyone is interested), and noticed that I see the same problem that I do under Cygnus (which I assumed was due to Cygwin's hackish nature). Unforunately, the behavior is the same under Linux: bfulgham@hopper:~$ hi __ __ __ _____________________________________ || || ______ ___ || _ ____ hmake interactive (hi): ||___|| || || || ___|| ||/ ||__|| Copyright (c) May 2000 ||---|| || || || ||__|| ||\_ ||__ http://www.cs.york.ac.uk/fp/hmake/ || || Report bugs to: malcolm@cs.york.ac.uk || || Version: 2.02 (2001-02-08) ------------------------------------- ... Using compiler nhc98 ... Type :? for help [Std module... /usr/include/nhc98/Prelude.hi] Prelude> ord 'a' [Compiling...Segmentation fault bfulgham@hopper:~$ Under Cygwin this was failing in run(), but in Linux I fail under a log() routine, which may be part of the C runtime. I suspect this would better be studied using hat or something, but unfortunatley I am too unfamiliar with these tools (currently) to delve further. Am I just using 'hi' completely incorrectly? I must shamefully point out that hugs handles this case correctly: bfulgham@hopper:~$ hugs __ __ __ __ ____ ___ _________________________________________ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-1999 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: February 2000 _________________________________________ Haskell 98 mode: Restart with command line option -98 to enable extensions Reading file "/usr/share/hugs98/lib/Prelude.hs": Hugs session for: /usr/share/hugs98/lib/Prelude.hs Type :? for help Prelude> ord 'a' 97 Prelude> Thanks! -Brent

__ __ __ _____________________________________ || || ______ ___ || _ ____ hmake interactive (hi): ||___|| || || || ___|| ||/ ||__|| Copyright (c) May 2000 ||---|| || || || ||__|| ||\_ ||__ http://www.cs.york.ac.uk/fp/hmake/ || || Report bugs to: malcolm@cs.york.ac.uk || || Version: 2.02 (2001-02-08) ------------------------------------- ... Using compiler nhc98 ...
Type :? for help [Std module... /usr/include/nhc98/Prelude.hi] Prelude> ord 'a' [Compiling...Segmentation fault bfulgham@hopper:~$
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>
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>
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? Regards, Malcolm
participants (2)
-
Brent A. Fulgham
-
Malcolm Wallace