Board index » delphi » Stack Overflow problems when D1 executable fires up...

Stack Overflow problems when D1 executable fires up...

Quote
> We have a problem when firing up a D1 executable. Either on startup or shortly
> thereafter, the program crashes with Stack Overflow error message.  This app is
> running on a Pentium 100 16 MB machine.  Other apps running are Local
> Interbase, a 32 bit FTP server, and a 32 bit D2 messages server app ( which
> spins off threads upon connection requests..and destroys the threads upon
> connection termination).

> The other apps seem to run fine on their own.  The 16 bit and the 32 bit
> messages app look at and use the same tables on the Local Interbase server.

> I remember there being a place to change the stack on the D1 Project options,
> but, thought this only affected how things run within D1.

> Is there some setting we need to set in config.sys or one of the .ini files?
> Do we need to change something in the compile options in the 16 bit D1 app?

> Thanks in advance for any suggestions,

   "D1"?  Delphi 1.0?
   In any event, the Stack overflow error (202) is a result of having
insufficient Stack space reserved for what needs to be stored on the
Stack - maximum total for the program at any given time.  Stack is used
by parameters, local variables declared, and by whatever
nesting/recursion your program invokes by its executing logic.  In the
PC platform, you have a maximum Stack allocation of 64K bytes, and in
TP/BP the $M compilation options parameter defines the values of Stack,
Heap_Min, and Heap_Max.  I assume Delphi does the same (if we are in
fact talking about delphi)...
   The TP/BP default for Stack is 16K, and that may not be enough for
your application - for whatever reasons apply.  You can create your
override default by inserting the following into the start of your main
program source:
{$M 65535,0,655360}
and see what happens.
 

Re:Stack Overflow problems when D1 executable fires up...


Quote
> I remember there being a place to change the stack on the D1 Project
options,
> but, thought this only affected how things run within D1.

> Is there some setting we need to set in config.sys or one of the .ini
files?  
> Do we need to change something in the compile options in the 16 bit D1

app?

You can increase the stack value of the EXE by changing the
Project|Compiler|Stack
value, but it is not too likely to work.  If you use up the default 16k
stack, you probably
have infinite recursion going on somewhere....

--
--------------------------
Eric Lawrence
Delta Programming Group
Delta...@juno.com

Re:Stack Overflow problems when D1 executable fires up...


Quote
Cat...@alias.cyperpass.net (CatYak) wrote:
>Hello all!
>We have a problem when firing up a D1 executable. Either on startup or shortly
>thereafter, the program crashes with Stack Overflow error message.  This app is
>running on a Pentium 100 16 MB machine.  Other apps running are Local
>Interbase, a 32 bit FTP server, and a 32 bit D2 messages server app ( which
>spins off threads upon connection requests..and destroys the threads upon
>connection termination).  
>The other apps seem to run fine on their own.  The 16 bit and the 32 bit
>messages app look at and use the same tables on the Local Interbase server.
>I remember there being a place to change the stack on the D1 Project options,
>but, thought this only affected how things run within D1.
>Is there some setting we need to set in config.sys or one of the .ini files?  
>Do we need to change something in the compile options in the 16 bit D1 app?
>Thanks in advance for any suggestions,
>CatYak
>cat...@alias.{*word*104}pass.net

Are you sure the D1 executable is correct ? In my experience, stack
overflow often occurs from programming errors/oversights. Check for
recursive function calls and/or large function parameters/local
variables.

HTH

David A. Schweizer
iec ProGAMMA
d.a.schwei...@gamma.rug.nl

Other Threads