[comp.sys.mac.hypercard] Stack overflow

jdineen@bbn.com (Jane Dineen) (02/09/90)

Hi,

I've been getting "stack overflow" messages occasionally.  Can anyone tell me
what that means?  It always occurs on the same card, but not every time.  It
always happens on that card when the userlevel is 1, but only sometimes when
the userlevel is 5.

This is occuring in Plus.  The Plus documentation doesn't mention stack
overflow and a person from Product support at Spinnaker will call me back --
he's never seen a stack overflow message. (Spinnaker now does Plus, not Olduvai
anymore.)

The system is a Mac II. The card is 950x650, 256 colors.  The card has 18 color
paintobjects, one of which shows at a time.  Reducing the number of
paintobjects does not make the problem go away.  There is a scrolling field
where you click on a line of text, and the field shows the appropriate
paintobject (and hides the previous one).

Have any of you encountered stack overflows that are dependent on the
userlevel, or can anyone explain to me what a stack overflow is anyway? I'd
appreciate it a lot!  Thanks.

Jane

jdineen@bbn.com (Jane Dineen) (02/10/90)

HI,

I haven't had any answers from the net to my question about stack overflow, but
I have had an answer from Spinnaker.  

They say that "stack overflow" means that the allocated memory space has been
exceeded.  (So, I'll see if I can figure out how to fix that.)

Does this error message not occur in Hypercard as well as Plus?  I think
I've seen it before in Hypercard, but am not sure.

Jane

tim@hoptoad.uucp (Tim Maroney) (02/11/90)

The "stack overflow" error in Plus is probably the same as the "too
much recursion" error in HyperCard.  It means that a script is invoking
itself (perhaps indirectly through another script) and continuing to
invoke itself until the script stack overflows.  With each invocation of
a script, the old script state is pushed on a data structure called a
stack, to be popped off the stack later when the invoked script
finishes.  The stack can only hold so many script states.

You can test if this what the error message means by simply writing
a self-invoking stack, then invoking it from the message box and
seeing what error you get.

on wombat
  wombat
end wombat
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"Americans will buy anything, as long as it doesn't cross the thin line
 between cute and demonic." -- Ian Shoales