delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/23/15:03:01

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Mon, 23 Aug 2004 21:57:36 +0300
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c48943$Blat.v2.2.2$33853ac0@zahav.net.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2
In-reply-to: <8abf3e27.0408222350.41002bd4@posting.google.com>
(apendzich AT plusnet DOT pl)
Subject: Re: Djgpp, allegro and large datafile
References: <8abf3e27 DOT 0408222350 DOT 41002bd4 AT posting DOT google DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: apendzich AT plusnet DOT pl (Artur)
> Date: 23 Aug 2004 00:50:01 -0700
> 
> Is it possible that stack is overwritten by heap?

The stack cannot possibly be overwritten by the heap because the stack
is below the heap in the DJGPP run-time memory layout.  Since the heap
grows upward, while the stack is allocated at program startup time and
thereafter never changes, what you fear cannot happen.

Btw, it could well be that the debugger shows bogus values of the
function arguments due to optimizations.  I suggest to step several
lines into the function and then display the values of arguments
again, before you conclude that they are indeed garbled.

> I was calling a _go32_dpmi_remaining_physical_memory function and it
> shows that I have a lot of space (37MB) still free.

That doesn't say anything about the stack.  The stack is allocated in
one chunk at the beginning of the program, and can never grow.  Its
default size in DJGPP programs is 512KB.

There's a library function called `stackavail' that will tell you how
much stack space you have left at the point where you call it.  But I
doubt that this is the right way to debug the problem in your case.

> I can load datafile without problems. Problem appears when
> I try to call a function inside my program with values as parameters (
> int some_fun( long double var1, long double var2, int var3)).

It would help if you describe what is that ``problem'' that appears
with the larger data file.  If the program crashes, post here its full
crash message (after running bfdsymify on it).  If the ``problem''
manifests itself in some other way, please describe it in as much
detail as you can.  Then someone might have an idea about the possible
reason(s) of your problem.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019