Stack size

ajf ajf@doc.ic.ac.uk
Thu, 13 Sep 2001 11:48:33 +0100


I'm using the Feb 2000 release of Hugs and am preparing student labs
using the graphics library.  Several nasties happen:

*  For very moderate problems (plot ~2K lines centred in a window of
fixed size) I get a control stack overflow.  To centre, the code finds
pre-computes the minimum and maximum x and y ordinates of all line
end-points.  This is potentially a problem, but fixable in this case,
you'd hope.  However, the overflow happens EVEN IF the code is written
tail-recursive, or using foldl.  Oh dear.

*  If the relevant scaling factors are passed as parameters (to avoid
pre-computation) I can plot quite a bit more (4997 lines on my W2000
set-up; rather more on an earlier installation under W98).  But then the
program aborts, presumably because of the C stack overflow problem.

* On W2000 the previous problem corrupts the WHOLE screen buffer, rather
like a virus.  Actually this is fixable by maximising and then
minimising the hugs window, but it's all very disturbing!  On W98, the
programs seems to die gracefully.

So question:  how do I increase the stack size?  Also, are you aware of
problems with the graphics library burning up the C stack?  I cannot
find anything in the hugs documentation, but have a feeling you have to
recompile Hugs.  Is this true?

(Otherwise Hugs is completely wonderful...!)

Many thanks.

Tony Field
Imperial College