On Thursday 25 January 2001 7:38 pm, Frank Heckenbach wrote:
You can use the built-in (since 2000-04-11) routine FrameAddress to get the current stack (frame) position. If you check it in some critical routines, you might be able to get an idea how much stack is used in each call.
Thanks, Frank. So far I haven't been able to discover much from using FrameAddress, but from experimenting a bit it does seem to point to a stack problem. For example, if I declare a large array inside one of the recursive procedures, the segmentation fault occurs much earlier.
I'm not doing anything complicated with strings, but one thing I have realised which might be relevant is this: My recursive procedures are nested - could this be causing a problem? The structure of the recursive part of my program is something like this:
procedure outer(...); var .....;
procedure recursive_one(...); var ....;
procedure recursive_two(...); var ...;
begin if {something} then recursive_two else {something else} end; begin { recursive_one } if {something} then recursive_one(...) else recursive_two(...) end; begin { outer } recursive_one(...) end; Could the fact that recursive_two is inside recursive_one be causing problems when recursive_one calls itself?
Steve