Board index » delphi » Please Help - Error 202: Stack overflow error.

Please Help - Error 202: Stack overflow error.

Please help.  I have been working on this program for years.

I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
Overflow error.  I tried changing everything with the memory stack size to
maximun in the Option.  I was just wondering whether there is any way
around this problem.  I tried setting the stack check off {$S-} but the
progam became erratic.

As an aside, if I convert it to Turbo C++, would this still be a problem?

Thank you.

 

Re:Please Help - Error 202: Stack overflow error.


Please help.  I have been working on this program for years.

I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
Overflow error.  I tried changing everything with the memory stack size to
maximun in the Option.  I was just wondering whether there is any way
around this problem.  I tried setting the stack check off {$S-} but the
progam became erratic.

As an aside, if I convert it to Turbo C++, would this still be a problem?

Thank you.

Re:Please Help - Error 202: Stack overflow error.


In article <Pine.WNT.4.10.9908240151320.-1660149-100...@ppp25.hcl.com>,
Minh Pham  <minh.p...@utoronto.ca> wrote:

Quote
>Please help.  I have been working on this program for years.

>I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
>Overflow error.  I tried changing everything with the memory stack size to
>maximun in the Option.  I was just wondering whether there is any way
>around this problem.  I tried setting the stack check off {$S-} but the
>progam became erratic.

Gee, maybe you could tell something more about the program. Like do you
use recursion. What kind of local variables you declare. etc. etc. etc.
etc. etc.

Setting stack checking off is the last thing to do when you get stack
overflow. I bet when you burn a fuse, you just insert a bigger one.

BTW is it really necessary to crosspost in so many groups. If I had
sen that before writing I would not have written this. Followups set.

Osmo

Re:Please Help - Error 202: Stack overflow error.


Bigger fuses??? why when a penny will do?
Quote
Osmo Ronkanen wrote:

> In article <Pine.WNT.4.10.9908240151320.-1660149-100...@ppp25.hcl.com>,
> Minh Pham  <minh.p...@utoronto.ca> wrote:
> >Please help.  I have been working on this program for years.

> >I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
> >Overflow error.  I tried changing everything with the memory stack size to
> >maximun in the Option.  I was just wondering whether there is any way
> >around this problem.  I tried setting the stack check off {$S-} but the
> >progam became erratic.

> Gee, maybe you could tell something more about the program. Like do you
> use recursion. What kind of local variables you declare. etc. etc. etc.
> etc. etc.

> Setting stack checking off is the last thing to do when you get stack
> overflow. I bet when you burn a fuse, you just insert a bigger one.

> BTW is it really necessary to crosspost in so many groups. If I had
> sen that before writing I would not have written this. Followups set.

> Osmo

Re:Please Help - Error 202: Stack overflow error.


I'd bet you are defining a variable with the same name as the name of
the variable you are passing in the procedure

is this what you have done?

procedure duck(goose : string);
var goose : string;

Quote
Minh Pham wrote:

> Please help.  I have been working on this program for years.

> I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
> Overflow error.  I tried changing everything with the memory stack size to
> maximun in the Option.  I was just wondering whether there is any way
> around this problem.  I tried setting the stack check off {$S-} but the
> progam became erratic.

> As an aside, if I convert it to Turbo C++, would this still be a problem?

> Thank you.

Re:Please Help - Error 202: Stack overflow error.


   Not necessarily the cause of a Stack Overflow error, IMO.  It's much
more likely to be one of the following:
  1. Declaring large local structures (or many) in a subprogram that's
called - nesting with other subprograms using significant amount of local
variables...or not.  The issue is that at any given time during the
program's execution, the _total_amount_ of Stack used cannot exceed the
limits stated in the $M directive (which has a maximum of 64K bytes).
  2. Extreme nesting of procedures which use together use some local
variables, so that the total exceeds the Stack limit.  This typically
involves very convoluted structure/logic, something which might have
evolved over a long time.  Could be very hard to track down...
  3. One of more recursive procedures which (1) recurse very deeply (due
to data vagaries) and/or (2) which use a significant amount of local
variables (such as strings).
Quote
> I'd bet you are defining a variable with the same name as the name of
> the variable you are passing in the procedure
> is this what you have done?

> procedure duck(goose : string);
> var goose : string;

> > Please help.  I have been working on this program for years.

> > I have a problem with Turbo Pascal 7.0.  I keep getting the 202 Stack
> > Overflow error.  I tried changing everything with the memory stack size to
> > maximun in the Option.  I was just wondering whether there is any way
> > around this problem.  I tried setting the stack check off {$S-} but the
> > progam became erratic.

> > As an aside, if I convert it to Turbo C++, would this still be a problem?

Other Threads