[nhc-users] nhc98 garbage collection core dumps and build problems

Olaf Chitil O.Chitil at kent.ac.uk
Wed Jul 28 08:32:35 EDT 2004


Malcolm,

every non-trivial Haskell program compiled with nhc98 (current cvs) core 
dumps on Solaris. The garbage collector seems to be the cause of the 
fault. Small computations not requiring garbage collection work fine. 
But take:

import List

plus x = x + 2

primes :: [Int]
primes = 2 : filter prime [3..]

prime :: Int -> Bool
prime n = not (any (`divides` n) (takeWhile (< n) [2..]))

divides :: Int -> Int -> Bool
divides n m = m `rem` n == 0


main = print (take 33 primes)


Then you observe:

myrtle$ Test +RTS -B
[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131<GC   
1:Start>Segmentation Fault (core dumped)

Any idea?


With respect to building nhc98 (all). After a long time the process 
stops with:

 > 
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/targets/sparc-solaris2/objz/prelude/tpltmp.c
gcc -c  -o 
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/targets/sparc-solaris2/objz/prelude/tpl3Observe.o 
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/targets/sparc-solaris2/objz/prelude/tpltmp.c
rm 
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/targets/sparc-solaris2/objz/prelude/tpltmp.c
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/script/tprofprel 1 \
PackedString System CString Driver NonStdEval NonStdProfile NonStdTrace 
NonStdUnsafeCoerce NonStdGetPID Warning  UnboxedArray BinArray Prelude 
Array CPUTime Char DErrNo FFI IO IOExtras Ix List Maybe Numeric Random 
Ratio Bit Binary Locale Observe Complex Directory GreenCard Monad  Time 
 > 
/nfs/myrtle/d23/part1/home/cur/oc/nhc98/targets/sparc-solaris2/objz/prelude/tpltmp.c
$

"$" is not a proper shell prompt. It does accept some input like "gmake 
install" (without doing anything until interrupted), but it doesn't do 
anything on input like "ls". I'm confused. In the end I only build "basic".


A minor point: When make tries to build the package haskell-src it calls 
happy. Because I don't have happy installed this fails. No big problem, 
because building continues. However, shouldn't configure test for happy, 
warn about it and possibly exclude haskell-src from building...

Ciao,
Olaf


More information about the Nhc-users mailing list