Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Please Help - Error 202: Stack overflow error.

16 views
Skip to first unread message

Minh Pham

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
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.


Minh Pham

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to

Osmo Ronkanen

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
In article <Pine.WNT.4.10.9908240...@ppp25.hcl.com>,

Minh Pham <minh...@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


enztec

unread,
Sep 2, 1999, 3:00:00 AM9/2/99
to
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;

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

Mike Copeland

unread,
Sep 2, 1999, 3:00:00 AM9/2/99
to
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).

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

0 new messages