nhc98 garbage collection core dumps and build problems

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
/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

Olaf Chitil
every non-trivial Haskell program compiled with nhc98 (current cvs) core dumps on Solaris.
What compiler are you building with? Which versions of Solaris and underlying gcc? My overnight builds on Solaris 9 with gcc-2.95.2, ghc-6.2.1 and nhc98 itself all seem to work OK - at least nhc98 is capable of bootstrapping itself.
The garbage collector seems to be the cause of the fault. Small computations not requiring garbage collection work fine.
Hmmm. GC faults are notoriously difficult to track down.
With respect to building nhc98 (all). After a long time the process stops with:
/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
.../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".
The beginning of script/tprofprel looks like it does some nasty sh/bash compatibility stuff, including possibly exec'ing bash. That might lead to the behaviour you see.
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...
Yes, it might be worth adding a check to the configure script. Regards, Malcolm

What compiler are you building with? Which versions of Solaris and underlying gcc? My overnight builds on Solaris 9 with gcc-2.95.2, ghc-6.2.1 and nhc98 itself all seem to work OK - at least nhc98 is capable of bootstrapping itself.
Thanks, Malcolm. I fell into the old trap, using gcc 3.3.3. Switching to gcc 2.95.3 solved the problem. I didn't see any warning about this on the webpages, maybe even configure should reject this gcc? By the way, I use Solaris 5.9 and build with ghc-6.2. Ciao, Olaf
participants (2)
-
Malcolm Wallace
-
Olaf Chitil