[cvs-nhc98] segfault-causing examples
Isaac Dupree
isaacdupree at charter.net
Fri Mar 2 16:38:03 EST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
main = do
print "hello"
print (True)
print "bye"
compiling with my darcs-nhc98 on my computer and running, I get:
"hello"
Segmentation fault (core dumped)
Before trying that, I noticed that Integers had some problems...
module Main(main) where
main = do
print "hello"
if 2 > (1::Int) then print "SmartInt" else print "StupidInt"
if 2 > (1::Integer) then print "SmartIntegerA" else print
"StupidIntegerA"
if 1 < (2::Integer) then print "SmartIntegerB" else print
"StupidIntegerB"
print (1::Int)
print (1::Integer)
print "bye"
My results, plus comments verified by other experiments:
"hello"
"SmartInt" --Ints are fine
"StupidIntegerA" --Integers are
"SmartIntegerB" --not working right
1 --Ints are still fine
Segmentation fault (core dumped) --Instance Show Integer crashes the program
show (1::Integer) `seq` print "integ" --prints "integ" (shallow seq)
foldr seq () (show (1::Integer)) `seq` print "integ" --crashes (deep seq)
I suppose maybe I compiled nhc wrong, since I manually modified an "=="
to "=" in one file, and restarted its compilation several times, though
I can't see how those could cause these problems...
Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF6Jk6HgcxvIWYTTURApy5AJ971v1rRcy6fqnBrTheaQarakIPNgCfXZmg
sRq1AhmrIxPIW9bY58bbbUw=
=FLqA
-----END PGP SIGNATURE-----
More information about the Cvs-nhc98
mailing list